After a successful OpenCL test on my AMD iGPU, I want to see if the same method can be used to target Snapdragon Adreno GPUs. Unfortunately, I don’t have access to one of these devices.
Can someone on Windows ARM help me and @ChetanVardhan run a few julia commands to test this?
It might work without installing it, but I didn’t try that on my machine.
Try cl.devices(cl.platforms()[2]) and then pick the GPU from the devices shown. Not the CPU fallback. It should say Adreno or something related. Then run the example:
cl.device!(cl.devices(cl.platforms()[2])[1]) # change this to pick the GPU!
const source = """
__kernel void vadd(__global const float *a,
__global const float *b,
__global float *c) {
int i = get_global_id(0);
c[i] = a[i] + b[i];
}"""
dims = (2,)
a = round.(rand(Float32, dims) * 100)
b = round.(rand(Float32, dims) * 100)
c = similar(a)
d_a = CLArray(a)
d_b = CLArray(b)
d_c = CLArray(c)
prog = cl.Program(; source) |> cl.build!
kern = cl.Kernel(prog, "vadd")
len = prod(dims)
clcall(kern, Tuple{CLPtr{Float32}, CLPtr{Float32}, CLPtr{Float32}},
d_a, d_b, d_c; global_size=(len,))
c = Array(d_c)
a + b ≈ c
Also try the same with the official Qualcomm drivers cl.devices(cl.platforms()[1])[...]