@@ -37,50 +37,50 @@ type CSRMatrix<'a when 'a : struct and 'a : equality>(csrTuples: CSRFormat<'a>)
3737 let rowCount = base .RowCount
3838 let columnCount = base .ColumnCount
3939
40- let spMV ( vector : DenseVector < 'a >) ( mask : Mask1D ) ( semiring : Semiring < 'a >) : OpenCLEvaluation < Vector < 'a >> =
41- let csrMatrixRowCount = rowCount
42- let csrMatrixColumnCount = columnCount
43- let vectorLength = vector.Size
44- if csrMatrixColumnCount <> vectorLength then
45- invalidArg
46- " vector"
47- ( sprintf " Argument has invalid dimension. Need %i , but given %i " csrMatrixColumnCount vectorLength)
48-
49- let ( BinaryOp plus ) = semiring.PlusMonoid.Append
50- let ( BinaryOp mult ) = semiring.Times
51-
52- let resultVector = Array.zeroCreate< 'a> csrMatrixRowCount
53- let command =
54- <@
55- fun ( ndRange : _1D )
56- ( resultBuffer : 'a [])
57- ( csrValuesBuffer : 'a [])
58- ( csrColumnsBuffer : int [])
59- ( csrRowPointersBuffer : int [])
60- ( vectorBuffer : 'a []) ->
61-
62- let i = ndRange.GlobalID0
63- let mutable localResultBuffer = resultBuffer.[ i]
64- for k in csrRowPointersBuffer.[ i] .. csrRowPointersBuffer.[ i + 1 ] - 1 do
65- localResultBuffer <- (% plus) localResultBuffer
66- ((% mult) csrValuesBuffer.[ k] vectorBuffer.[ csrColumnsBuffer.[ k]])
67- resultBuffer.[ i] <- localResultBuffer
68- @>
69-
70- let ndRange = _ 1D( csrMatrixRowCount)
71- let binder = fun kernelPrepare ->
72- kernelPrepare
73- ndRange
74- resultVector
75- csrTuples.Values
76- csrTuples.ColumnIndices
77- csrTuples.RowPointers
78- vector.Values
79-
80- opencl {
81- do ! RunCommand command binder
82- return upcast DenseVector( resultVector, semiring.PlusMonoid)
83- }
40+ // let spMV (vector: DenseVector<'a>) (mask: Mask1D) (semiring: Semiring<'a>) : OpenCLEvaluation<Vector<'a>> =
41+ // let csrMatrixRowCount = rowCount
42+ // let csrMatrixColumnCount = columnCount
43+ // let vectorLength = vector.Size
44+ // if csrMatrixColumnCount <> vectorLength then
45+ // invalidArg
46+ // "vector"
47+ // (sprintf "Argument has invalid dimension. Need %i, but given %i" csrMatrixColumnCount vectorLength)
48+
49+ // let (BinaryOp plus) = semiring.PlusMonoid.Append
50+ // let (BinaryOp mult) = semiring.Times
51+
52+ // let resultVector = Array.zeroCreate<'a> csrMatrixRowCount
53+ // let command =
54+ // <@
55+ // fun (ndRange: _1D)
56+ // (resultBuffer: 'a[])
57+ // (csrValuesBuffer: 'a[])
58+ // (csrColumnsBuffer: int[])
59+ // (csrRowPointersBuffer: int[])
60+ // (vectorBuffer: 'a[]) ->
61+
62+ // let i = ndRange.GlobalID0
63+ // let mutable localResultBuffer = resultBuffer.[i]
64+ // for k in csrRowPointersBuffer.[i] .. csrRowPointersBuffer.[i + 1] - 1 do
65+ // localResultBuffer <- (%plus) localResultBuffer
66+ // ((%mult) csrValuesBuffer.[k] vectorBuffer.[csrColumnsBuffer.[k]])
67+ // resultBuffer.[i] <- localResultBuffer
68+ // @>
69+
70+ // let ndRange = _1D(csrMatrixRowCount)
71+ // let binder = fun kernelPrepare ->
72+ // kernelPrepare
73+ // ndRange
74+ // resultVector
75+ // csrTuples.Values
76+ // csrTuples.ColumnIndices
77+ // csrTuples.RowPointers
78+ // vector.Values
79+
80+ // opencl {
81+ // do! RunCommand command binder
82+ // return upcast DenseVector(resultVector, semiring.PlusMonoid)
83+ // }
8484
8585 // Not Implemented
8686 new ( rows: int[], columns: int[], values: 'a[]) = CSRMatrix( CSRFormat.CreateEmpty())
@@ -648,32 +648,3 @@ and SparseVector<'a when 'a : struct and 'a : equality>(size: int, indices: int[
648648 override this.Apply a b = failwith " Not Implemented"
649649 override this.Prune a b = failwith " Not Implemented"
650650 override this.Reduce ( monoid : Monoid < 'a >) = failwith " Not Implemented"
651-
652- and DenseVector < 'a when 'a : struct and 'a : equality >( vector : 'a [], monoid : Monoid < 'a >) =
653- inherit Vector< 'a>( vector.Length)
654-
655- member this.Monoid = monoid
656- member this.Values : 'a [] = vector
657-
658- override this.Clear () = failwith " Not Implemented"
659- override this.Copy () = failwith " Not Implemented"
660- override this.Resize a = failwith " Not Implemented"
661- override this.GetNNZ () = failwith " Not Implemented"
662- override this.GetTuples () = failwith " Not Implemented"
663- override this.GetMask (? isComplemented : bool ) =
664- let isComplemented = defaultArg isComplemented false
665- failwith " Not Implemented"
666- override this.ToHost () = failwith " Not Implemented"
667-
668- override this.Extract ( mask : Mask1D option ) : OpenCLEvaluation < Vector < 'a >> = failwith " Not Implemented"
669- override this.Extract ( idx : int ) : OpenCLEvaluation < Scalar < 'a >> = failwith " Not Implemented"
670- override this.Assign ( mask : Mask1D option , vector : Vector < 'a >) : OpenCLEvaluation < unit > = failwith " Not Implemented"
671- override this.Assign ( idx : int , Scalar ( value : 'a )) : OpenCLEvaluation < unit > = failwith " Not Implemented"
672- override this.Assign ( mask : Mask1D option , Scalar ( value : 'a )) : OpenCLEvaluation < unit > = failwith " Not Implemented"
673-
674- override this.Vxm a b c = failwith " Not Implemented"
675- override this.EWiseAdd a b c = failwith " Not Implemented"
676- override this.EWiseMult a b c = failwith " Not Implemented"
677- override this.Apply a b = failwith " Not Implemented"
678- override this.Prune a b = failwith " Not Implemented"
679- override this.Reduce ( monoid : Monoid < 'a >) = failwith " Not Implemented"
0 commit comments