diff --git a/src/Func.cpp b/src/Func.cpp index 1a5cdfd19aea..0e9aca64aa85 100644 --- a/src/Func.cpp +++ b/src/Func.cpp @@ -3309,33 +3309,6 @@ void set_handler(A &a, B b) { } } // namespace -// Deprecated setters for JIT handlers -void Func::set_error_handler(void (*handler)(void *, const char *)) { - set_handler(jit_handlers().custom_error, handler); -} - -void Func::set_custom_allocator(void *(*cust_malloc)(void *, size_t), - void (*cust_free)(void *, void *)) { - set_handler(jit_handlers().custom_malloc, cust_malloc); - set_handler(jit_handlers().custom_free, cust_free); -} - -void Func::set_custom_do_par_for(int (*cust_do_par_for)(void *, int (*)(void *, int, uint8_t *), int, int, uint8_t *)) { - set_handler(jit_handlers().custom_do_par_for, cust_do_par_for); -} - -void Func::set_custom_do_task(int (*cust_do_task)(void *, int (*)(void *, int, uint8_t *), int, uint8_t *)) { - set_handler(jit_handlers().custom_do_task, cust_do_task); -} - -void Func::set_custom_trace(int (*trace_fn)(void *, const halide_trace_event_t *)) { - set_handler(jit_handlers().custom_trace, trace_fn); -} - -void Func::set_custom_print(void (*cust_print)(void *, const char *)) { - set_handler(jit_handlers().custom_print, cust_print); -} - void Func::add_custom_lowering_pass(IRMutator *pass, std::function deleter) { pipeline().add_custom_lowering_pass(pass, std::move(deleter)); } diff --git a/src/Func.h b/src/Func.h index 589e18709586..a042472874ee 100644 --- a/src/Func.h +++ b/src/Func.h @@ -1053,29 +1053,6 @@ class Func { */ void compile_jit(const Target &target = get_jit_target_from_environment()); - /** Deprecated variants of the above that use a void pointer - * instead of a JITUserContext pointer. */ - // @{ - HALIDE_ATTRIBUTE_DEPRECATED("Custom handlers should by set by modifying the struct returned by jit_handlers()") - void set_error_handler(void (*handler)(void *, const char *)); - HALIDE_ATTRIBUTE_DEPRECATED("Custom handlers should by set by modifying the struct returned by jit_handlers()") - void set_custom_allocator(void *(*malloc)(void *, size_t), - void (*free)(void *, void *)); - HALIDE_ATTRIBUTE_DEPRECATED("Custom handlers should by set by modifying the struct returned by jit_handlers()") - void set_custom_do_task( - int (*custom_do_task)(void *, int (*)(void *, int, uint8_t *), - int, uint8_t *)); - HALIDE_ATTRIBUTE_DEPRECATED("Custom handlers should by set by modifying the struct returned by jit_handlers()") - void set_custom_do_par_for( - int (*custom_do_par_for)(void *, int (*)(void *, int, uint8_t *), int, - int, uint8_t *)); - HALIDE_ATTRIBUTE_DEPRECATED("Custom handlers should by set by modifying the struct returned by jit_handlers()") - void set_custom_trace(int (*trace_fn)(void *, const halide_trace_event_t *)); - - HALIDE_ATTRIBUTE_DEPRECATED("Custom handlers should by set by modifying the struct returned by jit_handlers()") - void set_custom_print(void (*handler)(void *, const char *)); - // @} - /** Get a struct containing the currently set custom functions * used by JIT. This can be mutated. Changes will take effect the * next time this Func is realized. */ diff --git a/src/Pipeline.cpp b/src/Pipeline.cpp index 1de83a09f989..733709e2a23d 100644 --- a/src/Pipeline.cpp +++ b/src/Pipeline.cpp @@ -640,43 +640,6 @@ void Pipeline::compile_jit(const Target &target_arg) { contents->jit_module = jit_module; } -template -void set_handler(A &a, B b) { - a = (A)b; -} - -void Pipeline::set_error_handler(void (*handler)(void *, const char *)) { - user_assert(defined()) << "Pipeline is undefined\n"; - set_handler(contents->jit_handlers.custom_error, handler); -} - -void Pipeline::set_custom_allocator(void *(*cust_malloc)(void *, size_t), - void (*cust_free)(void *, void *)) { - user_assert(defined()) << "Pipeline is undefined\n"; - set_handler(contents->jit_handlers.custom_malloc, cust_malloc); - set_handler(contents->jit_handlers.custom_free, cust_free); -} - -void Pipeline::set_custom_do_par_for(int (*cust_do_par_for)(void *, int (*)(void *, int, uint8_t *), int, int, uint8_t *)) { - user_assert(defined()) << "Pipeline is undefined\n"; - set_handler(contents->jit_handlers.custom_do_par_for, cust_do_par_for); -} - -void Pipeline::set_custom_do_task(int (*cust_do_task)(void *, int (*)(void *, int, uint8_t *), int, uint8_t *)) { - user_assert(defined()) << "Pipeline is undefined\n"; - set_handler(contents->jit_handlers.custom_do_task, cust_do_task); -} - -void Pipeline::set_custom_trace(int (*trace_fn)(void *, const halide_trace_event_t *)) { - user_assert(defined()) << "Pipeline is undefined\n"; - set_handler(contents->jit_handlers.custom_trace, trace_fn); -} - -void Pipeline::set_custom_print(void (*cust_print)(void *, const char *)) { - user_assert(defined()) << "Pipeline is undefined\n"; - set_handler(contents->jit_handlers.custom_print, cust_print); -} - void Pipeline::set_jit_externs(const std::map &externs) { user_assert(defined()) << "Pipeline is undefined\n"; contents->jit_externs = externs; diff --git a/src/Pipeline.h b/src/Pipeline.h index b5b45fd170ed..9ffdfeeed0ae 100644 --- a/src/Pipeline.h +++ b/src/Pipeline.h @@ -349,28 +349,6 @@ class Pipeline { */ void compile_jit(const Target &target = get_jit_target_from_environment()); - /** Deprecated variants of the above that use a void pointer - * instead of a JITUserContext pointer. */ - // @{ - HALIDE_ATTRIBUTE_DEPRECATED("Custom handlers should by set by modifying the struct returned by jit_handlers()") - void set_error_handler(void (*handler)(void *, const char *)); - HALIDE_ATTRIBUTE_DEPRECATED("Custom handlers should by set by modifying the struct returned by jit_handlers()") - void set_custom_allocator(void *(*malloc)(void *, size_t), - void (*free)(void *, void *)); - HALIDE_ATTRIBUTE_DEPRECATED("Custom handlers should by set by modifying the struct returned by jit_handlers()") - void set_custom_do_task( - int (*custom_do_task)(void *, int (*)(void *, int, uint8_t *), - int, uint8_t *)); - HALIDE_ATTRIBUTE_DEPRECATED("Custom handlers should by set by modifying the struct returned by jit_handlers()") - void set_custom_do_par_for( - int (*custom_do_par_for)(void *, int (*)(void *, int, uint8_t *), int, - int, uint8_t *)); - HALIDE_ATTRIBUTE_DEPRECATED("Custom handlers should by set by modifying the struct returned by jit_handlers()") - void set_custom_trace(int (*trace_fn)(void *, const halide_trace_event_t *)); - HALIDE_ATTRIBUTE_DEPRECATED("Custom handlers should by set by modifying the struct returned by jit_handlers()") - void set_custom_print(void (*handler)(void *, const char *)); - // @} - /** Install a set of external C functions or Funcs to satisfy * dependencies introduced by HalideExtern and define_extern * mechanisms. These will be used by calls to realize,