GPUArrays.jl icon indicating copy to clipboard operation
GPUArrays.jl copied to clipboard

Vectorized getindex ignores `@inbounds`

Open pxl-th opened this issue 1 year ago • 0 comments

Thus performing device-to-host copy during boundscheck.

julia> x = AMDGPU.rand(Float32, 16);

julia> x[[1, 2, 3, 4]];
[D to H] ROCArray{Bool, 1, AMDGPU.Runtime.Mem.HIPBuffer}: (1,) -> Vector{Bool}: (1,)

julia> @inbounds x[[1, 2, 3, 4]];
[D to H] ROCArray{Bool, 1, AMDGPU.Runtime.Mem.HIPBuffer}: (1,) -> Vector{Bool}: (1,)

pxl-th avatar Jun 23 '24 20:06 pxl-th