Skip to content

Commit 127df0c

Browse files
committed
availableContexts for test's helpers
1 parent e80ef7e commit 127df0c

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

tests/GraphBLAS-sharp.Tests/Helpers.fs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,19 +406,25 @@ module Utils =
406406
.GetDeviceInfo(device, DeviceInfo.Platform, &e)
407407
.CastTo<Platform>()
408408

409-
let platformName =
409+
let clPlatform =
410410
Cl
411411
.GetPlatformInfo(platform, PlatformInfo.Name, &e)
412412
.ToString()
413+
|> ClPlatform.Custom
413414

414415
let deviceType =
415416
Cl
416417
.GetDeviceInfo(device, DeviceInfo.Type, &e)
417418
.CastTo<DeviceType>()
418419

419-
failwith "fix me"
420-
//ClContext(platformName, deviceType)
421-
ClContext())
420+
let clDeviceType =
421+
match deviceType with
422+
| DeviceType.Cpu -> ClDeviceType.CPU
423+
| DeviceType.Gpu -> ClDeviceType.GPU
424+
| DeviceType.Default -> ClDeviceType.Default
425+
| _ -> failwith "Unsupported"
426+
427+
Brahma.FSharp.OpenCL.ClContext(clPlatform, clDeviceType))
422428

423429
let createMatrixFromArray2D matrixCase array isZero =
424430
match matrixCase with

0 commit comments

Comments
 (0)