1 #include "HalideRuntime.h" 2 3 extern "C" void halide_default_print(void *, const char *); 4 5 namespace Halide { 6 namespace Runtime { 7 namespace Internal { 8 9 WEAK halide_print_t custom_print = halide_default_print; 10 11 } 12 } // namespace Runtime 13 } // namespace Halide 14 15 extern "C" { 16 halide_print(void * user_context,const char * msg)17WEAK void halide_print(void *user_context, const char *msg) { 18 (*custom_print)(user_context, msg); 19 } 20 halide_set_custom_print(halide_print_t print)21WEAK halide_print_t halide_set_custom_print(halide_print_t print) { 22 halide_print_t result = custom_print; 23 custom_print = print; 24 return result; 25 } 26 } 27