Skip to content

Commit

Permalink
Update CUDA.jl to support SA bounds checking
Browse files Browse the repository at this point in the history
We need this
  JuliaGPU/CUDA.jl@5da4d1d#comments
to have our kernels run.
  • Loading branch information
lcw committed May 29, 2024
1 parent e49f187 commit 0b9f93b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RavenWriteVTKExt = "WriteVTK"

[compat]
Adapt = "3, 4"
CUDA = "4, 5"
CUDA = "5.3"
Compat = "3.42, 4"
GPUArraysCore = "0.1"
KernelAbstractions = "0.9"
Expand Down
9 changes: 1 addition & 8 deletions ext/RavenCUDAExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Raven.arraytype(::Type{T}) where {T<:CuDeviceArray} = CuArray

function Raven.pin(::Type{T}, A::Array) where {T<:CuArray}
if length(A) > 0
A = CUDA.Mem.pin(A)
A = CUDA.pin(A)
end

return A
Expand Down Expand Up @@ -59,11 +59,4 @@ else
Adapt.adapt_storage(::CUDA.KernelAdaptor, ::MPI.Comm) = nothing
end

CUDA.@device_override function Base.checkbounds(A::StaticArrays.MArray, I...)
@inline
checkbounds(Bool, A, I...) ||
CUDA.@print_and_throw("BoundsError while indexing an MArray.")
nothing
end

end # module RavenCUDAExt

0 comments on commit 0b9f93b

Please sign in to comment.