Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

ReshapedArray causes scalar indexing #548

Closed
ChrisRackauckas opened this issue Dec 28, 2019 · 5 comments
Closed

ReshapedArray causes scalar indexing #548

ChrisRackauckas opened this issue Dec 28, 2019 · 5 comments
Labels

Comments

@ChrisRackauckas
Copy link
Member

using CuArrays
CuArrays.allowscalar(false)
dp = cu(ones(252)')
p  = cu(ones(252))
reshape(dp,size(p)) # Error
vec(dp) # Error
@maleadt
Copy link
Member

maleadt commented Dec 28, 2019

Dup of https://github.com/JuliaGPU/CuArrays.jl/issues/508. You're working with a ReshapedArray{Float32,1,LinearAlgebra.Adjoint{Float32,CuArray{Float32,1,Nothing}}.

@maleadt maleadt closed this as completed Dec 28, 2019
@ChrisRackauckas
Copy link
Member Author

Is there a way to concretize this? A copy or something as a workaround?

@maleadt
Copy link
Member

maleadt commented Dec 28, 2019

You can pass the Adjoint to the CuArray constructor to materialize it. Or add the necessary method to have it actually dispatch to what you want (or select the GPU BroadcastStyle).

@ChrisRackauckas
Copy link
Member Author

The issue here is that I don't know if it's a CuArray. Is this something that needs Adapt.jl?

@ChrisRackauckas
Copy link
Member Author

Dope, the easiest workaround for me was just dp' haha, take care.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants