-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
I'm trying to compile the program from tutorial 2, but with c++20, enabled I'm getting the following error:
clang++ -I ../Halide-13.0.1-x86-64-linux/include -L ../Halide-13.0.1-x86-64-linux/lib -lHalide -lpthread -I ../Halide-13.0.1-x86-64-linux/share/Halide/tools `libpng-config --cflags --ldflags` -ljpeg -lpthread -ldl -std=c++20 -Wall -Wextra -g -Wno-unused-parameter -Wno-type-limits -o lesson_02 lesson_02.cpp
In file included from lesson_02.cpp:2:
../Halide-13.0.1-x86-64-linux/include/Halide.h:8934:29: warning: missing field 'device_interface' initializer [-Wmissing-field-initializers]
halide_buffer_t buf = {0};
^
In file included from lesson_02.cpp:5:
../Halide-13.0.1-x86-64-linux/share/Halide/tools/halide_image_io.h:2234:32: error: use of overloaded operator '==' is ambiguous (with operand types 'Halide::Type' and 'const halide_type_t')
if (!check(im_d.type() == expected_type, "Image loaded did not match the expected type")) {
~~~~~~~~~~~ ^ ~~~~~~~~~~~~~
../Halide-13.0.1-x86-64-linux/share/Halide/tools/halide_image_io.h:2296:15: note: in instantiation of function template specialization 'Halide::Tools::load<Halide::Buffer<void>, &Halide::Tools::Internal::CheckFail>' requested here
(void)load<DynamicImageType, Internal::CheckFail>(filename, &im_d);
^
lesson_02.cpp:9:34: note: in instantiation of function template specialization 'Halide::Tools::load_image::operator Buffer<Halide::Buffer<unsigned char>>' requested here
Halide::Buffer<uint8_t> input = load_image("images/rgb.png");
^
../Halide-13.0.1-x86-64-linux/include/Halide.h:566:31: note: candidate function (with reversed parameter order)
HALIDE_ALWAYS_INLINE bool operator==(const halide_type_t &other) const {
^
../Halide-13.0.1-x86-64-linux/include/Halide.h:3639:10: note: candidate function
bool operator==(const Type &other) const {
^
../Halide-13.0.1-x86-64-linux/include/Halide.h:8934:29: warning: missing field 'device_interface' initializer [-Wmissing-field-initializers]
halide_buffer_t buf = {0};
^
../Halide-13.0.1-x86-64-linux/include/Halide.h:9638:5: note: in instantiation of default member initializer 'Halide::Runtime::Buffer<void, 4>::buf' requested here
Buffer(halide_type_t t, const std::vector<int> &sizes) {
^
../Halide-13.0.1-x86-64-linux/include/Halide.h:11346:18: note: in instantiation of member function 'Halide::Runtime::Buffer<void, 4>::Buffer' requested here
: Buffer(Runtime::Buffer<T>(t, sizes), name) {
^
../Halide-13.0.1-x86-64-linux/share/Halide/tools/halide_image_io.h:1078:11: note: in instantiation of member function 'Halide::Buffer<void>::Buffer' requested here
*im = ImageType(im_type, im_dimensions);
^
../Halide-13.0.1-x86-64-linux/share/Halide/tools/halide_image_io.h:1985:19: note: in instantiation of function template specialization 'Halide::Tools::Internal::load_jpg<Halide::Buffer<void>, &Halide::Tools::Internal::CheckFail>' requested here
{"jpeg", {load_jpg<ImageType, check>, save_jpg<ConstImageType, check>, query_jpg}},
^
../Halide-13.0.1-x86-64-linux/share/Halide/tools/halide_image_io.h:2222:20: note: in instantiation of function template specialization 'Halide::Tools::Internal::find_imageio<Halide::Buffer<void>, &Halide::Tools::Internal::CheckFail>' requested here
if (!Internal::find_imageio<DynamicImageType, check>(filename, &imageio)) {
^
../Halide-13.0.1-x86-64-linux/share/Halide/tools/halide_image_io.h:2296:15: note: in instantiation of function template specialization 'Halide::Tools::load<Halide::Buffer<void>, &Halide::Tools::Internal::CheckFail>' requested here
(void)load<DynamicImageType, Internal::CheckFail>(filename, &im_d);
^
lesson_02.cpp:9:34: note: in instantiation of function template specialization 'Halide::Tools::load_image::operator Buffer<Halide::Buffer<unsigned char>>' requested here
Halide::Buffer<uint8_t> input = load_image("images/rgb.png");
^
In file included from lesson_02.cpp:5:
../Halide-13.0.1-x86-64-linux/share/Halide/tools/halide_image_io.h:1286:23: error: use of overloaded operator '==' is ambiguous (with operand types 'Halide::Type' and 'const halide_type_t')
if (im.type() == table[i]) {
~~~~~~~~~ ^ ~~~~~~~~
../Halide-13.0.1-x86-64-linux/share/Halide/tools/halide_image_io.h:1993:46: note: in instantiation of function template specialization 'Halide::Tools::Internal::save_tmp<Halide::Buffer<const void>, &Halide::Tools::Internal::CheckFail>' requested here
{"tmp", {load_tmp<ImageType, check>, save_tmp<ConstImageType, check>, query_tmp}},
^
../Halide-13.0.1-x86-64-linux/share/Halide/tools/halide_image_io.h:2222:20: note: in instantiation of function template specialization 'Halide::Tools::Internal::find_imageio<Halide::Buffer<void>, &Halide::Tools::Internal::CheckFail>' requested here
if (!Internal::find_imageio<DynamicImageType, check>(filename, &imageio)) {
^
../Halide-13.0.1-x86-64-linux/share/Halide/tools/halide_image_io.h:2296:15: note: in instantiation of function template specialization 'Halide::Tools::load<Halide::Buffer<void>, &Halide::Tools::Internal::CheckFail>' requested here
(void)load<DynamicImageType, Internal::CheckFail>(filename, &im_d);
^
lesson_02.cpp:9:34: note: in instantiation of function template specialization 'Halide::Tools::load_image::operator Buffer<Halide::Buffer<unsigned char>>' requested here
Halide::Buffer<uint8_t> input = load_image("images/rgb.png");
^
../Halide-13.0.1-x86-64-linux/include/Halide.h:566:31: note: candidate function (with reversed parameter order)
HALIDE_ALWAYS_INLINE bool operator==(const halide_type_t &other) const {
^
../Halide-13.0.1-x86-64-linux/include/Halide.h:3639:10: note: candidate function
bool operator==(const Type &other) const {
^
2 warnings and 2 errors generated.
make: *** [Makefile:14: lesson_02] Error 1
Running with -std=c++17 i'm not seeing this error. I've tried both clang and gcc
Metadata
Metadata
Assignees
Labels
No labels