You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Calling a launch=false kernel with host arrays fails #398
CUDACore documents that a kernel returned by @cuda launch=false "should be launched by calling it and passing arguments again. That later call converts the supplied host arguments independently", and CUDA.jl's own kernels do. A cuTile kernel doesn't convert them:
using CUDA, cuTile
import cuTile as ct
functioncopy_tiles(dst, src)
i = ct.bid(1)
ct.store(dst, i, ct.load(src, i, (256,)))
returnend
a = CUDA.rand(Float32, 1024); b = CUDA.zeros(Float32, 1024)
k =@cuda backend=cuTile launch=falsecopy_tiles(b, a)
k(b, a; blocks=4)
# ERROR: ArgumentError: type does not have a definite number of fields
(::TileKernel)(args...) takes its arguments as already converted (k(ct.cuTileconvert(b), ct.cuTileconvert(a); blocks=4) works), and flattening a CuArray as a kernel parameter fails with the error above.
A fix should convert host arguments as @cuda does, including recording their memory so that the launch is ordered on its stream (#396), while kernel_launch(kernel, call) keeps reusing a KernelCall's converted arguments. A related gap: arrays captured by the kernel function are converted when the launch=false kernel is made, so a later call neither acquires their memory on its stream nor keeps them alive.
Found on main (c40493e), Julia 1.13.4, CUDACore 6.5.1.
Activity