diff --git a/src/GraphBLAS-sharp.Backend/Objects/ClContextExtensions.fs b/src/GraphBLAS-sharp.Backend/Objects/ClContextExtensions.fs index 3a7dca2c..f525e3cd 100644 --- a/src/GraphBLAS-sharp.Backend/Objects/ClContextExtensions.fs +++ b/src/GraphBLAS-sharp.Backend/Objects/ClContextExtensions.fs @@ -47,6 +47,6 @@ module ClContextExtensions = Cl .GetDeviceInfo(this.ClDevice.Device, OpenCL.Net.DeviceInfo.MaxMemAllocSize, error) - .CastTo() + .CastTo() |> uint64 |> ((*) 1UL) diff --git a/src/GraphBLAS-sharp.Backend/Operations/SpGeMM/Expand.fs b/src/GraphBLAS-sharp.Backend/Operations/SpGeMM/Expand.fs index a57b38c6..09f04bb7 100644 --- a/src/GraphBLAS-sharp.Backend/Operations/SpGeMM/Expand.fs +++ b/src/GraphBLAS-sharp.Backend/Operations/SpGeMM/Expand.fs @@ -447,7 +447,9 @@ module internal Expand = let generalLength, segmentLengths = getSegmentPointers processor leftMatrix.Columns rightMatrixRowsNNZ - if generalLength < maxAllocSize then + if generalLength = 0 then + None + elif generalLength < maxAllocSize then segmentLengths.Free processor runOneStep processor allocationMode leftMatrix rightMatrixRowsNNZ rightMatrix