Skip to content

Matrix-vector products with CuArrays and SparseArrays #139

@amontoison

Description

@amontoison
julia> A = cu(rand(3, 3))
3×3 CuArray{Float32,2,Nothing}:
 0.678375  0.0608932  0.571121
 0.639773  0.5497     0.642157
 0.432494  0.744255   0.839123

julia> b = cu(rand(3))
3-element CuArray{Float32,1,Nothing}:
 0.42534474 
 0.119808994
 0.5397634  

julia> op = LinearOperator(A)
Linear operator
  nrow: 3
  ncol: 3
  eltype: Float32
  symmetric: false
  hermitian: false
  nprod:   0
  ntprod:  0
  nctprod: 0

julia> op * b
ERROR: TypeError: in typeassert, expected Array{Float32,1}, got CuArray{Float32,1,Nothing}
Stacktrace:
 [1] *(::LinearOperator{Float32}, ::CuArray{Float32,1,Nothing}) at /home/montalex/.julia/packages/LinearOperators/WaECw/src/operations.jl:7
 [2] top-level scope at REPL[6]:1

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