Intel® oneAPI Base Toolkit
Support for core tools and libraries to build and deploy high-performance data-centric applications
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
244 Discussions

Difference between SyCL host device and CPU

Tomasz_N_Intel
Employee
392 Views

What is the difference between SyCL host device and CPU in the device selection:

cl::sycl::info::device_type::cpu
cl::sycl::info::device_type::host


I'm getting difference performance (timing) results when running my workload depending on which device I have chosen. I thought the host device is in fact CPU and both should behave exactly the same.

Thanks and regards,
Tomasz

0 Kudos
1 Solution
GouthamK_Intel
Moderator
368 Views

Hi, Tomasz

Although host_selector and cpu_selector both select the CPU hardware there is a small difference between them.

When you are using cpu_selector then your code runs on CPU hardware with OpenCL as backend. So the CPU act as an OpenCL device here.

Whereas, when you are using host_selector then it bypasses the OnenCL backend and runs directly on CPU hardware. To run your codes using host_selector you don't need to have OpenCL drivers and it is always available, whereas to run your codes on any OpenCL devices (CPU, GPU, FPGA, any accelerator that supports OpenCL).

As the HOST device is independent and always available, The host device provides a guarantee that device code can always be run (no dependence on accelerator hardware) and has a few primary uses:

  • Development of Device code
  • Debugging of Device code
  • Backup

For more information on this please refer to the Data-Parallel C++ Book by James Reinders (Page 35)

You can download the free E-book here: https://link.springer.com/book/10.1007/978-1-4842-5574-2

Have a Good day!


Thanks & Regards

Goutham


View solution in original post

2 Replies
GouthamK_Intel
Moderator
369 Views

Hi, Tomasz

Although host_selector and cpu_selector both select the CPU hardware there is a small difference between them.

When you are using cpu_selector then your code runs on CPU hardware with OpenCL as backend. So the CPU act as an OpenCL device here.

Whereas, when you are using host_selector then it bypasses the OnenCL backend and runs directly on CPU hardware. To run your codes using host_selector you don't need to have OpenCL drivers and it is always available, whereas to run your codes on any OpenCL devices (CPU, GPU, FPGA, any accelerator that supports OpenCL).

As the HOST device is independent and always available, The host device provides a guarantee that device code can always be run (no dependence on accelerator hardware) and has a few primary uses:

  • Development of Device code
  • Debugging of Device code
  • Backup

For more information on this please refer to the Data-Parallel C++ Book by James Reinders (Page 35)

You can download the free E-book here: https://link.springer.com/book/10.1007/978-1-4842-5574-2

Have a Good day!


Thanks & Regards

Goutham


View solution in original post

GouthamK_Intel
Moderator
344 Views

Hi, Tomasz

Thanks for the confirmation!

As this issue has been resolved, we will no longer respond to this thread. 

If you require any additional assistance from Intel, please start a new thread. 

Any further interaction in this thread will be considered community only. 

Have a Good day.


Thanks & Regards

Goutham


Reply