| // Copyright 2020 The Chromium OS Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // This is the boilerplate implementation of the IAllocator HAL interface, |
| // generated by the hidl-gen tool and then modified for use on Chrome OS. |
| // Modifications include: |
| // - Removal of non boiler plate client and server related code. |
| // - Reformatting to meet the Chrome OS coding standards. |
| // |
| // Originally generated with the command: |
| // $ hidl-gen -o output -L c++-adapter -r android.hardware:hardware/interfaces \ |
| // android.hardware.neuralnetworks@1.2 |
| |
| #include <android/hardware/neuralnetworks/1.2/APreparedModelCallback.h> |
| #include <android/hardware/neuralnetworks/1.0/APreparedModel.h> |
| #include <android/hardware/neuralnetworks/1.2/AExecutionCallback.h> |
| #include <android/hardware/neuralnetworks/1.2/APreparedModel.h> |
| #include <hidladapter/HidlBinderAdapter.h> |
| |
| namespace android { |
| namespace hardware { |
| namespace neuralnetworks { |
| namespace V1_2 { |
| |
| APreparedModelCallback::APreparedModelCallback( |
| const ::android::sp< |
| ::android::hardware::neuralnetworks::V1_2::IPreparedModelCallback>& |
| impl) |
| : mImpl(impl) { |
| } // Methods from |
| // ::android::hardware::neuralnetworks::V1_0::IPreparedModelCallback follow. |
| ::android::hardware::Return<void> APreparedModelCallback::notify( |
| ::android::hardware::neuralnetworks::V1_0::ErrorStatus status, |
| const ::android::sp< |
| ::android::hardware::neuralnetworks::V1_0::IPreparedModel>& |
| preparedModel) { |
| auto _hidl_out = mImpl->notify( |
| status, |
| static_cast<::android::sp< |
| ::android::hardware::neuralnetworks::V1_0::IPreparedModel>>( |
| ::android::hardware::neuralnetworks::V1_0::IPreparedModel::castFrom( |
| ::android::hardware::details::adaptWithDefault( |
| static_cast< |
| ::android::sp<::android::hardware::neuralnetworks::V1_0:: |
| IPreparedModel>>(preparedModel), |
| [&] { |
| return new ::android::hardware::neuralnetworks::V1_0:: |
| APreparedModel(preparedModel); |
| })))); |
| return _hidl_out; |
| } |
| |
| // Methods from |
| // ::android::hardware::neuralnetworks::V1_2::IPreparedModelCallback follow. |
| ::android::hardware::Return<void> APreparedModelCallback::notify_1_2( |
| ::android::hardware::neuralnetworks::V1_0::ErrorStatus status, |
| const ::android::sp< |
| ::android::hardware::neuralnetworks::V1_2::IPreparedModel>& |
| preparedModel) { |
| auto _hidl_out = mImpl->notify_1_2( |
| status, |
| static_cast<::android::sp< |
| ::android::hardware::neuralnetworks::V1_2::IPreparedModel>>( |
| ::android::hardware::neuralnetworks::V1_2::IPreparedModel::castFrom( |
| ::android::hardware::details::adaptWithDefault( |
| static_cast< |
| ::android::sp<::android::hardware::neuralnetworks::V1_2:: |
| IPreparedModel>>(preparedModel), |
| [&] { |
| return new ::android::hardware::neuralnetworks::V1_2:: |
| APreparedModel(preparedModel); |
| })))); |
| return _hidl_out; |
| } |
| |
| // Methods from ::android::hidl::base::V1_0::IBase follow. |
| |
| } // namespace V1_2 |
| } // namespace neuralnetworks |
| } // namespace hardware |
| } // namespace android |