Skip to content

Commit 7e331a5

Browse files
committed
add: ClContextExtensions
1 parent 8b2df22 commit 7e331a5

4 files changed

Lines changed: 24 additions & 18 deletions

File tree

src/GraphBLAS-sharp.Backend/Common/ClArray.fs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,9 @@ namespace GraphBLAS.FSharp.Backend.Common
22

33
open Brahma.FSharp
44
open Microsoft.FSharp.Quotations
5+
open GraphBLAS.FSharp.Backend.Objects.ClContext
56

67
module ClArray =
7-
type ClContext with
8-
member this.CreateClArrayWithGPUOnlyFlags(size: int) =
9-
this.CreateClArray(
10-
size,
11-
deviceAccessMode = DeviceAccessMode.ReadWrite,
12-
hostAccessMode = HostAccessMode.NotAccessible,
13-
allocationMode = AllocationMode.Default
14-
)
15-
16-
member this.CreateClArrayWithGPUOnlyFlags(array: 'a []) =
17-
this.CreateClArray(
18-
array,
19-
deviceAccessMode = DeviceAccessMode.ReadWrite,
20-
hostAccessMode = HostAccessMode.NotAccessible,
21-
allocationMode = AllocationMode.CopyHostPtr
22-
)
23-
248
let init (initializer: Expr<int -> 'a>) (clContext: ClContext) workGroupSize =
259

2610
let init =

src/GraphBLAS-sharp.Backend/GraphBLAS-sharp.Backend.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<Compile Include="Objects/Matrix.fs" />
1818
<Compile Include="Objects/Masks.fs" />
1919
<Compile Include="Objects/AtLeastOne.fs" />
20+
<Compile Include="Objects\ClContextExtensions.fs" />
2021
<Compile Include="Quotes/SubReduce.fs" />
2122
<Compile Include="Quotes/Arithmetic.fs" />
2223
<Compile Include="Quotes/Convert.fs" />
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
namespace GraphBLAS.FSharp.Backend.Objects
2+
3+
open Brahma.FSharp
4+
5+
module ClContext =
6+
type ClContext with
7+
member this.CreateClArrayWithGPUOnlyFlags(size: int) =
8+
this.CreateClArray(
9+
size,
10+
deviceAccessMode = DeviceAccessMode.ReadWrite,
11+
hostAccessMode = HostAccessMode.NotAccessible,
12+
allocationMode = AllocationMode.Default
13+
)
14+
15+
member this.CreateClArrayWithGPUOnlyFlags(array: 'a []) =
16+
this.CreateClArray(
17+
array,
18+
deviceAccessMode = DeviceAccessMode.ReadWrite,
19+
hostAccessMode = HostAccessMode.NotAccessible,
20+
allocationMode = AllocationMode.CopyHostPtr
21+
)

src/GraphBLAS-sharp.Backend/Vector/Vector.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ open GraphBLAS.FSharp.Backend.Common
88
open GraphBLAS.FSharp.Backend.Vector.Dense
99
open GraphBLAS.FSharp.Backend.Vector.Sparse
1010
open GraphBLAS.FSharp.Backend.Objects
11-
open GraphBLAS.FSharp.Backend.Common.ClArray
11+
open GraphBLAS.FSharp.Backend.Objects.ClContext
1212
open GraphBLAS.FSharp.Backend.Objects.ClVector
1313

1414

0 commit comments

Comments
 (0)