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
julia> view(CuArray([1]), CuArray([1])) 1-element view(::CuArray{Int64,1}, [1]) with eltype Int64: 1 julia> parentindices(ans) ([1],) julia> typeof(ans) Tuple{CuArray{Int64,1}}
The indices needs an adapt as well:
Adapt.adapt_structure(to, A::SubArray{<:Any,<:Any,AT}) where {AT} = SubArray(adapt(to, parent(A)), adapt.(Ref(to), parentindices(A)))
Reported by @ali-ramadhan
The text was updated successfully, but these errors were encountered:
This is actually a little more complex, because the view constructor does bounds checking:
view
julia> view(CuArray([1]), CuArray([1])) ERROR: scalar getindex is disallowed
Sorry, something went wrong.
This is an old issue, so I'm not exactly sure what the problem was, but we adapt the SubArray indices now:
julia> Adapt.adapt(CuArray, view([1], [1])) 1-element view(::CuArray{Int64, 1, CUDA.DeviceMemory}, [1]) with eltype Int64: 1 julia> typeof(ans) SubArray{Int64, 1, CuArray{Int64, 1, CUDA.DeviceMemory}, Tuple{CuArray{Int64, 1, CUDA.DeviceMemory}}, false}
No branches or pull requests
The indices needs an adapt as well:
Reported by @ali-ramadhan
The text was updated successfully, but these errors were encountered: