Skip to content

Combining LinearAlgebra.Diagonal with a CuArray inside @tensor #164

@OliverDudgeon

Description

@OliverDudgeon

When using normal arrays, I can use the Diagonal lazy matrix constructor and @tensor works normally.

A = Diagonal(rand(4))
B = rand(4,4)

# this works
@tensor out[a,c] := B[a,b] * A[b,c]

However, when using CuArrays the macro fails despite * working for these types.

Ag = CuArray(A)
Bg = CuArray(B)

Bg * Ag # this works
# but this doesn't
@tensor out[a,c] := Bg[a,b] * Ag[b,c]

We get an error message from Strided MethodError: no method matching StridedViews.StridedView(::LinearAlgebra.Diagonal{Float64, CUDA.CuArray{Float64, 1, CUDA.Mem.DeviceBuffer}}).

Is there any way to get this working?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions