Code Builder seems to have inconsistent behavior when compiling a kernel that uses intel_xxx() extensions or an intel_xxx kernel attribute and targets a GPU (HD 530 / Skylake).
The kernel will not compile unless I add the switch "-cl-fast-relaxed-math" or a couple other options. Not every option results in a successful compile.
The issue appears to be that the SPIR-V backend doesn't support the Intel extensions/attributes (which makes sense).
So why is Code Builder even bothering to generate SPIR-V when there is no support for _loading_ SPIR-V IL in Skylake and Intel extensions were detected?
Failed to generate SPIR-V output file: foo.cl:9:32: warning: expected 'enable' or 'disable' - ignoring foo.cl:267:16: warning: unknown attribute 'intel_reqd_sub_group_size' ignored foo.cl:465:71: error: implicit declaration of function 'intel_sub_group_shuffle' is invalid in OpenCL
You are right. SPIR and SPIR-V cover standard OpenCL, not the Intel-specific extensions. It is a great suggestion to add clearer exit conditions.
Is there any chance you could send a reproducer for the inconsistent behavior? We may want to look at this from a specific as well as a general perspective.
I don't have a reproducer handy but all you need to do is launch a kernel that loads a word per work item and shuffles it with something like intel_sub_group_shuffle_xor(<data>,7) and store it back out. Also annotate the kernel with the "intel_reqd_sub_group_size" attribute.
That should trigger both of warnings/errors that I listed.