How to get the device name and the number of Compute units when using oneAPI.jl or AMDGPU.jl?

I am working on making a GPU vendor agnostic code with KerneAbstractions.jl. I am getting the device name with
device = CUDA.device()
and getting the number of Streaming Multiprocessors with
sm_count = CUDA.attribute(device, CUDA.DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT).

I was able to find it’s equivalent for AMD GPUs with
device = AMDGPU.device()
This works.

compute_units = AMDGPU.compute_units(device)
This one does not work, what is the right command?

How do I do the same with Intel using oneAPI.jl?

1 Like

I am also looking for the functions to find out maximum possible number for configuration arguments like the number of items (threads) and groups (blocks) in oneAPI.jl.

Devices and drivers name can be obtained by:

julia> using oneAPI

julia> drivers()
ZeDriver iterator for 1 drivers:
1. ZeDriver(00000000-0000-0000-188b-ddfc01038caf): version 1.3.36015

julia> devices()
ZeDevice iterator for 1 devices:
1. Intel(R) Graphics

julia> device!(1) # Select the first available device
ZeDevice(GPU, vendor 0x8086, device 0x7d45): Intel(R) Graphics