__opencl_c_integer_dot_product_input_4x8bit / __opencl_c_integer_dot_product_input_4x8bit_packed feature macros are always enabled, even on unsupported devices
isDotIntegerProductExtensionSupported() always returns true, which is incorrect. It leads to the __opencl_c_integer_dot_product_input_4x8bit / __opencl_c_integer_dot_product_input_4x8bit_packed feature macros always being present, even on unsupported devices.
This means: If any OpenCL application implements dp4a with checks for __opencl_c_integer_dot_product_input_4x8bit / __opencl_c_integer_dot_product_input_4x8bit_packed feature macros to see of dot()/dot_acc_sat() functions are available, the application will instantly be broken on all older unsupported Intel platforms - compiling will just fail because dot()/dot_acc_sat() functions will be exposed by false feature macros but are not actually supported by compiler.
This is especially important to fix on legacy driver too.
Please fix!
@ProjectPhysX
This is especially important to fix on legacy driver too.
For legacy platforms (pre-gen12) the function returns false: https://github.com/intel/compute-runtime/blob/releases/24.35/shared/source/helpers/compiler_product_helper_bdw_to_icllp.inl#L14
Hi @JablonskiMateusz,
I am observing that on Intel UHD 630 (i7-8700K) with driver 31.0.101.2134 (Windows), the __opencl_c_integer_dot_product_input_4x8bit and __opencl_c_integer_dot_product_input_4x8bit_packed feature macros are both present, despite lack of dp4a support. How is this possible?
Error message is error: undefined reference to '__builtin_spirv_OpDot_v4i8_v4i8' in function: '__builtin_spirv_OpDot_v4i8_v4i8' called by kernel: 'dp4a_kernel' error: backend compiler failed build.
Regards, Moritz
@ProjectPhysX could you please share output from clinfo?
@pwilma https://opencl.gpuinfo.org/displayreport.php?id=4591
@ProjectPhysX where do you see the __opencl_c_integer_dot_product_input_4x8bit / __opencl_c_integer_dot_product_input_4x8bit_packed extensions exposed?
clinfo reports all the OCL C extensions exposed by driver
@JablonskiMateusz in the OpenCL C code, put a
#if defined(__opencl_c_integer_dot_product_input_4x8bit)
...
#endif
and the code inside will be executed on UHD 630. The __opencl_c_integer_dot_product_input_4x8bit / __opencl_c_integer_dot_product_input_4x8bit_packed feature macros are present but should not be present.
As a reproducer:
- Clone
https://github.com/ProjectPhysX/OpenCL-Benchmark - Comment out my workaround for the Intel bug here.
- Run on UHD 630. This line will try to execute, and you will see the compiler error
error: undefined reference to '__builtin_spirv_OpDot_v4i8_v4i8' in function: '__builtin_spirv_OpDot_v4i8_v4i8' called by kernel: 'dp4a_kernel' error: backend compiler failed build..