SpMV#49
Conversation
| .GetDeviceInfo(clContext.ClDevice.Device, OpenCL.Net.DeviceInfo.LocalMemSize, error) | ||
| .CastTo<int>() | ||
|
|
||
| let localArraySize1 = workGroupSize + 1 |
There was a problem hiding this comment.
Can it be reused in other algorithms to calculate the optimal size of the local array?
| let rowEnd = | ||
| min (localPtr.[lid + 1] - blockLowerBound) workPerIteration | ||
|
|
||
| for jj in rowStart .. rowEnd - 1 do |
There was a problem hiding this comment.
What is the reason to use such a strange name jj?
| |> correctnessGenericTest 0uy (+) (*) byteAdd (=) q | ||
| |> testPropertyWithConfig config (getCorrectnessTestName "byte") ] | ||
|
|
||
| let tests = |
There was a problem hiding this comment.
Looks like code duplication (look here or to other tests)
| localMemoryLeft / optionTypeClSizeInBytes | ||
| |> Utils.floorToMultiple workGroupSize | ||
|
|
||
| let kernel1 = |
| min (localPtr.[lid + 1] - blockLowerBound) workPerIteration | ||
|
|
||
| for jj in rowStart .. rowEnd - 1 do | ||
| match (%add) sum localValues.[jj] with |
There was a problem hiding this comment.
This match is equivalent to sum <- (%add) sum localValues.[jj]
| //Loading values to the local memory | ||
| for block in 0 .. numberOfBlocksFitting - 1 do | ||
| if index < workEnd then | ||
| localValues.[lid + block * threadsPerBlock] <- intermediateArray.[index] |
There was a problem hiding this comment.
Looks like if it's the last work group, indices are out of bounds sometimes
There was a problem hiding this comment.
On the last work group threadsPerBlock is computed as numberOfRows - gid + lid, so workEnd will be equal to the last value of row pointers array and indices will not be out of bounds
Proposed Changes
SpMV operation added
Types of changes
What types of changes does your code introduce to GraphBLAS-sharp?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.