4 ms·
""" [...] it is possible to perform kernel-like operations without actually writing your own GPU kernels: a = CUDA.zeros(1024) b = CUDA.ones(1024) a.^2 .+ sin.(
by cdsousa 6y ago
"""
[...] it is possible to perform kernel-like operations without actually writing your own GPU kernels:
a = CUDA.zeros(1024)
b = CUDA.ones(1024)
a.^2 .+ sin.(b)
""" [https://juliagpu.gitlab.io/CUDA.jl/usage/overview/#The-CuArray-type https://juliagpu.gitlab.io/CUDA.jl/usage/overview/#The-CuArr...]
As far as I know, that example code creates an ad-hoc kernel that performs the computation in a single pass.
I honestly don't know if that is possible in other frameworks.
- ummonk 6y agoYeah, that's definitely available in Python frameworks. (I was wrong to mention Numba - I think CuPy would be a better example: https://docs.cupy.dev/en/stable/overview.html https://docs.cupy.dev/en/stable/overview.html)
- cdsousa 6y agoThat's right, I found it: https://docs.cupy.dev/en/stable/tutorial/kernel.html#kernel-fusion https://docs.cupy.dev/en/stable/tutorial/kernel.html#kernel-...