Example #1
0
INLINE T get_mex_symbol(void *user_context, const char *name, bool required) {
    T s = (T)halide_get_symbol(name);
    if (required && s == NULL) {
        error(user_context) << "mex API not found: " << name << "\n";
        return NULL;
    }
    return s;
}
Example #2
0
int halide_hexagon_runtime_set_thread_priority(int priority) {
    if (priority < 0) {
        return 0;
    }

    // Find the halide_set_default_thread_priority function in the shared runtime,
    // which we loaded with RTLD_GLOBAL.
    void (*set_priority)(int) = (void (*)(int)) halide_get_symbol("halide_set_default_thread_priority");

    if (set_priority) {
        set_priority(priority);
    } else {
        // This code being run is old, doesn't have set priority feature, do nothing.
    }

    return 0;
}