@@ -31,9 +31,9 @@ module CSRMatrix =
3131 let scan =
3232 ClArray.prefixSumIncludeInplace <@ max @> clContext workGroupSize
3333
34- fun ( processor : MailboxProcessor < _ >) flag ( rowPointers : ClArray < int >) nnz rowCount ->
34+ fun ( processor : MailboxProcessor < _ >) allocationMode ( rowPointers : ClArray < int >) nnz rowCount ->
3535
36- let rows = create processor flag nnz 0
36+ let rows = create processor allocationMode nnz 0
3737
3838 let kernel = program.GetKernel()
3939
@@ -57,12 +57,12 @@ module CSRMatrix =
5757
5858 let copyData = ClArray.copy clContext workGroupSize
5959
60- fun ( processor : MailboxProcessor < _ >) flag ( matrix : ClMatrix.CSR < 'a >) ->
60+ fun ( processor : MailboxProcessor < _ >) allocationMode ( matrix : ClMatrix.CSR < 'a >) ->
6161 let rows =
62- prepare processor flag matrix.RowPointers matrix.Columns.Length matrix.RowCount
62+ prepare processor allocationMode matrix.RowPointers matrix.Columns.Length matrix.RowCount
6363
64- let cols = copy processor flag matrix.Columns
65- let vals = copyData processor flag matrix.Values
64+ let cols = copy processor allocationMode matrix.Columns
65+ let vals = copyData processor allocationMode matrix.Values
6666
6767 { Context = clContext
6868 RowCount = matrix.RowCount
@@ -75,9 +75,9 @@ module CSRMatrix =
7575 let prepare =
7676 expandRowPointers clContext workGroupSize
7777
78- fun ( processor : MailboxProcessor < _ >) flag ( matrix : ClMatrix.CSR < 'a >) ->
78+ fun ( processor : MailboxProcessor < _ >) allocationMode ( matrix : ClMatrix.CSR < 'a >) ->
7979 let rows =
80- prepare processor flag matrix.RowPointers matrix.Columns.Length matrix.RowCount
80+ prepare processor allocationMode matrix.RowPointers matrix.Columns.Length matrix.RowCount
8181
8282 processor.Post( Msg.CreateFreeMsg( matrix.RowPointers))
8383
@@ -100,29 +100,29 @@ module CSRMatrix =
100100 let toCSRInplace =
101101 COOMatrix.toCSRInplace clContext workGroupSize
102102
103- fun ( processor : MailboxProcessor < _ >) flag ( m1 : ClMatrix.CSR < 'a >) ( m2 : ClMatrix.CSR < 'b >) ->
103+ fun ( processor : MailboxProcessor < _ >) allocationMode ( m1 : ClMatrix.CSR < 'a >) ( m2 : ClMatrix.CSR < 'b >) ->
104104 let m1COO =
105105 { Context = clContext
106106 RowCount = m1.RowCount
107107 ColumnCount = m1.ColumnCount
108- Rows = prepareRows processor flag m1.RowPointers m1.Values.Length m1.RowCount
108+ Rows = prepareRows processor allocationMode m1.RowPointers m1.Values.Length m1.RowCount
109109 Columns = m1.Columns
110110 Values = m1.Values }
111111
112112 let m2COO =
113113 { Context = clContext
114114 RowCount = m2.RowCount
115115 ColumnCount = m2.ColumnCount
116- Rows = prepareRows processor flag m2.RowPointers m2.Values.Length m2.RowCount
116+ Rows = prepareRows processor allocationMode m2.RowPointers m2.Values.Length m2.RowCount
117117 Columns = m2.Columns
118118 Values = m2.Values }
119119
120- let m3COO = eWiseCOO processor flag m1COO m2COO
120+ let m3COO = eWiseCOO processor allocationMode m1COO m2COO
121121
122122 processor.Post( Msg.CreateFreeMsg( m1COO.Rows))
123123 processor.Post( Msg.CreateFreeMsg( m2COO.Rows))
124124
125- toCSRInplace processor flag m3COO
125+ toCSRInplace processor allocationMode m3COO
126126
127127 ///<remarks >Old version</remarks >
128128 let elementwiseAtLeastOneWithCOO
@@ -143,10 +143,10 @@ module CSRMatrix =
143143 let toCSRInplace =
144144 COOMatrix.toCSRInplace clContext workGroupSize
145145
146- fun ( queue : MailboxProcessor < _ >) flag ( matrix : ClMatrix.CSR < 'a >) ->
147- toCOOInplace queue flag matrix
146+ fun ( queue : MailboxProcessor < _ >) allocationMode ( matrix : ClMatrix.CSR < 'a >) ->
147+ toCOOInplace queue allocationMode matrix
148148 |> transposeInplace queue
149- |> toCSRInplace queue flag
149+ |> toCSRInplace queue allocationMode
150150
151151 let transpose ( clContext : ClContext ) workGroupSize =
152152
@@ -158,10 +158,10 @@ module CSRMatrix =
158158 let toCSRInplace =
159159 COOMatrix.toCSRInplace clContext workGroupSize
160160
161- fun ( queue : MailboxProcessor < _ >) flag ( matrix : ClMatrix.CSR < 'a >) ->
162- toCOO queue flag matrix
161+ fun ( queue : MailboxProcessor < _ >) allocationMode ( matrix : ClMatrix.CSR < 'a >) ->
162+ toCOO queue allocationMode matrix
163163 |> transposeInplace queue
164- |> toCSRInplace queue flag
164+ |> toCSRInplace queue allocationMode
165165
166166 let elementwiseToCOO < 'a , 'b , 'c when 'a : struct and 'b : struct and 'c : struct and 'c : equality >
167167 ( clContext : ClContext )
@@ -177,7 +177,7 @@ module CSRMatrix =
177177 let setPositions =
178178 Matrix.Common.setPositions< 'c> clContext workGroupSize
179179
180- fun ( queue : MailboxProcessor < _ >) flag ( matrixLeft : ClMatrix.CSR < 'a >) ( matrixRight : ClMatrix.CSR < 'b >) ->
180+ fun ( queue : MailboxProcessor < _ >) allocationMode ( matrixLeft : ClMatrix.CSR < 'a >) ( matrixRight : ClMatrix.CSR < 'b >) ->
181181
182182 let allRows , allColumns , leftMergedValues , rightMergedValues , isRowEnd , isLeft =
183183 merge
@@ -196,7 +196,7 @@ module CSRMatrix =
196196 queue.Post( Msg.CreateFreeMsg<_>( rightMergedValues))
197197
198198 let resultRows , resultColumns , resultValues , _ =
199- setPositions queue flag allRows allColumns allValues positions
199+ setPositions queue allocationMode allRows allColumns allValues positions
200200
201201 queue.Post( Msg.CreateFreeMsg<_>( allRows))
202202 queue.Post( Msg.CreateFreeMsg<_>( isLeft))
@@ -224,9 +224,9 @@ module CSRMatrix =
224224 let toCSRInplace =
225225 COOMatrix.toCSRInplace clContext workGroupSize
226226
227- fun ( queue : MailboxProcessor < _ >) flag ( matrixLeft : ClMatrix.CSR < 'a >) ( matrixRight : ClMatrix.CSR < 'b >) ->
228- elementwiseToCOO queue flag matrixLeft matrixRight
229- |> toCSRInplace queue flag
227+ fun ( queue : MailboxProcessor < _ >) allocationMode ( matrixLeft : ClMatrix.CSR < 'a >) ( matrixRight : ClMatrix.CSR < 'b >) ->
228+ elementwiseToCOO queue allocationMode matrixLeft matrixRight
229+ |> toCSRInplace queue allocationMode
230230
231231 let elementwiseAtLeastOneToCOO < 'a , 'b , 'c when 'a : struct and 'b : struct and 'c : struct and 'c : equality >
232232 ( clContext : ClContext )
0 commit comments