Skip to content

Kronecker #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d1bb7a7
add: MapWithValue
artemiipatov Apr 8, 2023
60746f8
add: merge for disjoint matrices
artemiipatov Apr 9, 2023
cc69816
add: mapWithValue, kronecker
artemiipatov Apr 9, 2023
c5d1414
refactor: formatting
artemiipatov Apr 9, 2023
4401503
fix: loading left matrix to host
artemiipatov Apr 10, 2023
21922d0
fix: kronecker indices bug
artemiipatov Apr 11, 2023
14f7e38
add: kronecker tests
artemiipatov Apr 11, 2023
d19f9ea
wip: safe operations for kronecker
artemiipatov Apr 11, 2023
cf180f1
fix: zero matrix bug in kronecker
artemiipatov Apr 12, 2023
67a9cdb
refactor: replace anonymous record with local type
artemiipatov Apr 12, 2023
1ec44fb
fix: accessViolationException
artemiipatov Apr 12, 2023
19322fc
fix: start result matrix value bug
artemiipatov Apr 12, 2023
9259610
fix: memory leaks
artemiipatov Apr 13, 2023
7c9d6c2
refactor: formatting
artemiipatov Apr 13, 2023
6464707
fix: kronecker tests
artemiipatov Apr 13, 2023
f8399ed
refactor: formatting
artemiipatov Apr 13, 2023
9e550fb
merge: dev
artemiipatov Apr 13, 2023
4f75632
refactor: move mergeDisjoint
artemiipatov Apr 13, 2023
111aee3
refactor: kronecker tests
artemiipatov Apr 14, 2023
7b7399d
refactor: kronecker tests
artemiipatov Apr 14, 2023
2e6d997
refactor: expand tests
artemiipatov Apr 14, 2023
2bd1901
refactor: add comments
artemiipatov Apr 14, 2023
c24dace
refactor: tests
artemiipatov Apr 14, 2023
808181e
refactor: tests
artemiipatov Apr 14, 2023
82c68fb
refactor: spgemm tests
artemiipatov Apr 15, 2023
62849a7
refactor: formatting
artemiipatov Apr 15, 2023
15818e2
refactor: kronecker
artemiipatov Apr 17, 2023
bf4bac9
refactor: kronecker
artemiipatov Apr 17, 2023
d7337d2
refactor: kronecker, tests
artemiipatov Apr 20, 2023
3b27d70
refactor: kronecker
artemiipatov Apr 23, 2023
35f75ed
add: mergeDisjoint tests
artemiipatov Apr 24, 2023
f0e3548
refactor: kronecker
artemiipatov May 6, 2023
2c913e5
merge: dev
artemiipatov May 7, 2023
bb6f388
move: kronecker tests
artemiipatov May 7, 2023
4b3ab99
add: kronecker tests
artemiipatov May 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/GraphBLAS-sharp.Backend/Common/ClArray.fs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,36 @@ module ClArray =

result

let mapWithValue<'a, 'b, 'c> (clContext: ClContext) workGroupSize (op: Expr<'a -> 'b -> 'c>) =

let map =
<@ fun (ndRange: Range1D) lenght (value: ClCell<'a>) (inputArray: ClArray<'b>) (result: ClArray<'c>) ->

let gid = ndRange.GlobalID0

if gid < lenght then
result.[gid] <- (%op) value.Value inputArray.[gid] @>

let kernel = clContext.Compile map

fun (processor: MailboxProcessor<_>) allocationMode (value: ClCell<'a>) (inputArray: ClArray<'b>) ->

let result =
clContext.CreateClArrayWithSpecificAllocationMode(allocationMode, inputArray.Length)

let ndRange =
Range1D.CreateValid(inputArray.Length, workGroupSize)

let kernel = kernel.GetKernel()

processor.Post(
Msg.MsgSetArguments(fun () -> kernel.KernelFunc ndRange inputArray.Length value inputArray result)
)

processor.Post(Msg.CreateRunMsg<_, _>(kernel))

result

let map2InPlace<'a, 'b, 'c> (map: Expr<'a -> 'b -> 'c>) (clContext: ClContext) workGroupSize =

let kernel =
Expand Down
1 change: 1 addition & 0 deletions src/GraphBLAS-sharp.Backend/GraphBLAS-sharp.Backend.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<Compile Include="Matrix/CSR/Merge.fs" />
<Compile Include="Matrix/CSR/Map2.fs" />
<Compile Include="Matrix/CSR/Map.fs" />
<Compile Include="Matrix/CSR/Kronecker.fs" />
<Compile Include="Matrix/CSR/Matrix.fs" />
<Compile Include="Matrix/LIL/Matrix.fs" />
<Compile Include="Matrix/SpGeMM/Expand.fs" />
Expand Down
Loading