-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
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
CUDA array scalar getindex error #25
Comments
It's pretty odd that this fails while the example of #10 (comment) does not. Both use
This seems the same on CuArrays v1.7.2, CuArrays v2.2.1, and CUDA v0.1.0. |
Here is one way to work around this, forcing the broadcast to be a CUDA one: trick = cu(fill(false))
@reduce D[m,a] := sum(p) C[p,a] + L[p,m] + trick |
Merged
I think this can be closed as fixed by #31, current behaviour is: julia> @reduce D[m,a] := sum(p) C[p,a] + L[p,m]
3×2 CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}:
20.0 20.0
20.0 20.0
20.0 20.0
julia> @pretty @reduce D[m,a] := sum(p) C[p,a] + L[p,m]
begin
@boundscheck ndims(C) == 2 || throw(ArgumentError("expected a 2-tensor C[p, a]"))
@boundscheck axes(C, 1) == axes(L, 1) || throw(DimensionMismatch("range of index p must agree"))
@boundscheck ndims(L) == 2 || throw(ArgumentError("expected a 2-tensor L[p, m]"))
local fox = transmute(C, Val((nothing, 2, 1)))
local tiger = transmute(L, Val((2, nothing, 1)))
D = dropdims(sum(@__dot__(fox + tiger), dims = 3), dims = 3)
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following:
gives a
scalar getindex is disallowed
error. But using@cast
as an intermediate step or re-ordering indices both work fine:or
both produce
Question was initially raised here: TensorCast & CUDA
The text was updated successfully, but these errors were encountered: