Skip to content

Commit e187916

Browse files
committed
fix: spgemm negative maxAllocSize
1 parent eb82c53 commit e187916

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/GraphBLAS-sharp.Backend/Objects/ClContextExtensions.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ module ClContextExtensions =
4747

4848
Cl
4949
.GetDeviceInfo(this.ClDevice.Device, OpenCL.Net.DeviceInfo.MaxMemAllocSize, error)
50-
.CastTo<int>()
50+
.CastTo<uint64>()
5151
|> uint64
5252
|> ((*) 1UL<Byte>)

src/GraphBLAS-sharp.Backend/Operations/SpGeMM/Expand.fs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,9 @@ module internal Expand =
447447
let generalLength, segmentLengths =
448448
getSegmentPointers processor leftMatrix.Columns rightMatrixRowsNNZ
449449

450-
if generalLength < maxAllocSize then
450+
if generalLength = 0 then
451+
None
452+
elif generalLength < maxAllocSize then
451453
segmentLengths.Free processor
452454

453455
runOneStep processor allocationMode leftMatrix rightMatrixRowsNNZ rightMatrix

0 commit comments

Comments
 (0)