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
figures
images
.clang-format -rw-r--r-- 50 bytes
.gitignore -rw-r--r-- 75 bytes
CMakeLists.txt -rw-r--r-- 9.4 KB
clock.h -rw-r--r-- 494 bytes
lesson_01_basics.cpp -rw-r--r-- 4.4 KB
lesson_02_input_image.cpp -rw-r--r-- 4.0 KB
lesson_03_debugging_1.cpp -rw-r--r-- 2.6 KB
lesson_04_debugging_2.cpp -rw-r--r-- 6.4 KB
lesson_05_scheduling_1.cpp -rw-r--r-- 23.1 KB
lesson_06_realizing_over_shifted_domains.cpp -rw-r--r-- 3.8 KB
lesson_07_multi_stage_pipelines.cpp -rw-r--r-- 6.9 KB
lesson_08_scheduling_2.cpp -rw-r--r-- 29.0 KB
lesson_09_update_definitions.cpp -rw-r--r-- 34.7 KB
lesson_10_aot_compilation_generate.cpp -rw-r--r-- 3.3 KB
lesson_10_aot_compilation_run.cpp -rw-r--r-- 2.7 KB
lesson_11_cross_compilation.cpp -rw-r--r-- 6.1 KB
lesson_12_using_the_gpu.cpp -rw-r--r-- 11.2 KB
lesson_13_tuples.cpp -rw-r--r-- 11.1 KB
lesson_14_types.cpp -rw-r--r-- 8.9 KB
lesson_15_generators.cpp -rw-r--r-- 6.7 KB
lesson_15_generators_usage.sh -rwxr-xr-x 8.1 KB
lesson_16_rgb_generate.cpp -rw-r--r-- 9.6 KB
lesson_16_rgb_run.cpp -rw-r--r-- 5.2 KB
lesson_17_predicated_rdom.cpp -rw-r--r-- 8.1 KB
lesson_18_parallel_associative_reductions.cpp -rw-r--r-- 13.1 KB
lesson_19_wrapper_funcs.cpp -rw-r--r-- 14.3 KB
lesson_20_cloning_funcs.cpp -rw-r--r-- 5.6 KB
lesson_21_auto_scheduler_generate.cpp -rw-r--r-- 10.7 KB
lesson_21_auto_scheduler_run.cpp -rw-r--r-- 2.0 KB
todo.txt -rw-r--r-- 1.1 KB

back to top