| #include "aidl/android/hardware/neuralnetworks/IDevice.h" | |
| #include <android/binder_parcel_utils.h> | |
| #include <aidl/android/hardware/neuralnetworks/BnBuffer.h> | |
| #include <aidl/android/hardware/neuralnetworks/BnBurst.h> | |
| #include <aidl/android/hardware/neuralnetworks/BnDevice.h> | |
| #include <aidl/android/hardware/neuralnetworks/BnExecution.h> | |
| #include <aidl/android/hardware/neuralnetworks/BnFencedExecutionCallback.h> | |
| #include <aidl/android/hardware/neuralnetworks/BnPreparedModel.h> | |
| #include <aidl/android/hardware/neuralnetworks/BnPreparedModelCallback.h> | |
| #include <aidl/android/hardware/neuralnetworks/BpBuffer.h> | |
| #include <aidl/android/hardware/neuralnetworks/BpBurst.h> | |
| #include <aidl/android/hardware/neuralnetworks/BpDevice.h> | |
| #include <aidl/android/hardware/neuralnetworks/BpExecution.h> | |
| #include <aidl/android/hardware/neuralnetworks/BpFencedExecutionCallback.h> | |
| #include <aidl/android/hardware/neuralnetworks/BpPreparedModel.h> | |
| #include <aidl/android/hardware/neuralnetworks/BpPreparedModelCallback.h> | |
| #include <aidl/android/hardware/neuralnetworks/IBuffer.h> | |
| #include <aidl/android/hardware/neuralnetworks/IBurst.h> | |
| #include <aidl/android/hardware/neuralnetworks/IExecution.h> | |
| #include <aidl/android/hardware/neuralnetworks/IFencedExecutionCallback.h> | |
| #include <aidl/android/hardware/neuralnetworks/IPreparedModel.h> | |
| #include <aidl/android/hardware/neuralnetworks/IPreparedModelCallback.h> | |
| namespace aidl { | |
| namespace android { | |
| namespace hardware { | |
| namespace neuralnetworks { | |
| static binder_status_t _aidl_android_hardware_neuralnetworks_IDevice_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) { | |
| (void)_aidl_in; | |
| (void)_aidl_out; | |
| binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION; | |
| std::shared_ptr<BnDevice> _aidl_impl = std::static_pointer_cast<BnDevice>(::ndk::ICInterface::asInterface(_aidl_binder)); | |
| switch (_aidl_code) { | |
| case (FIRST_CALL_TRANSACTION + 0 /*allocate*/): { | |
| ::aidl::android::hardware::neuralnetworks::BufferDesc in_desc; | |
| std::vector<::aidl::android::hardware::neuralnetworks::IPreparedModelParcel> in_preparedModels; | |
| std::vector<::aidl::android::hardware::neuralnetworks::BufferRole> in_inputRoles; | |
| std::vector<::aidl::android::hardware::neuralnetworks::BufferRole> in_outputRoles; | |
| ::aidl::android::hardware::neuralnetworks::DeviceBuffer _aidl_return; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_desc); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_preparedModels); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_inputRoles); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_outputRoles); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->allocate(in_desc, in_preparedModels, in_inputRoles, in_outputRoles, &_aidl_return); | |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| if (!AStatus_isOk(_aidl_status.get())) break; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| break; | |
| } | |
| case (FIRST_CALL_TRANSACTION + 1 /*getCapabilities*/): { | |
| ::aidl::android::hardware::neuralnetworks::Capabilities _aidl_return; | |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getCapabilities(&_aidl_return); | |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| if (!AStatus_isOk(_aidl_status.get())) break; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| break; | |
| } | |
| case (FIRST_CALL_TRANSACTION + 2 /*getNumberOfCacheFilesNeeded*/): { | |
| ::aidl::android::hardware::neuralnetworks::NumberOfCacheFiles _aidl_return; | |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getNumberOfCacheFilesNeeded(&_aidl_return); | |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| if (!AStatus_isOk(_aidl_status.get())) break; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| break; | |
| } | |
| case (FIRST_CALL_TRANSACTION + 3 /*getSupportedExtensions*/): { | |
| std::vector<::aidl::android::hardware::neuralnetworks::Extension> _aidl_return; | |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getSupportedExtensions(&_aidl_return); | |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| if (!AStatus_isOk(_aidl_status.get())) break; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| break; | |
| } | |
| case (FIRST_CALL_TRANSACTION + 4 /*getSupportedOperations*/): { | |
| ::aidl::android::hardware::neuralnetworks::Model in_model; | |
| std::vector<bool> _aidl_return; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_model); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getSupportedOperations(in_model, &_aidl_return); | |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| if (!AStatus_isOk(_aidl_status.get())) break; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| break; | |
| } | |
| case (FIRST_CALL_TRANSACTION + 5 /*getType*/): { | |
| ::aidl::android::hardware::neuralnetworks::DeviceType _aidl_return; | |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getType(&_aidl_return); | |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| if (!AStatus_isOk(_aidl_status.get())) break; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| break; | |
| } | |
| case (FIRST_CALL_TRANSACTION + 6 /*getVersionString*/): { | |
| std::string _aidl_return; | |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getVersionString(&_aidl_return); | |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| if (!AStatus_isOk(_aidl_status.get())) break; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| break; | |
| } | |
| case (FIRST_CALL_TRANSACTION + 7 /*prepareModel*/): { | |
| ::aidl::android::hardware::neuralnetworks::Model in_model; | |
| ::aidl::android::hardware::neuralnetworks::ExecutionPreference in_preference; | |
| ::aidl::android::hardware::neuralnetworks::Priority in_priority; | |
| int64_t in_deadlineNs; | |
| std::vector<::ndk::ScopedFileDescriptor> in_modelCache; | |
| std::vector<::ndk::ScopedFileDescriptor> in_dataCache; | |
| std::vector<uint8_t> in_token; | |
| std::shared_ptr<::aidl::android::hardware::neuralnetworks::IPreparedModelCallback> in_callback; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_model); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_preference); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_priority); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_deadlineNs); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_modelCache); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_dataCache); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_callback); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->prepareModel(in_model, in_preference, in_priority, in_deadlineNs, in_modelCache, in_dataCache, in_token, in_callback); | |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| if (!AStatus_isOk(_aidl_status.get())) break; | |
| break; | |
| } | |
| case (FIRST_CALL_TRANSACTION + 8 /*prepareModelFromCache*/): { | |
| int64_t in_deadlineNs; | |
| std::vector<::ndk::ScopedFileDescriptor> in_modelCache; | |
| std::vector<::ndk::ScopedFileDescriptor> in_dataCache; | |
| std::vector<uint8_t> in_token; | |
| std::shared_ptr<::aidl::android::hardware::neuralnetworks::IPreparedModelCallback> in_callback; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_deadlineNs); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_modelCache); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_dataCache); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_callback); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->prepareModelFromCache(in_deadlineNs, in_modelCache, in_dataCache, in_token, in_callback); | |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| if (!AStatus_isOk(_aidl_status.get())) break; | |
| break; | |
| } | |
| case (FIRST_CALL_TRANSACTION + 9 /*prepareModelWithConfig*/): { | |
| ::aidl::android::hardware::neuralnetworks::Model in_model; | |
| ::aidl::android::hardware::neuralnetworks::PrepareModelConfig in_config; | |
| std::shared_ptr<::aidl::android::hardware::neuralnetworks::IPreparedModelCallback> in_callback; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_model); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_config); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_callback); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->prepareModelWithConfig(in_model, in_config, in_callback); | |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| if (!AStatus_isOk(_aidl_status.get())) break; | |
| break; | |
| } | |
| case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): { | |
| int32_t _aidl_return; | |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return); | |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| if (!AStatus_isOk(_aidl_status.get())) break; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| break; | |
| } | |
| case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): { | |
| std::string _aidl_return; | |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return); | |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| if (!AStatus_isOk(_aidl_status.get())) break; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) break; | |
| break; | |
| } | |
| } | |
| return _aidl_ret_status; | |
| } | |
| static AIBinder_Class* _g_aidl_android_hardware_neuralnetworks_IDevice_clazz = ::ndk::ICInterface::defineClass(IDevice::descriptor, _aidl_android_hardware_neuralnetworks_IDevice_onTransact); | |
| BpDevice::BpDevice(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {} | |
| BpDevice::~BpDevice() {} | |
| ::ndk::ScopedAStatus BpDevice::allocate(const ::aidl::android::hardware::neuralnetworks::BufferDesc& in_desc, const std::vector<::aidl::android::hardware::neuralnetworks::IPreparedModelParcel>& in_preparedModels, const std::vector<::aidl::android::hardware::neuralnetworks::BufferRole>& in_inputRoles, const std::vector<::aidl::android::hardware::neuralnetworks::BufferRole>& in_outputRoles, ::aidl::android::hardware::neuralnetworks::DeviceBuffer* _aidl_return) { | |
| binder_status_t _aidl_ret_status = STATUS_OK; | |
| ::ndk::ScopedAStatus _aidl_status; | |
| ::ndk::ScopedAParcel _aidl_in; | |
| ::ndk::ScopedAParcel _aidl_out; | |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_desc); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_preparedModels); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_inputRoles); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_outputRoles); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AIBinder_transact( | |
| asBinder().get(), | |
| (FIRST_CALL_TRANSACTION + 0 /*allocate*/), | |
| _aidl_in.getR(), | |
| _aidl_out.getR(), | |
| 0 | |
| #ifdef BINDER_STABILITY_SUPPORT | |
| | FLAG_PRIVATE_LOCAL | |
| #endif // BINDER_STABILITY_SUPPORT | |
| ); | |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IDevice::getDefaultImpl()) { | |
| _aidl_status = IDevice::getDefaultImpl()->allocate(in_desc, in_preparedModels, in_inputRoles, in_outputRoles, _aidl_return); | |
| goto _aidl_status_return; | |
| } | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_error: | |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); | |
| _aidl_status_return: | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus BpDevice::getCapabilities(::aidl::android::hardware::neuralnetworks::Capabilities* _aidl_return) { | |
| binder_status_t _aidl_ret_status = STATUS_OK; | |
| ::ndk::ScopedAStatus _aidl_status; | |
| ::ndk::ScopedAParcel _aidl_in; | |
| ::ndk::ScopedAParcel _aidl_out; | |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AIBinder_transact( | |
| asBinder().get(), | |
| (FIRST_CALL_TRANSACTION + 1 /*getCapabilities*/), | |
| _aidl_in.getR(), | |
| _aidl_out.getR(), | |
| 0 | |
| #ifdef BINDER_STABILITY_SUPPORT | |
| | FLAG_PRIVATE_LOCAL | |
| #endif // BINDER_STABILITY_SUPPORT | |
| ); | |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IDevice::getDefaultImpl()) { | |
| _aidl_status = IDevice::getDefaultImpl()->getCapabilities(_aidl_return); | |
| goto _aidl_status_return; | |
| } | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_error: | |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); | |
| _aidl_status_return: | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus BpDevice::getNumberOfCacheFilesNeeded(::aidl::android::hardware::neuralnetworks::NumberOfCacheFiles* _aidl_return) { | |
| binder_status_t _aidl_ret_status = STATUS_OK; | |
| ::ndk::ScopedAStatus _aidl_status; | |
| ::ndk::ScopedAParcel _aidl_in; | |
| ::ndk::ScopedAParcel _aidl_out; | |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AIBinder_transact( | |
| asBinder().get(), | |
| (FIRST_CALL_TRANSACTION + 2 /*getNumberOfCacheFilesNeeded*/), | |
| _aidl_in.getR(), | |
| _aidl_out.getR(), | |
| 0 | |
| #ifdef BINDER_STABILITY_SUPPORT | |
| | FLAG_PRIVATE_LOCAL | |
| #endif // BINDER_STABILITY_SUPPORT | |
| ); | |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IDevice::getDefaultImpl()) { | |
| _aidl_status = IDevice::getDefaultImpl()->getNumberOfCacheFilesNeeded(_aidl_return); | |
| goto _aidl_status_return; | |
| } | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_error: | |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); | |
| _aidl_status_return: | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus BpDevice::getSupportedExtensions(std::vector<::aidl::android::hardware::neuralnetworks::Extension>* _aidl_return) { | |
| binder_status_t _aidl_ret_status = STATUS_OK; | |
| ::ndk::ScopedAStatus _aidl_status; | |
| ::ndk::ScopedAParcel _aidl_in; | |
| ::ndk::ScopedAParcel _aidl_out; | |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AIBinder_transact( | |
| asBinder().get(), | |
| (FIRST_CALL_TRANSACTION + 3 /*getSupportedExtensions*/), | |
| _aidl_in.getR(), | |
| _aidl_out.getR(), | |
| 0 | |
| #ifdef BINDER_STABILITY_SUPPORT | |
| | FLAG_PRIVATE_LOCAL | |
| #endif // BINDER_STABILITY_SUPPORT | |
| ); | |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IDevice::getDefaultImpl()) { | |
| _aidl_status = IDevice::getDefaultImpl()->getSupportedExtensions(_aidl_return); | |
| goto _aidl_status_return; | |
| } | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_error: | |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); | |
| _aidl_status_return: | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus BpDevice::getSupportedOperations(const ::aidl::android::hardware::neuralnetworks::Model& in_model, std::vector<bool>* _aidl_return) { | |
| binder_status_t _aidl_ret_status = STATUS_OK; | |
| ::ndk::ScopedAStatus _aidl_status; | |
| ::ndk::ScopedAParcel _aidl_in; | |
| ::ndk::ScopedAParcel _aidl_out; | |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_model); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AIBinder_transact( | |
| asBinder().get(), | |
| (FIRST_CALL_TRANSACTION + 4 /*getSupportedOperations*/), | |
| _aidl_in.getR(), | |
| _aidl_out.getR(), | |
| 0 | |
| #ifdef BINDER_STABILITY_SUPPORT | |
| | FLAG_PRIVATE_LOCAL | |
| #endif // BINDER_STABILITY_SUPPORT | |
| ); | |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IDevice::getDefaultImpl()) { | |
| _aidl_status = IDevice::getDefaultImpl()->getSupportedOperations(in_model, _aidl_return); | |
| goto _aidl_status_return; | |
| } | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_error: | |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); | |
| _aidl_status_return: | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus BpDevice::getType(::aidl::android::hardware::neuralnetworks::DeviceType* _aidl_return) { | |
| binder_status_t _aidl_ret_status = STATUS_OK; | |
| ::ndk::ScopedAStatus _aidl_status; | |
| ::ndk::ScopedAParcel _aidl_in; | |
| ::ndk::ScopedAParcel _aidl_out; | |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AIBinder_transact( | |
| asBinder().get(), | |
| (FIRST_CALL_TRANSACTION + 5 /*getType*/), | |
| _aidl_in.getR(), | |
| _aidl_out.getR(), | |
| 0 | |
| #ifdef BINDER_STABILITY_SUPPORT | |
| | FLAG_PRIVATE_LOCAL | |
| #endif // BINDER_STABILITY_SUPPORT | |
| ); | |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IDevice::getDefaultImpl()) { | |
| _aidl_status = IDevice::getDefaultImpl()->getType(_aidl_return); | |
| goto _aidl_status_return; | |
| } | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_error: | |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); | |
| _aidl_status_return: | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus BpDevice::getVersionString(std::string* _aidl_return) { | |
| binder_status_t _aidl_ret_status = STATUS_OK; | |
| ::ndk::ScopedAStatus _aidl_status; | |
| ::ndk::ScopedAParcel _aidl_in; | |
| ::ndk::ScopedAParcel _aidl_out; | |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AIBinder_transact( | |
| asBinder().get(), | |
| (FIRST_CALL_TRANSACTION + 6 /*getVersionString*/), | |
| _aidl_in.getR(), | |
| _aidl_out.getR(), | |
| 0 | |
| #ifdef BINDER_STABILITY_SUPPORT | |
| | FLAG_PRIVATE_LOCAL | |
| #endif // BINDER_STABILITY_SUPPORT | |
| ); | |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IDevice::getDefaultImpl()) { | |
| _aidl_status = IDevice::getDefaultImpl()->getVersionString(_aidl_return); | |
| goto _aidl_status_return; | |
| } | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_error: | |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); | |
| _aidl_status_return: | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus BpDevice::prepareModel(const ::aidl::android::hardware::neuralnetworks::Model& in_model, ::aidl::android::hardware::neuralnetworks::ExecutionPreference in_preference, ::aidl::android::hardware::neuralnetworks::Priority in_priority, int64_t in_deadlineNs, const std::vector<::ndk::ScopedFileDescriptor>& in_modelCache, const std::vector<::ndk::ScopedFileDescriptor>& in_dataCache, const std::vector<uint8_t>& in_token, const std::shared_ptr<::aidl::android::hardware::neuralnetworks::IPreparedModelCallback>& in_callback) { | |
| binder_status_t _aidl_ret_status = STATUS_OK; | |
| ::ndk::ScopedAStatus _aidl_status; | |
| ::ndk::ScopedAParcel _aidl_in; | |
| ::ndk::ScopedAParcel _aidl_out; | |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_model); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_preference); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_priority); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_deadlineNs); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_modelCache); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_dataCache); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_callback); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AIBinder_transact( | |
| asBinder().get(), | |
| (FIRST_CALL_TRANSACTION + 7 /*prepareModel*/), | |
| _aidl_in.getR(), | |
| _aidl_out.getR(), | |
| 0 | |
| #ifdef BINDER_STABILITY_SUPPORT | |
| | FLAG_PRIVATE_LOCAL | |
| #endif // BINDER_STABILITY_SUPPORT | |
| ); | |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IDevice::getDefaultImpl()) { | |
| _aidl_status = IDevice::getDefaultImpl()->prepareModel(in_model, in_preference, in_priority, in_deadlineNs, in_modelCache, in_dataCache, in_token, in_callback); | |
| goto _aidl_status_return; | |
| } | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; | |
| _aidl_error: | |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); | |
| _aidl_status_return: | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus BpDevice::prepareModelFromCache(int64_t in_deadlineNs, const std::vector<::ndk::ScopedFileDescriptor>& in_modelCache, const std::vector<::ndk::ScopedFileDescriptor>& in_dataCache, const std::vector<uint8_t>& in_token, const std::shared_ptr<::aidl::android::hardware::neuralnetworks::IPreparedModelCallback>& in_callback) { | |
| binder_status_t _aidl_ret_status = STATUS_OK; | |
| ::ndk::ScopedAStatus _aidl_status; | |
| ::ndk::ScopedAParcel _aidl_in; | |
| ::ndk::ScopedAParcel _aidl_out; | |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_deadlineNs); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_modelCache); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_dataCache); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_callback); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AIBinder_transact( | |
| asBinder().get(), | |
| (FIRST_CALL_TRANSACTION + 8 /*prepareModelFromCache*/), | |
| _aidl_in.getR(), | |
| _aidl_out.getR(), | |
| 0 | |
| #ifdef BINDER_STABILITY_SUPPORT | |
| | FLAG_PRIVATE_LOCAL | |
| #endif // BINDER_STABILITY_SUPPORT | |
| ); | |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IDevice::getDefaultImpl()) { | |
| _aidl_status = IDevice::getDefaultImpl()->prepareModelFromCache(in_deadlineNs, in_modelCache, in_dataCache, in_token, in_callback); | |
| goto _aidl_status_return; | |
| } | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; | |
| _aidl_error: | |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); | |
| _aidl_status_return: | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus BpDevice::prepareModelWithConfig(const ::aidl::android::hardware::neuralnetworks::Model& in_model, const ::aidl::android::hardware::neuralnetworks::PrepareModelConfig& in_config, const std::shared_ptr<::aidl::android::hardware::neuralnetworks::IPreparedModelCallback>& in_callback) { | |
| binder_status_t _aidl_ret_status = STATUS_OK; | |
| ::ndk::ScopedAStatus _aidl_status; | |
| ::ndk::ScopedAParcel _aidl_in; | |
| ::ndk::ScopedAParcel _aidl_out; | |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_model); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_config); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_callback); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AIBinder_transact( | |
| asBinder().get(), | |
| (FIRST_CALL_TRANSACTION + 9 /*prepareModelWithConfig*/), | |
| _aidl_in.getR(), | |
| _aidl_out.getR(), | |
| 0 | |
| #ifdef BINDER_STABILITY_SUPPORT | |
| | FLAG_PRIVATE_LOCAL | |
| #endif // BINDER_STABILITY_SUPPORT | |
| ); | |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IDevice::getDefaultImpl()) { | |
| _aidl_status = IDevice::getDefaultImpl()->prepareModelWithConfig(in_model, in_config, in_callback); | |
| goto _aidl_status_return; | |
| } | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; | |
| _aidl_error: | |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); | |
| _aidl_status_return: | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus BpDevice::getInterfaceVersion(int32_t* _aidl_return) { | |
| binder_status_t _aidl_ret_status = STATUS_OK; | |
| ::ndk::ScopedAStatus _aidl_status; | |
| if (_aidl_cached_version != -1) { | |
| *_aidl_return = _aidl_cached_version; | |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAParcel _aidl_in; | |
| ::ndk::ScopedAParcel _aidl_out; | |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AIBinder_transact( | |
| asBinder().get(), | |
| (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/), | |
| _aidl_in.getR(), | |
| _aidl_out.getR(), | |
| 0 | |
| #ifdef BINDER_STABILITY_SUPPORT | |
| | FLAG_PRIVATE_LOCAL | |
| #endif // BINDER_STABILITY_SUPPORT | |
| ); | |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IDevice::getDefaultImpl()) { | |
| _aidl_status = IDevice::getDefaultImpl()->getInterfaceVersion(_aidl_return); | |
| goto _aidl_status_return; | |
| } | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_cached_version = *_aidl_return; | |
| _aidl_error: | |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); | |
| _aidl_status_return: | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus BpDevice::getInterfaceHash(std::string* _aidl_return) { | |
| binder_status_t _aidl_ret_status = STATUS_OK; | |
| ::ndk::ScopedAStatus _aidl_status; | |
| const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex); | |
| if (_aidl_cached_hash != "-1") { | |
| *_aidl_return = _aidl_cached_hash; | |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAParcel _aidl_in; | |
| ::ndk::ScopedAParcel _aidl_out; | |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AIBinder_transact( | |
| asBinder().get(), | |
| (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/), | |
| _aidl_in.getR(), | |
| _aidl_out.getR(), | |
| 0 | |
| #ifdef BINDER_STABILITY_SUPPORT | |
| | FLAG_PRIVATE_LOCAL | |
| #endif // BINDER_STABILITY_SUPPORT | |
| ); | |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IDevice::getDefaultImpl()) { | |
| _aidl_status = IDevice::getDefaultImpl()->getInterfaceHash(_aidl_return); | |
| goto _aidl_status_return; | |
| } | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; | |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return); | |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; | |
| _aidl_cached_hash = *_aidl_return; | |
| _aidl_error: | |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); | |
| _aidl_status_return: | |
| return _aidl_status; | |
| } | |
| // Source for BnDevice | |
| BnDevice::BnDevice() {} | |
| BnDevice::~BnDevice() {} | |
| ::ndk::SpAIBinder BnDevice::createBinder() { | |
| AIBinder* binder = AIBinder_new(_g_aidl_android_hardware_neuralnetworks_IDevice_clazz, static_cast<void*>(this)); | |
| #ifdef BINDER_STABILITY_SUPPORT | |
| AIBinder_markVintfStability(binder); | |
| #endif // BINDER_STABILITY_SUPPORT | |
| return ::ndk::SpAIBinder(binder); | |
| } | |
| ::ndk::ScopedAStatus BnDevice::getInterfaceVersion(int32_t* _aidl_return) { | |
| *_aidl_return = IDevice::version; | |
| return ::ndk::ScopedAStatus(AStatus_newOk()); | |
| } | |
| ::ndk::ScopedAStatus BnDevice::getInterfaceHash(std::string* _aidl_return) { | |
| *_aidl_return = IDevice::hash; | |
| return ::ndk::ScopedAStatus(AStatus_newOk()); | |
| } | |
| // Source for IDevice | |
| const char* IDevice::descriptor = "android.hardware.neuralnetworks.IDevice"; | |
| IDevice::IDevice() {} | |
| IDevice::~IDevice() {} | |
| std::shared_ptr<IDevice> IDevice::fromBinder(const ::ndk::SpAIBinder& binder) { | |
| if (!AIBinder_associateClass(binder.get(), _g_aidl_android_hardware_neuralnetworks_IDevice_clazz)) { return nullptr; } | |
| std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get()); | |
| if (interface) { | |
| return std::static_pointer_cast<IDevice>(interface); | |
| } | |
| return ::ndk::SharedRefBase::make<BpDevice>(binder); | |
| } | |
| binder_status_t IDevice::writeToParcel(AParcel* parcel, const std::shared_ptr<IDevice>& instance) { | |
| return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr); | |
| } | |
| binder_status_t IDevice::readFromParcel(const AParcel* parcel, std::shared_ptr<IDevice>* instance) { | |
| ::ndk::SpAIBinder binder; | |
| binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR()); | |
| if (status != STATUS_OK) return status; | |
| *instance = IDevice::fromBinder(binder); | |
| return STATUS_OK; | |
| } | |
| bool IDevice::setDefaultImpl(const std::shared_ptr<IDevice>& impl) { | |
| // Only one user of this interface can use this function | |
| // at a time. This is a heuristic to detect if two different | |
| // users in the same process use this function. | |
| assert(!IDevice::default_impl); | |
| if (impl) { | |
| IDevice::default_impl = impl; | |
| return true; | |
| } | |
| return false; | |
| } | |
| const std::shared_ptr<IDevice>& IDevice::getDefaultImpl() { | |
| return IDevice::default_impl; | |
| } | |
| std::shared_ptr<IDevice> IDevice::default_impl = nullptr; | |
| ::ndk::ScopedAStatus IDeviceDefault::allocate(const ::aidl::android::hardware::neuralnetworks::BufferDesc& /*in_desc*/, const std::vector<::aidl::android::hardware::neuralnetworks::IPreparedModelParcel>& /*in_preparedModels*/, const std::vector<::aidl::android::hardware::neuralnetworks::BufferRole>& /*in_inputRoles*/, const std::vector<::aidl::android::hardware::neuralnetworks::BufferRole>& /*in_outputRoles*/, ::aidl::android::hardware::neuralnetworks::DeviceBuffer* /*_aidl_return*/) { | |
| ::ndk::ScopedAStatus _aidl_status; | |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus IDeviceDefault::getCapabilities(::aidl::android::hardware::neuralnetworks::Capabilities* /*_aidl_return*/) { | |
| ::ndk::ScopedAStatus _aidl_status; | |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus IDeviceDefault::getNumberOfCacheFilesNeeded(::aidl::android::hardware::neuralnetworks::NumberOfCacheFiles* /*_aidl_return*/) { | |
| ::ndk::ScopedAStatus _aidl_status; | |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus IDeviceDefault::getSupportedExtensions(std::vector<::aidl::android::hardware::neuralnetworks::Extension>* /*_aidl_return*/) { | |
| ::ndk::ScopedAStatus _aidl_status; | |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus IDeviceDefault::getSupportedOperations(const ::aidl::android::hardware::neuralnetworks::Model& /*in_model*/, std::vector<bool>* /*_aidl_return*/) { | |
| ::ndk::ScopedAStatus _aidl_status; | |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus IDeviceDefault::getType(::aidl::android::hardware::neuralnetworks::DeviceType* /*_aidl_return*/) { | |
| ::ndk::ScopedAStatus _aidl_status; | |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus IDeviceDefault::getVersionString(std::string* /*_aidl_return*/) { | |
| ::ndk::ScopedAStatus _aidl_status; | |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus IDeviceDefault::prepareModel(const ::aidl::android::hardware::neuralnetworks::Model& /*in_model*/, ::aidl::android::hardware::neuralnetworks::ExecutionPreference /*in_preference*/, ::aidl::android::hardware::neuralnetworks::Priority /*in_priority*/, int64_t /*in_deadlineNs*/, const std::vector<::ndk::ScopedFileDescriptor>& /*in_modelCache*/, const std::vector<::ndk::ScopedFileDescriptor>& /*in_dataCache*/, const std::vector<uint8_t>& /*in_token*/, const std::shared_ptr<::aidl::android::hardware::neuralnetworks::IPreparedModelCallback>& /*in_callback*/) { | |
| ::ndk::ScopedAStatus _aidl_status; | |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus IDeviceDefault::prepareModelFromCache(int64_t /*in_deadlineNs*/, const std::vector<::ndk::ScopedFileDescriptor>& /*in_modelCache*/, const std::vector<::ndk::ScopedFileDescriptor>& /*in_dataCache*/, const std::vector<uint8_t>& /*in_token*/, const std::shared_ptr<::aidl::android::hardware::neuralnetworks::IPreparedModelCallback>& /*in_callback*/) { | |
| ::ndk::ScopedAStatus _aidl_status; | |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus IDeviceDefault::prepareModelWithConfig(const ::aidl::android::hardware::neuralnetworks::Model& /*in_model*/, const ::aidl::android::hardware::neuralnetworks::PrepareModelConfig& /*in_config*/, const std::shared_ptr<::aidl::android::hardware::neuralnetworks::IPreparedModelCallback>& /*in_callback*/) { | |
| ::ndk::ScopedAStatus _aidl_status; | |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); | |
| return _aidl_status; | |
| } | |
| ::ndk::ScopedAStatus IDeviceDefault::getInterfaceVersion(int32_t* _aidl_return) { | |
| *_aidl_return = 0; | |
| return ::ndk::ScopedAStatus(AStatus_newOk()); | |
| } | |
| ::ndk::ScopedAStatus IDeviceDefault::getInterfaceHash(std::string* _aidl_return) { | |
| *_aidl_return = ""; | |
| return ::ndk::ScopedAStatus(AStatus_newOk()); | |
| } | |
| ::ndk::SpAIBinder IDeviceDefault::asBinder() { | |
| return ::ndk::SpAIBinder(); | |
| } | |
| bool IDeviceDefault::isRemote() { | |
| return false; | |
| } | |
| } // namespace neuralnetworks | |
| } // namespace hardware | |
| } // namespace android | |
| } // namespace aidl |