From 9069567920fdd316b91bca53389dd25aeafdfdb5 Mon Sep 17 00:00:00 2001 From: CarloLucibello Date: Sun, 21 Sep 2025 16:40:44 +0200 Subject: [PATCH 1/5] fix --- GNNGraphs/src/convert.jl | 2 +- GNNlib/test/runtests.jl | 2 +- GNNlib/test/test_module.jl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GNNGraphs/src/convert.jl b/GNNGraphs/src/convert.jl index 6735a9d27..de129ab92 100644 --- a/GNNGraphs/src/convert.jl +++ b/GNNGraphs/src/convert.jl @@ -137,7 +137,7 @@ function to_dense(A::ADJMAT_T, T = nothing; dir = :out, num_nodes = nothing, A = T.(A) end if !weighted - A = map(x -> ifelse(x > 0, T(1), T(0)), A) + A = binarize(A, T) end return A, num_nodes, num_edges end diff --git a/GNNlib/test/runtests.jl b/GNNlib/test/runtests.jl index 25f2ca5aa..931fc5210 100644 --- a/GNNlib/test/runtests.jl +++ b/GNNlib/test/runtests.jl @@ -13,7 +13,7 @@ using TestItemRunner ## Uncomment below and in test_module.jl to change the default test settings # ENV["GNN_TEST_CPU"] = "false" -# ENV["GNN_TEST_CUDA"] = "true" +ENV["GNN_TEST_CUDA"] = "true" # ENV["GNN_TEST_AMDGPU"] = "true" # ENV["GNN_TEST_Metal"] = "true" diff --git a/GNNlib/test/test_module.jl b/GNNlib/test/test_module.jl index 075881af8..0c7775d4d 100644 --- a/GNNlib/test/test_module.jl +++ b/GNNlib/test/test_module.jl @@ -6,7 +6,7 @@ using Pkg # tried to put this in __init__ but is not executed for some reason ## Uncomment below to change the default test settings -# ENV["GNN_TEST_CUDA"] = "true" +ENV["GNN_TEST_CUDA"] = "true" # ENV["GNN_TEST_AMDGPU"] = "true" # ENV["GNN_TEST_Metal"] = "true" From 73673c9e2d4261274e487f71457f31012ce268d1 Mon Sep 17 00:00:00 2001 From: Carlo Lucibello Date: Sun, 21 Sep 2025 15:49:47 +0200 Subject: [PATCH 2/5] fix nnlibcudaext --- GNNlib/ext/GNNlibCUDAExt.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GNNlib/ext/GNNlibCUDAExt.jl b/GNNlib/ext/GNNlibCUDAExt.jl index 9cfe45089..8a231c768 100644 --- a/GNNlib/ext/GNNlibCUDAExt.jl +++ b/GNNlib/ext/GNNlibCUDAExt.jl @@ -3,7 +3,7 @@ module GNNlibCUDAExt using CUDA using Random, Statistics, LinearAlgebra using GNNlib: GNNlib, propagate, copy_xj, e_mul_xj, w_mul_xj -using GNNGraphs: GNNGraph, COO_T, SPARSE_T, to_dense, to_sparse +using GNNGraphs: GNNGraph, COO_T, SPARSE_T, to_dense, to_sparse, adjacency_matrix using ChainRulesCore: @non_differentiable const CUDA_COO_T = Tuple{T, T, V} where {T <: AnyCuArray{<:Integer}, V <: Union{Nothing, AnyCuArray}} From 050e1b34570abaafd55c644f27a88a367b62e7a4 Mon Sep 17 00:00:00 2001 From: CarloLucibello Date: Sun, 21 Sep 2025 16:45:16 +0200 Subject: [PATCH 3/5] cleanup --- GNNlib/test/runtests.jl | 2 +- GNNlib/test/test_module.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GNNlib/test/runtests.jl b/GNNlib/test/runtests.jl index 931fc5210..25f2ca5aa 100644 --- a/GNNlib/test/runtests.jl +++ b/GNNlib/test/runtests.jl @@ -13,7 +13,7 @@ using TestItemRunner ## Uncomment below and in test_module.jl to change the default test settings # ENV["GNN_TEST_CPU"] = "false" -ENV["GNN_TEST_CUDA"] = "true" +# ENV["GNN_TEST_CUDA"] = "true" # ENV["GNN_TEST_AMDGPU"] = "true" # ENV["GNN_TEST_Metal"] = "true" diff --git a/GNNlib/test/test_module.jl b/GNNlib/test/test_module.jl index 0c7775d4d..075881af8 100644 --- a/GNNlib/test/test_module.jl +++ b/GNNlib/test/test_module.jl @@ -6,7 +6,7 @@ using Pkg # tried to put this in __init__ but is not executed for some reason ## Uncomment below to change the default test settings -ENV["GNN_TEST_CUDA"] = "true" +# ENV["GNN_TEST_CUDA"] = "true" # ENV["GNN_TEST_AMDGPU"] = "true" # ENV["GNN_TEST_Metal"] = "true" From c46c2c34a0baf958405756b3f0dafe80ef4489ee Mon Sep 17 00:00:00 2001 From: CarloLucibello Date: Sun, 21 Sep 2025 16:51:19 +0200 Subject: [PATCH 4/5] test fmt --- GNNGraphs/test/query.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GNNGraphs/test/query.jl b/GNNGraphs/test/query.jl index 54aab409b..6823874b4 100644 --- a/GNNGraphs/test/query.jl +++ b/GNNGraphs/test/query.jl @@ -271,6 +271,14 @@ end end[1] @test gw == [1, 1, 1] + + @testset "fmt" begin + Asparse = adjacency_matrix(g, weighted = false, fmt = :sparse) + @test Asparse isa AbstractSparseMatrix + Adense = adjacency_matrix(g, weighted = false, fmt = :dense) + @test Adense isa AbstractMatrix + @test !(Adense isa AbstractSparseMatrix) + @test collect(Asparse) == Adense end end From 2fe82cbb74e4e8b892d0ab8ed96e4cb57834f858 Mon Sep 17 00:00:00 2001 From: CarloLucibello Date: Sun, 21 Sep 2025 17:07:43 +0200 Subject: [PATCH 5/5] fix --- GNNGraphs/test/query.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GNNGraphs/test/query.jl b/GNNGraphs/test/query.jl index 6823874b4..f5c08001e 100644 --- a/GNNGraphs/test/query.jl +++ b/GNNGraphs/test/query.jl @@ -271,7 +271,8 @@ end end[1] @test gw == [1, 1, 1] - + end + @testset "fmt" begin Asparse = adjacency_matrix(g, weighted = false, fmt = :sparse) @test Asparse isa AbstractSparseMatrix