Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jipolanco authored and maleadt committed Dec 19, 2024
1 parent ef02e98 commit 1bb9247
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/core/cudadrv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,20 @@ if attribute(device(), CUDA.DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED) != 0
dA = CUDA.rand(UInt8, 512)
copyto!(dA, hA)
copyto!(hA, dA)

# memory copies with resized pinned memory (used to fail with CUDA_ERROR_INVALID_VALUE)
dA = rand(Float32, 100)
hA = Array(dA)
@test !CUDA.is_pinned(pointer(hA))
for n 100:2000
resize!(dA, n)
resize!(hA, n)
dA .= n
CUDA.pin(hA)
@test CUDA.is_pinned(pointer(hA))
copyto!(hA, dA)
copyto!(dA, hA)
end
end

end
Expand Down

0 comments on commit 1bb9247

Please sign in to comment.