Skip to content

Commit 1868f3f

Browse files
committed
small fixup. CPU tests failing.
1 parent fc30514 commit 1868f3f

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

Project.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ CellListMap = "69e1c6dd-3888-40e6-b3c8-31ac5f578864"
1212
ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2"
1313
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
1414
Chemfiles = "46823bd8-5fb3-5f92-9aa0-96921f3dd015"
15-
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
1615
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
1716
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
1817
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
@@ -60,7 +59,6 @@ CellListMap = "0.8.11, 0.9"
6059
ChainRules = "1.44"
6160
ChainRulesCore = "1"
6261
Chemfiles = "0.10.3"
63-
Colors = "0.10, 0.11, 0.12"
6462
Combinatorics = "1"
6563
DataStructures = "0.18"
6664
Distances = "0.10"
@@ -70,6 +68,7 @@ EzXML = "1"
7068
FLoops = "0.2"
7169
ForwardDiff = "0.10.35"
7270
GLMakie = "0.8, 0.9, 0.10"
71+
GPUArrays = "10"
7372
Graphs = "1.8"
7473
KernelAbstractions = "0.9"
7574
KernelDensity = "0.5, 0.6"

ext/MollyCUDAExt.jl

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ module MollyCUDAExt
33
using Molly
44
using CUDA
55
using ChainRulesCore
6+
using Atomix
67

7-
# CUDA specific calls for Molly
8-
@non_differentiable CUDA.zeros(args...)
9-
CUDA.Const(nl::NoNeighborList) = nl
8+
CUDA.Const(nl::Molly.NoNeighborList) = nl
109

1110
# CUDA.jl kernels
1211
const WARPSIZE = UInt32(32)
@@ -493,4 +492,9 @@ function specific_pe_4_atoms_kernel!(energy, coords_var, boundary, is_var, js_va
493492
return nothing
494493
end
495494

495+
# CUDA specific calls for Molly
496+
@non_differentiable CUDA.zeros(args...)
497+
@non_differentiable cuda_threads_blocks_pairwise(args...)
498+
@non_differentiable cuda_threads_blocks_specific(args...)
499+
496500
end

ext/MollyGLMakieExt.jl

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ module MollyGLMakieExt
55

66
using Molly
77
using GLMakie
8-
using Colors
98
using Unitful
109

1110
using LinearAlgebra
@@ -95,7 +94,7 @@ function Molly.visualize(coord_logger,
9594
push!(trail_positions, Observable(PointType.(ustrip_vec.(coords_start))))
9695
col = parse.(Colorant, color)
9796
alpha = 1 - (trail_i / (trails + 1))
98-
alpha_col = RGBA.(red.(col), green.(col), blue.(col), alpha)
97+
alpha_col = GLMakie.RGBAf.(red.(col), green.(col), blue.(col), alpha)
9998
scatter!(ax, trail_positions[end]; color=alpha_col, markersize=markersize,
10099
transparency=transparency, markerspace=:data, kwargs...)
101100
end

src/chain_rules.jl

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Chain rules to allow differentiable simulations
2-
32
@non_differentiable n_infinite_dims(args...)
4-
@non_differentiable zeros(args...)
3+
@non_differentiable KernelAbstractions.zeros(args...)
54
@non_differentiable get_backend(args...)
65
@non_differentiable get_array_type(args...)
76
@non_differentiable random_velocities(args...)

test/basic.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ end
321321
)
322322
neighbors_gpu = find_neighbors(sys_gpu, nf_gpu)
323323
@test length(neighbors_gpu) == n_neighbors_ref
324-
CUDA.allowscalar() do
324+
GPUArrays.allowscalar() do
325325
@test neighbors_gpu[10] isa Tuple{Int32, Int32, Bool}
326326
end
327327
@test identical_neighbors(neighbors_gpu, neighbors_ref)
@@ -339,7 +339,7 @@ end
339339
)
340340
neighbors_gpu = find_neighbors(sys_gpu, nf_gpu)
341341
@test length(neighbors_gpu) == n_neighbors_ref
342-
AMDGPU.allowscalar() do
342+
GPUArrays.allowscalar() do
343343
@test neighbors_gpu[10] isa Tuple{Int32, Int32, Bool}
344344
end
345345
@test identical_neighbors(neighbors_gpu, neighbors_ref)

test/zygote.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ end
431431
for (test_name, test_fn, test_tol) in test_runs
432432
for (platform, args) in platform_runs
433433
f = test_fn(args...)
434-
grads_zygote = CUDA.allowscalar() do
434+
grads_zygote = GPUArrays.allowscalar() do
435435
gradient(f, params_dic)[1]
436436
end
437437
@test count(!iszero, values(grads_zygote)) == 67

0 commit comments

Comments
 (0)