pyccel / pyccel-cuda

Cuda extension to pyccel
MIT License
1 stars 0 forks source link

Add `synchronize` support in host code #45

Closed bauom closed 4 months ago

bauom commented 8 months ago

Describe the feature

Adding the ability to use synchronize from the host code. The call should similar to numba syntax: numba.cuda.synchronize() The generated code should call: cudaDeviceSynchronize

Test Code

from pyccel import cuda
from pyccel.decorators import kernel

@kernel
def kfunc():
   print("Hello from GPU")

if "__main__" == __name__:
   kfunc[1, 1]()
   cuda.synchronize()