We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using fortran style 1D indexing on the parent, with any required assertions done upstream, might be easiest for some kernels. E.g.:
function Base.copyto!( dest::IJFH{S, Nij}, bc::Union{IJFH{S, Nij, A}, Base.Broadcast.Broadcasted{IJFHStyle{Nij, A}}}, ) where {S, Nij, A <: CUDA.CuArray} nitems = length(parent(dest)) max_threads = 256 # can be higher if conditions permit nthreads = min(max_threads, nitems) nblocks = cld(nitems, nthreads) pdest, pbc = parent(dest), parent(bc) CUDA.@cuda threads = (nthreads) blocks = (nblocks) knl_copyto!(pdest, pbc) return dest end function knl_copyto!(dest, src) nitems = length(dest) gidx = threadIdx().x + (blockIdx().x - 1) * blockDim().x if gidx < nitems @inbounds dest[gidx] = p_src[gidx] end return nothing end
Originally posted by @sriharshakandala in #767 (comment)
The text was updated successfully, but these errors were encountered:
We can try
cartidx = CartesianIndices(dest)[gidx]
Sorry, something went wrong.
sriharshakandala
Successfully merging a pull request may close this issue.
Using fortran style 1D indexing on the parent, with any required assertions done upstream, might be easiest for some kernels. E.g.:
Originally posted by @sriharshakandala in #767 (comment)
The text was updated successfully, but these errors were encountered: