Halide::Runtime::Buffer does not use halide_malloc and halide_free. #6171
Unanswered
mcourteaux
asked this question in
Q&A
Replies: 4 comments 7 replies
It's awkward, but you should be able to avoid this by calling the ctor with a NULL data ptr, then an explicit call to allocate(), eg |
1 reply
|
@alexreinking Why was this closed? I'm again running in this problem. Why does it not respect the custom allocator set in the Runtime? |
0 replies
|
Halide::Runtime::Buffer is used in contexts where there is no runtime linked. Specifically, it's what backs Halide::Buffer, which is what is used when using Halide as a JIT compiler. |
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Halide/src/runtime/HalideBuffer.h
Line 743 in a914574
The documentation of the class says that the default allocator functions are malloc and free, whereas the HalideRuntime.h specifies halide_malloc and halide_free for memory management.
Additionally, Halide::Runtime::Buffer does not allow for creating buffers with other allocators. You always go through an allocate() call using the default malloc/free, which is wasteful if you want to use a custom allocator afterwards.
All reactions