Last active
November 13, 2021 20:50
-
-
Save 4OH4/73238d0f1e89cfb8d6a0a860c034d5da to your computer and use it in GitHub Desktop.
Executing a CUDA function with PyCUDA (pt. 3)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run multiply function on GPU | |
multiply_func( | |
result_gpu, a_gpu, b_gpu, | |
block=(100, 1, 1), | |
grid=(1, 1, 1) | |
) | |
# Get data back from GPU | |
cuda.memcpy_dtoh(result, result_gpu) | |
assert np.allclose(result, np.multiply(a,b)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment