Move NN memory utils from utils/common to 1.0/utils
This change is part of a larger chain of changes to remove HIDL and AIDL
libraries from neuralnetworks_utils_hal_common.
Bug: N/A
Test: mma
Change-Id: I9d4f0c30932fad7ccb6231aa03e57f7227af4880
diff --git a/neuralnetworks/1.2/utils/src/Conversions.cpp b/neuralnetworks/1.2/utils/src/Conversions.cpp
index c8e83a2..ef5056b 100644
--- a/neuralnetworks/1.2/utils/src/Conversions.cpp
+++ b/neuralnetworks/1.2/utils/src/Conversions.cpp
@@ -264,14 +264,6 @@
};
}
-GeneralResult<SharedHandle> unvalidatedConvert(const hidl_handle& hidlHandle) {
- if (hidlHandle.getNativeHandle() == nullptr) {
- return nullptr;
- }
- auto handle = NN_TRY(hal::utils::sharedHandleFromNativeHandle(hidlHandle.getNativeHandle()));
- return std::make_shared<const Handle>(std::move(handle));
-}
-
GeneralResult<DeviceType> convert(const hal::V1_2::DeviceType& deviceType) {
return validatedConvert(deviceType);
}
@@ -334,6 +326,10 @@
return V1_0::utils::unvalidatedConvert(operandValues);
}
+nn::GeneralResult<hidl_handle> unvalidatedConvert(const nn::SharedHandle& handle) {
+ return V1_0::utils::unvalidatedConvert(handle);
+}
+
nn::GeneralResult<hidl_memory> unvalidatedConvert(const nn::SharedMemory& memory) {
return V1_0::utils::unvalidatedConvert(memory);
}
@@ -544,13 +540,6 @@
};
}
-nn::GeneralResult<hidl_handle> unvalidatedConvert(const nn::SharedHandle& handle) {
- if (handle == nullptr) {
- return {};
- }
- return hal::utils::hidlHandleFromSharedHandle(*handle);
-}
-
nn::GeneralResult<DeviceType> convert(const nn::DeviceType& deviceType) {
return validatedConvert(deviceType);
}