File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
src/GraphBLAS-sharp.Backend Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -613,6 +613,9 @@ 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+
616619 let result =
617620 clContext.CreateClArrayWithSpecificAllocationMode( allocationMode, resultLength)
618621
Original file line number Diff line number Diff line change @@ -111,6 +111,8 @@ module Expand =
111111
112112 fun ( processor : MailboxProcessor < _ >) lengths ( segmentsPointers : ClArray < int >) ( leftMatrix : ClMatrix.COO < 'a >) ( rightMatrix : ClMatrix.CSR < 'b >) ->
113113
114+ assert ( lengths < clContext.MaxMemAllocSize)
115+
114116 // Compute left matrix positions
115117 let leftMatrixPositions = zeroCreate processor DeviceOnly lengths
116118
@@ -456,6 +458,7 @@ module Expand =
456458
457459 let rows = concat processor allocationMode rowsList
458460
461+ // TODO(overhead: compute result length 3 time)
459462 // release resources
460463 valuesList
461464 |> List.iter ( fun array -> array.Free processor)
You can’t perform that action at this time.
0 commit comments