Skip to content

Commit

Permalink
fix: spgemm negative maxAllocSize
Browse files Browse the repository at this point in the history
  • Loading branch information
artemiipatov committed Sep 30, 2023
1 parent eb82c53 commit e187916
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/GraphBLAS-sharp.Backend/Objects/ClContextExtensions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ module ClContextExtensions =

Cl
.GetDeviceInfo(this.ClDevice.Device, OpenCL.Net.DeviceInfo.MaxMemAllocSize, error)
.CastTo<int>()
.CastTo<uint64>()
|> uint64
|> ((*) 1UL<Byte>)
4 changes: 3 additions & 1 deletion src/GraphBLAS-sharp.Backend/Operations/SpGeMM/Expand.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e187916

Please sign in to comment.