Hey everyone,
I just started to learn GPU Programming (and also rather new to Julia). I am currently trying to go through Cuda by Example but reproducing everything in Julia.
I would have 2 questions (everything is executed in a Jupyter Notebook):
- I have the following code to do a simple Hello World example.
using CUDAnative, CUDAdrv
function hello_world()
@cuprintf("Hello Woarld from the GPU\n")
return
end
If I run @cuda hello_world()
in a different cell, there will be no output until I use synchronize()
.
While, when I run @cuda hello_world()
inside the same cell, I do get an output, but if I change the string I need to run it twice to see the new string. Again, if I add synchronize()
this doesn’t happen (new string get printed first time I run the cell).
Not sure I understand what is happening here…
- I am trying to run a low-level C API function
cuDeviceGetProperties
. For this, I need a(prop, dev)
with type(Ptr{CUdevprop}, CUdevice)
. For the device, I know I can get it withCuDevice(0)
, but I have no idea for the prop…
I tried defining my own struct with similar field as in the book (which would likely not work since the field likely changed with new version of CUDA), and it fails.
Doing something similar to this :
using CUDAdrv
struct CUdevprop
(define fields here)
end
prop = Ref{CUdevprop}()
CUDAdrv.cuDeviceGetProperties(prop,CuDevice(0))
Any help would be greatly appreciated
Thanks