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.
1663 Discussions

Questions about ioc64 and Intel compiler icc in regard of OpenCL

mike_p_4
Beginner
207 Views
Hi, It is known that, to get a GPU device associated with a platform, CL_DEVICE_TYPE_GPU is used in clGetDeviceIDs; So my first question is: Is it necessary when using ioc64, to specify as device gpu? And if yes, what is the difference in term of code generated between -device=cpu and -device=gpu? My second question is: Is there any particular reason why the Intel c compiler does not support OpenCL? Thanks
0 Kudos
4 Replies
Jeffrey_M_Intel1
Employee
207 Views

If ioc64 is used without specifying a device, the default is GPU.  The CPUs and GPUs have different instruction sets.  

Here is more info on Gen assembly: https://software.intel.com/en-us/articles/introduction-to-gen-assembly

And more about the underlying architecture: https://software.intel.com/en-us/file/the-compute-architecture-of-intel-processor-graphics-gen9-v1d...

While I'm not an expert on why the Intel compiler doesn't have more OpenCL integration, I agree that it is a very interesting idea.  For now though, the rich set of abstractions for memory management in OpenCL make it a great choice for taking advantage of Gen GPU hardware.  You can of course use both together: icc for host-side code, ioc64 for device-side.

 

mike_p_4
Beginner
207 Views

Hi,

Thanks for that. You said: "You can of course use both together: icc for host-side code, ioc64 for device-side."

How would that be possible if icc does not have an OpencCL switch?

 

Jeffrey_M_Intel1
Employee
207 Views

OpenCL does not need to be compiled from source at runtime.  You can also load several forms of pre-compiled kernels.  The kernel (pre)compiles would happen as a separate step.

https://software.intel.com/en-us/articles/using-spir-for-fun-and-profit-with-intel-opencl-code-build...

Developer guide: https://software.intel.com/en-us/node/539388

 

mike_p_4
Beginner
207 Views

Hi,

Thanks. My mistake, the Intel compiler does indeed have the -lOpenCL switch, is just not documented. Mystery solved.

 

Reply