fix build break from PR#2850 api change (#4451)

This commit is contained in:
George Wu 2020-07-09 00:02:12 +00:00 committed by GitHub
parent cb5c4292b8
commit f24d8e4587
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 24 deletions

View file

@ -73,27 +73,21 @@ ArmNNExecutionProvider::ArmNNExecutionProvider(const ArmNNExecutionProviderInfo&
: IExecutionProvider{onnxruntime::kArmNNExecutionProvider} {
ORT_UNUSED_PARAMETER(info);
auto default_allocator_factory = [](int) {
auto memory_info = onnxruntime::make_unique<OrtMemoryInfo>(ArmNN, OrtAllocatorType::OrtDeviceAllocator);
return onnxruntime::make_unique<CPUAllocator>(std::move(memory_info));
};
DeviceAllocatorRegistrationInfo default_memory_info{
OrtMemTypeDefault,
std::move(default_allocator_factory),
[](int) {
return onnxruntime::make_unique<CPUAllocator>(OrtMemoryInfo(ArmNN, OrtAllocatorType::OrtDeviceAllocator));
},
std::numeric_limits<size_t>::max()};
InsertAllocator(CreateAllocator(default_memory_info));
auto cpu_allocator_factory = [](int) {
auto memory_info = onnxruntime::make_unique<OrtMemoryInfo>(
ArmNN_CPU, OrtAllocatorType::OrtDeviceAllocator, OrtDevice(), 0, OrtMemTypeCPUOutput);
return onnxruntime::make_unique<CPUAllocator>(std::move(memory_info));
};
DeviceAllocatorRegistrationInfo cpu_memory_info{
OrtMemTypeCPUOutput,
std::move(cpu_allocator_factory),
[](int) {
return onnxruntime::make_unique<CPUAllocator>(
OrtMemoryInfo(ArmNN_CPU, OrtAllocatorType::OrtDeviceAllocator, OrtDevice(), 0, OrtMemTypeCPUOutput));
},
std::numeric_limits<size_t>::max()};
InsertAllocator(CreateAllocator(cpu_memory_info));

View file

@ -39,25 +39,23 @@ struct RknpuFuncState {
RknpuExecutionProvider::RknpuExecutionProvider()
: IExecutionProvider{onnxruntime::kRknpuExecutionProvider} {
auto default_allocator_factory = [](int) {
auto memory_info = onnxruntime::make_unique<OrtMemoryInfo>(RKNPU, OrtAllocatorType::OrtDeviceAllocator);
return onnxruntime::make_unique<CPUAllocator>(std::move(memory_info));
};
DeviceAllocatorRegistrationInfo default_memory_info{
OrtMemTypeDefault,
std::move(default_allocator_factory),
[](int) {
return onnxruntime::make_unique<CPUAllocator>(OrtMemoryInfo(RKNPU, OrtAllocatorType::OrtDeviceAllocator));
},
std::numeric_limits<size_t>::max()};
InsertAllocator(CreateAllocator(default_memory_info));
auto cpu_allocator_factory = [](int) {
auto memory_info = onnxruntime::make_unique<OrtMemoryInfo>(
RKNPU, OrtAllocatorType::OrtDeviceAllocator, OrtDevice(), 0, OrtMemTypeCPUOutput);
return onnxruntime::make_unique<CPUAllocator>(std::move(memory_info));
};
DeviceAllocatorRegistrationInfo cpu_memory_info{
OrtMemTypeCPUOutput,
std::move(cpu_allocator_factory),
[](int) {
return onnxruntime::make_unique<CPUAllocator>(
OrtMemoryInfo(RKNPU, OrtAllocatorType::OrtDeviceAllocator, OrtDevice(), 0, OrtMemTypeCPUOutput));
},
std::numeric_limits<size_t>::max()};
InsertAllocator(CreateAllocator(cpu_memory_info));
}