File tree Expand file tree Collapse file tree 5 files changed +15
-11
lines changed
src/GraphBLAS-sharp.Backend
tests/GraphBLAS-sharp.Tests Expand file tree Collapse file tree 5 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -613,9 +613,6 @@ module ClArray =
613613 sourceArrays
614614 |> Seq.sumBy ( fun array -> array.Length)
615615
616- if resultLength >= clContext.MaxMemAllocSize then
617- failwith " It is impossible to allocate more than MaxAllocSize"
618-
619616 let result =
620617 clContext.CreateClArrayWithSpecificAllocationMode( allocationMode, resultLength)
621618
Original file line number Diff line number Diff line change @@ -419,5 +419,14 @@ module Matrix =
419419 fun ( processor : MailboxProcessor < _ >) allocationMode ( leftMatrix : ClMatrix < 'a >) ( rightMatrix : ClMatrix < 'b >) ->
420420 match leftMatrix, rightMatrix with
421421 | ClMatrix.CSR leftMatrix, ClMatrix.CSR rightMatrix ->
422- run processor allocationMode ( clContext.MaxMemAllocSize / 10 ) leftMatrix rightMatrix
422+ let allocCapacity =
423+ List.max [ sizeof< 'a>
424+ sizeof< 'c>
425+ sizeof< 'b> ]
426+ * 1 < Byte>
427+
428+ let resultCapacity =
429+ ( clContext.MaxMemAllocSize / allocCapacity) / 3
430+
431+ run processor allocationMode resultCapacity leftMatrix rightMatrix
423432 | _ -> failwith " Matrix formats are not matching"
Original file line number Diff line number Diff line change @@ -109,10 +109,7 @@ module Expand =
109109
110110 let rightMatrixGather = Gather.run clContext workGroupSize
111111
112- fun ( processor : MailboxProcessor < _ >) lengths ( segmentsPointers : ClArray < int >) ( leftMatrix : ClMatrix.COO < 'a >) ( rightMatrix : ClMatrix.CSR < 'b >) ->
113-
114- assert ( lengths < clContext.MaxMemAllocSize)
115-
112+ fun ( processor : MailboxProcessor < _ >) ( lengths : int ) ( segmentsPointers : ClArray < int >) ( leftMatrix : ClMatrix.COO < 'a >) ( rightMatrix : ClMatrix.CSR < 'b >) ->
116113 // Compute left matrix positions
117114 let leftMatrixPositions = zeroCreate processor DeviceOnly lengths
118115
Original file line number Diff line number Diff line change @@ -48,3 +48,4 @@ module ClContext =
4848 Cl
4949 .GetDeviceInfo( this.ClDevice.Device, OpenCL.Net.DeviceInfo.MaxMemAllocSize, error)
5050 .CastTo< int>()
51+ * 1 < Byte>
Original file line number Diff line number Diff line change 2929 <Compile Include =" Backend/Common/ClArray/Pairwise.fs" />
3030 <Compile Include =" Backend/Common/ClArray/RemoveDuplicates.fs" />
3131 <Compile Include =" Backend/Common/ClArray/Replicate.fs" />
32- <Compile Include =" Backend\ Common\ ClArray\ UpperBound.fs" />
32+ <Compile Include =" Backend/ Common/ ClArray/ UpperBound.fs" />
3333 <Compile Include =" Backend/Common/Gather.fs" />
3434 <Compile Include =" Backend/Common/Reduce/Reduce.fs" />
3535 <Compile Include =" Backend/Common/Reduce/ReduceByKey.fs" />
4949 <Compile Include =" Backend/Matrix/SpGeMM/Masked.fs" />
5050 <Compile Include =" Backend/Matrix/Transpose.fs" />
5151 <Compile Include =" Backend/Matrix/Merge.fs" />
52- <Compile Include =" Backend\ Matrix\ ExpandRows.fs" />
53- <Compile Include =" Backend\ Matrix\ SubRows.fs" />
52+ <Compile Include =" Backend/ Matrix/ ExpandRows.fs" />
53+ <Compile Include =" Backend/ Matrix/ SubRows.fs" />
5454 <Compile Include =" Backend/Vector/AssignByMask.fs" />
5555 <Compile Include =" Backend/Vector/Convert.fs" />
5656 <Compile Include =" Backend/Vector/Copy.fs" />
You can’t perform that action at this time.
0 commit comments