提交 baa08394 编写于 作者: 李寅

map neon allocator

上级 8f3f7d9c
...@@ -16,9 +16,11 @@ void SetCPUAllocator(CPUAllocator* alloc) { ...@@ -16,9 +16,11 @@ void SetCPUAllocator(CPUAllocator* alloc) {
} }
Allocator* GetDeviceAllocator(DeviceType type) { Allocator* GetDeviceAllocator(DeviceType type) {
if (type == DeviceType::CPU) { switch (type) {
case DeviceType::CPU:
case DeviceType::NEON:
return cpu_allocator(); return cpu_allocator();
} else { default:
REQUIRE(false, "device type ", type, " is not supported."); REQUIRE(false, "device type ", type, " is not supported.");
} }
return nullptr; return nullptr;
......
...@@ -23,7 +23,7 @@ MACE_DEFINE_REGISTRY( ...@@ -23,7 +23,7 @@ MACE_DEFINE_REGISTRY(
OperatorBase, OperatorBase,
const OperatorDef&, const OperatorDef&,
Workspace*); Workspace*);
MACE_REGISTER_DEVICE_TYPE(DeviceType::NEON, CPUOperatorRegistry); MACE_REGISTER_DEVICE_TYPE(DeviceType::NEON, NEONOperatorRegistry);
unique_ptr<OperatorBase> CreateOperator( unique_ptr<OperatorBase> CreateOperator(
const OperatorDef& operator_def, const OperatorDef& operator_def,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册