Skip to content

Commit a2d7a62

Browse files
committed
Update GPU compatibility checks for COO CUDA
1 parent 258d35e commit a2d7a62

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

GNNGraphs/test/gnngraph.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,14 @@ end
9999
mat_gpu = adjacency_matrix(g_gpu)
100100
@test mat_gpu isa AbstractMatrix{Int}
101101
@test get_device(mat_gpu) isa AbstractGPUDevice
102-
@test Array(mat_gpu) == adj_mat
102+
# Convert to float first because poor Int support in CUSPARSE, throws an error
103+
@test Array(Float32.(mat_gpu)) == Float32.(adj_mat)
103104
end
104105
end
105106

106107
@testset "normalized_laplacian" begin
107108
mat = normalized_laplacian(g)
108-
if TEST_GPU && !(dev isa MetalDevice) && GRAPH_T != :sparse
109+
if TEST_GPU && !(dev isa MetalDevice) && GRAPH_T != :sparse && GRAPH_T != :coo
109110
mat_gpu = normalized_laplacian(g_gpu)
110111
@test mat_gpu isa AbstractMatrix{Float32}
111112
@test get_device(mat_gpu)isa AbstractGPUDevice
@@ -114,7 +115,7 @@ end
114115
end
115116

116117
@testset "scaled_laplacian" begin
117-
if TEST_GPU && !(dev isa MetalDevice) && GRAPH_T != :sparse
118+
if TEST_GPU && !(dev isa MetalDevice) && GRAPH_T != :sparse && GRAPH_T != :coo
118119
mat = scaled_laplacian(g)
119120
mat_gpu = scaled_laplacian(g_gpu)
120121
@test mat_gpu isa AbstractMatrix{Float32}

GNNGraphs/test/transform.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,10 @@ end
456456

457457
s2, t2 = edge_index(g2)
458458
w2 = get_edge_weight(g2)
459-
@test s2 == [1, 2, 2, 3, 3, 4, 4]
460-
@test t2 == [2, 1, 3, 2, 4, 3, 4]
459+
# @test s2 == [1, 2, 2, 3, 3, 4, 4]
460+
# @test t2 == [2, 1, 3, 2, 4, 3, 4]
461+
@test s2 == [2, 1, 3, 2, 4, 3, 4]
462+
@test t2 == [1, 2, 2, 3, 3, 4, 4]
461463
@test w2 == [1, 1, 2, 2, 3.5, 3.5, 5]
462464
@test g2.edata.e == [10.0, 10.0, 20.0, 20.0, 35.0, 35.0, 50.0]
463465
end

GraphNeuralNetworks/test/layers/conv.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ end
108108

109109
if gpu_backend() == "AMDGPU"
110110
broken = true
111-
elseif gpu_backend() == "CUDA" && get_graph_type(g) == :sparse
111+
elseif gpu_backend() == "CUDA" && get_graph_type(g) in [:coo, :sparse]
112112
broken = true
113113
else
114114
broken = false

0 commit comments

Comments
 (0)