Skip to content
New issue

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

KernelAbstractions DynamicCheck checks always runs #2219

Open
rafaqz opened this issue Jan 4, 2024 · 0 comments
Open

KernelAbstractions DynamicCheck checks always runs #2219

rafaqz opened this issue Jan 4, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@rafaqz
Copy link

rafaqz commented Jan 4, 2024

Because the type is fixed to DynamicCheck here:

function KA.mkcontext(kernel::KA.Kernel{CUDABackend}, _ndrange, iterspace)
KA.CompilerMetadata{KA.ndrange(kernel), KA.DynamicCheck}(_ndrange, iterspace)
end

The dynamic bounds check here is always triggered:

CUDA.jl/src/CUDAKernels.jl

Lines 182 to 187 in 25fd692

if KA.__dynamic_checkbounds(ctx)
I = @inbounds KA.expand(KA.__iterspace(ctx), blockIdx().x, threadIdx().x)
return I in KA.__ndrange(ctx)
else
return true
end

even when it doesn't need to be (KernelAbstractions return NoDynamicCheck() from partition)

@rafaqz rafaqz added the bug Something isn't working label Jan 4, 2024
@rafaqz rafaqz changed the title KernelAbstraction DynamicCheck checks always run KernelAbstractions DynamicCheck checks always runs Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants