Skip to content

Commit

Permalink
Vector.create tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgarbar committed Oct 16, 2023
1 parent f1a6f24 commit edc5a73
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,23 @@ let correctnessGenericTest<'a when 'a: struct and 'a: equality>
(vectorSize: int)
=

let vectorSize = abs vectorSize
try
let vectorSize = abs vectorSize

if vectorSize > 0 then
let q = case.TestContext.Queue
if vectorSize > 0 then
let q = case.TestContext.Queue

let clVector =
zeroCreate q HostInterop vectorSize case.Format
let clVector =
zeroCreate q HostInterop vectorSize case.Format

let hostVector = clVector.ToHost q
let hostVector = clVector.ToHost q

clVector.Dispose q
clVector.Dispose q

checkResult vectorSize hostVector
checkResult vectorSize hostVector
with
| ex when ex.Message = "Attempting to create full sparse vector" -> ()
| ex -> raise ex

let createTest<'a> case =
let getCorrectnessTestName dataType =
Expand Down
2 changes: 1 addition & 1 deletion tests/GraphBLAS-sharp.Tests/GraphBLAS-sharp.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<Compile Include="Backend/Vector/OfList.fs" />
<Compile Include="Backend/Vector/Reduce.fs" />
<Compile Include="Backend/Vector/SpMV.fs" />
<Compile Include="Backend/Vector/ZeroCreate.fs" />
<Compile Include="Backend/Vector/Create.fs" />
<Compile Include="Backend/Vector/Merge.fs" />
<Compile Include="Backend/Vector/SpMSpV.fs" />
<Compile Include="Backend/Vector/Map.fs" />
Expand Down

0 comments on commit edc5a73

Please sign in to comment.