File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 4949#include < CL/cl.h>
5050#endif // LITERT_HAS_OPENCL_SUPPORT
5151
52+ // TODO(b/449784615): Include xnnpack.h instead of duplicating the macros.
53+ #ifndef XNN_EXTRA_BYTES
54+ #if defined(__hexagon__)
55+ #define XNN_EXTRA_BYTES 128
56+ #else
57+ #define XNN_EXTRA_BYTES 16
58+ #endif // defined(__hexagon__)
59+ #endif // XNN_EXTRA_BYTES
60+
5261using litert::BufferTypeToString;
5362using litert::Expected;
5463using litert::Unexpected;
@@ -223,7 +232,8 @@ LiteRtTensorBufferT::CreateManagedOnHostMemory(
223232 const LiteRtRankedTensorType& tensor_type, size_t buffer_size,
224233 size_t alignment) {
225234 void * host_memory_ptr;
226- if (auto rc = posix_memalign (&host_memory_ptr, alignment, buffer_size);
235+ if (auto rc = posix_memalign (&host_memory_ptr, alignment,
236+ buffer_size + XNN_EXTRA_BYTES);
227237
228238 rc) {
229239 return Unexpected (kLiteRtStatusErrorRuntimeFailure ,
You can’t perform that action at this time.
0 commit comments