https://github.com/halide/Halide
Raw File
Tip revision: d1deb58e5b5b3b3d2b91b11b99c08b900e35c20d authored by Andrew Adams on 13 February 2021, 23:06:27 UTC
Don't deinterleave all the way down to scalars
Tip revision: d1deb58
destructors.cpp
#include "HalideRuntime.h"
#include "printer.h"

extern "C" {

ALWAYS_INLINE __attribute__((used)) void call_destructor(void *user_context, void (*fn)(void *user_context, void *object), void **object, bool should_call) {
    void *o = *object;
    *object = nullptr;
    // Call the function
    if (o && should_call) {
        fn(user_context, o);
    }
}
}
back to top