diff --git a/mace/core/BUILD b/mace/core/BUILD index 417c1374d901af30154ae242a8c525cd73f9e8f6..d1fdd7acb888fa2efa341955994d8b31c38f5137 100644 --- a/mace/core/BUILD +++ b/mace/core/BUILD @@ -15,6 +15,7 @@ load( "if_production_mode", "if_not_production_mode", "if_openmp_enabled", + "if_neon_enabled", ) cc_library( @@ -47,7 +48,11 @@ cc_library( "-DMACE_ENABLE_OPENMP", ]) + if_android([ "-DMACE_ENABLE_OPENCL", - ]) + if_hexagon_enabled(["-DMACE_ENABLE_HEXAGON"]), + ]) + if_hexagon_enabled([ + "-DMACE_ENABLE_HEXAGON", + ]) + if_neon_enabled([ + "-DMACE_ENABLE_NEON", + ]), linkopts = ["-ldl"] + if_android([ "-pie", "-lm", diff --git a/mace/core/tensor.h b/mace/core/tensor.h index 8c9f3e3b6a139f25d1d6f7a03754bc817e245795..ac321f2e5e03fcefdfeb9b008482d357dbac7932 100644 --- a/mace/core/tensor.h +++ b/mace/core/tensor.h @@ -222,6 +222,8 @@ class Tensor { if (buffer_ != nullptr) { MACE_CHECK(!has_opencl_image(), "Cannot resize image, use ResizeImage."); if (raw_size() + EXTRA_BUFFER_PAD_SIZE > buffer_->size()) { + LOG(WARNING) << "Resize buffer from size " << buffer_->size() << " to " + << raw_size() + EXTRA_BUFFER_PAD_SIZE; return buffer_->Resize(raw_size() + EXTRA_BUFFER_PAD_SIZE); } return MaceStatus::MACE_SUCCESS; diff --git a/mace/core/workspace.cc b/mace/core/workspace.cc index 1f653a458ecdf98abb9dc6441439dbda6b855a23..73c2f8ea7b6479613ece12055e31aab882080bb7 100644 --- a/mace/core/workspace.cc +++ b/mace/core/workspace.cc @@ -177,7 +177,7 @@ MaceStatus Workspace::CreateOutputTensorBuffer(const NetDef &net_def, std::unique_ptr tensor_buf( new Buffer(GetDeviceAllocator(device_type))); MaceStatus status = tensor_buf->Allocate( - mem_block.x() * GetEnumTypeSize(dtype)); + mem_block.x() * GetEnumTypeSize(dtype) + EXTRA_BUFFER_PAD_SIZE); if (status != MaceStatus::MACE_SUCCESS) { return status; }