-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1823e0d
commit 1d2291a
Showing
11 changed files
with
56 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module GNNGraphsCUDAExt | ||
|
||
using CUDA | ||
using Random, Statistics, LinearAlgebra | ||
using GNNGraphs | ||
using GNNGraphs: COO_T, ADJMAT_T, SPARSE_T | ||
|
||
const CUMAT_T = Union{CUDA.AnyCuMatrix, CUDA.CUSPARSE.CuSparseMatrix} | ||
|
||
# Query | ||
|
||
GNNGraphs._rand_dense_vector(A::CUMAT_T) = CUDA.randn(size(A, 1)) | ||
|
||
# Transform | ||
|
||
GNNGraphs.dense_zeros_like(a::CUMAT_T, T::Type, sz = size(a)) = CUDA.zeros(T, sz) | ||
|
||
|
||
# Utils | ||
|
||
GNNGraphs.iscuarray(x::AnyCuArray) = true | ||
|
||
|
||
function sort_edge_index(u::AnyCuArray, v::AnyCuArray) | ||
dev = get_device(u) | ||
cdev = cpu_device() | ||
u, v = u |> cdev, v |> cdev | ||
#TODO proper cuda friendly implementation | ||
sort_edge_index(u, v) |> dev | ||
end | ||
|
||
|
||
end #module |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters