Revision 94ad5427ad1ecd9480e41418ccfff21169486524 authored by Steven Johnson on 13 March 2023, 18:16:04 UTC, committed by Steven Johnson on 13 March 2023, 18:16:04 UTC
- printer.h uses `uint64_t`, so it needs to include something that ensures that type is defined. `HalideRuntime.h` is probably the right choice (since it always transitively includes `runtime_internal.h` when compiling runtime.

- HalideBuffer.h should completely elide itself when `COMPILING_HALIDE_RUNTIME` is defined, for a subtle reason: some compilation environments require that all .h files can be compiled 'standalone' -- ie, they include all prerequisites and can be included in any order. As it turns out, HalideBuffer.h has a previously unnoticed glitch that is now being caught by this:
    - It includes both `<cstring>` and `HalideRuntime.h`
    - but when `COMPILING_HALIDE_RUNTIME` is defined, `HalideRuntime.h` includes `runtime_internal.h`, which assumes that no std headers are included
    - as it happens, `runtime_internal.h` defines `strstr()` and `strchr()` in a way that doesn't match the std headers (they both return non-const `char *`, perversely enough) and we get a compile error for mismatched function prototypes

I think the neatest solution here is to just skip the entire contents of `HalideBuffer.h` in this situation, since none of its contents should ever be used inside the Halide runtime. (I could work around this situation on the google side by loosening the 'must be able to compile on its own' requirement in this case, but IMHO it's a good check and one that is worthy of keeping.)

The fact that our function prototypes are a mismatch for the 'correct' ones could be debated; IMHO our 'wrong' definitions are safer that the std and should be kept.
1 parent 78097a7
History
File Mode Size
CMakeLists.txt -rw-r--r-- 22.2 KB
abstractgeneratortest_aottest.cpp -rw-r--r-- 1.2 KB
abstractgeneratortest_generator.cpp -rw-r--r-- 4.4 KB
acquire_release_aottest.cpp -rw-r--r-- 4.6 KB
acquire_release_generator.cpp -rw-r--r-- 663 bytes
alias_aottest.cpp -rw-r--r-- 1.3 KB
alias_generator.cpp -rw-r--r-- 1.3 KB
argvcall_aottest.cpp -rw-r--r-- 1.4 KB
argvcall_generator.cpp -rw-r--r-- 560 bytes
async_parallel_aottest.cpp -rw-r--r-- 3.6 KB
async_parallel_generator.cpp -rw-r--r-- 3.1 KB
autograd_aottest.cpp -rw-r--r-- 5.7 KB
autograd_generator.cpp -rw-r--r-- 1.2 KB
bit_operations_aottest.cpp -rw-r--r-- 1.3 KB
bit_operations_generator.cpp -rw-r--r-- 950 bytes
blur2x2_aottest.cpp -rw-r--r-- 1.6 KB
blur2x2_generator.cpp -rw-r--r-- 2.2 KB
buffer_copy_aottest.cpp -rw-r--r-- 3.9 KB
buffer_copy_generator.cpp -rw-r--r-- 2.3 KB
can_use_target_aottest.cpp -rw-r--r-- 3.0 KB
can_use_target_generator.cpp -rw-r--r-- 481 bytes
cleanup_on_error_aottest.cpp -rw-r--r-- 2.9 KB
cleanup_on_error_generator.cpp -rw-r--r-- 991 bytes
configure_aottest.cpp -rw-r--r-- 2.1 KB
configure_generator.cpp -rw-r--r-- 3.8 KB
configure_jittest.cpp -rw-r--r-- 7.0 KB
cxx_mangling_aottest.cpp -rw-r--r-- 2.7 KB
cxx_mangling_define_extern_aottest.cpp -rw-r--r-- 1.3 KB
cxx_mangling_define_extern_externs.cpp -rw-r--r-- 2.5 KB
cxx_mangling_define_extern_generator.cpp -rw-r--r-- 2.2 KB
cxx_mangling_externs.cpp -rw-r--r-- 284 bytes
cxx_mangling_generator.cpp -rw-r--r-- 4.1 KB
define_extern_opencl_aottest.cpp -rw-r--r-- 6.5 KB
define_extern_opencl_generator.cpp -rw-r--r-- 1.1 KB
embed_image_aottest.cpp -rw-r--r-- 1.0 KB
embed_image_generator.cpp -rw-r--r-- 730 bytes
error_codes_aottest.cpp -rw-r--r-- 4.1 KB
error_codes_generator.cpp -rw-r--r-- 581 bytes
example_aottest.cpp -rw-r--r-- 1.2 KB
example_generator.cpp -rw-r--r-- 4.3 KB
example_jittest.cpp -rw-r--r-- 3.5 KB
extern_output_aottest.cpp -rw-r--r-- 1.7 KB
extern_output_generator.cpp -rw-r--r-- 794 bytes
float16_t_aottest.cpp -rw-r--r-- 3.9 KB
float16_t_generator.cpp -rw-r--r-- 380 bytes
gpu_multi_context_threaded_aottest.cpp -rw-r--r-- 6.4 KB
gpu_multi_context_threaded_generator.cpp -rw-r--r-- 1.2 KB
gpu_object_lifetime_aottest.cpp -rw-r--r-- 7.7 KB
gpu_object_lifetime_generator.cpp -rw-r--r-- 475 bytes
gpu_only_aottest.cpp -rw-r--r-- 2.4 KB
gpu_only_generator.cpp -rw-r--r-- 600 bytes
gpu_texture_aottest.cpp -rw-r--r-- 1.9 KB
gpu_texture_generator.cpp -rw-r--r-- 784 bytes
image_from_array_aottest.cpp -rw-r--r-- 3.8 KB
image_from_array_generator.cpp -rw-r--r-- 366 bytes
mandelbrot_aottest.cpp -rw-r--r-- 918 bytes
mandelbrot_generator.cpp -rw-r--r-- 2.3 KB
memory_profiler_mandelbrot_aottest.cpp -rw-r--r-- 3.3 KB
memory_profiler_mandelbrot_generator.cpp -rw-r--r-- 2.2 KB
metadata_tester_aottest.cpp -rw-r--r-- 55.5 KB
metadata_tester_generator.cpp -rw-r--r-- 9.1 KB
msan_aottest.cpp -rw-r--r-- 21.0 KB
msan_generator.cpp -rw-r--r-- 1.3 KB
multitarget_aottest.cpp -rw-r--r-- 3.3 KB
multitarget_generator.cpp -rw-r--r-- 715 bytes
nested_externs_aottest.cpp -rw-r--r-- 730 bytes
nested_externs_generator.cpp -rw-r--r-- 3.8 KB
opencl_runtime_aottest.cpp -rw-r--r-- 1.1 KB
opencl_runtime_generator.cpp -rw-r--r-- 627 bytes
output_assign_aottest.cpp -rw-r--r-- 1.0 KB
output_assign_generator.cpp -rw-r--r-- 657 bytes
pyramid_aottest.cpp -rw-r--r-- 2.1 KB
pyramid_generator.cpp -rw-r--r-- 1.9 KB
rdom_input_aottest.cpp -rw-r--r-- 670 bytes
rdom_input_generator.cpp -rw-r--r-- 740 bytes
registration_test.cpp -rw-r--r-- 2.8 KB
rungen_test.cpp -rw-r--r-- 2.1 KB
sanitizercoverage_aottest.cpp -rw-r--r-- 3.5 KB
sanitizercoverage_generator.cpp -rw-r--r-- 616 bytes
shuffler_aottest.cpp -rw-r--r-- 1.2 KB
shuffler_generator.cpp -rw-r--r-- 571 bytes
string_param_aottest.cpp -rw-r--r-- 574 bytes
string_param_generator.cpp -rw-r--r-- 1.7 KB
stubtest_aottest.cpp -rw-r--r-- 4.1 KB
stubtest_generator.cpp -rw-r--r-- 5.0 KB
stubtest_jittest.cpp -rw-r--r-- 12.9 KB
stubuser_aottest.cpp -rw-r--r-- 3.1 KB
stubuser_generator.cpp -rw-r--r-- 4.6 KB
templated_aottest.cpp -rw-r--r-- 663 bytes
templated_generator.cpp -rw-r--r-- 1.6 KB
tiled_blur_aottest.cpp -rw-r--r-- 2.9 KB
tiled_blur_generator.cpp -rw-r--r-- 2.5 KB
user_context_aottest.cpp -rw-r--r-- 2.6 KB
user_context_generator.cpp -rw-r--r-- 675 bytes
user_context_insanity_aottest.cpp -rw-r--r-- 1.5 KB
user_context_insanity_generator.cpp -rw-r--r-- 518 bytes
variable_num_threads_aottest.cpp -rw-r--r-- 1.2 KB
variable_num_threads_generator.cpp -rw-r--r-- 431 bytes

back to top