OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1718 Discussions

VS2015 Code Builder can't use Intel extensions because of SPIR-V?

allanmac1
Beginner
460 Views

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

 

0 Kudos
3 Replies
Jeffrey_M_Intel1
Employee
460 Views

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.

 

 

0 Kudos
allanmac1
Beginner
460 Views

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.

0 Kudos
Jeffrey_M_Intel1
Employee
460 Views

Just wanted to let you know that I've reproduced the inconsistent behavior with the subgroups extensions and -spirv32/64 with ioc64.

0 Kudos
Reply