Welcome back to the oneAPI channel.​
We have talked about heterogeneous systems, with multiple devices​
How do I know which devices are connected to my system and what are their properties?
Getting the most out of a heterogenous and parallel system requires 2 main things​
The first is efficiency, which could be achieved by running the right piece of code on the
right piece of hardware..​
For example, we would like to run these 3 workloads on the GPU…​
And in general we want to run any piece of code that need acceleration on the appropriate
accelerator​
And the rest of the code on the CPU…​
I imaging this as Choosing the right lane for each type of car..​
But this is not enough..​
Getting most of the system also mean utilizing all the resources..​
So not only about driving the fast lane, but also about driving in ALL the lanes.​
And yes, sometimes, these 2 collide, and if I have a free lane, I might want to occupy
it even if it’s not the most efficient one..
Let me just show you an example,​
But we need the DPC++ compiler..​
(start video)​
Google the oneAPI base toolkit​
You can run it on the devcloud​
But I want to install it on my laptop​
Choose your operating system, Windows, and there are many download options..​
Download, install..
​
It does take a while, as it is a big package,​
But you are getting here not only the DPC++ compiler but many other libraries and tools​
Like oneTBB, IPP, vTune, intel advisor, oneMKL and more..​
And we are done,​
There are few additional steps to configure Microsoft Visual studio or other IDEs, and
you are there
I’ll run this simple code, ​
Using SYCL​
Going over all the platforms in my system​
I can get all the platforms using get_platforms
For each of these platforms I’ll print a separator,​
I’ll use, get-info and print out the platform name..​
​
Then, I’ll look for the all of the devices on this platform, using get-devices..​
And for each of the devices I’ll print out the name of the device​
Let’s run it..​
And this is my system, it will have platforms and devices attached to them​
The first one is an FPGA emulation platform, using OpenCL.​
I got this with the oneAPI Base toolkit installation..​
And the device is an FPGA emulator..​
The second platform is an OpenCL platform and it has an OpenCL backend to my CPU​
This is my i7 CPU​
The next platform is an OpenCL HD graphics and the device is my GPU​
And here is another platform, the device is the same GPU, I have only one in my laptop,
but the backend here is Level-Zero..​
So basically I have 2 drivers and 2 ways to approach my GPU, level zero or OpenCL in this
case..​
The last platform is a SYCL Host,​
It is a virtual platform that will be mapped by default to my CPU.
​
For each of them we got the platform name
And for each of the devices on that platform we got the name​
But I want to know more..​
So let’s print another property.​
If you open SYCL or DPC++ reference you can find all the properties you can get on a device
by get-info..​
Let’s for example look for the max-compute-units​
Let’s print it out..​
And my FPGA and CPU has 8, my GPU has 24 compute units, and my SYCL platform has 1..​
These capabilities give me a better insight into the system and the ability to choose
the device each section of the code will be execute on.​
Next video we’ll see how to choose a device and construct a queue for that device..
​See you there​