Skip to content

Commit

Permalink
Make GPU compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
efaulhaber committed Dec 23, 2024
1 parent 5a1cf0c commit 4d2ff80
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cell_lists/full_grid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,10 @@ function check_domain_bounds(cell_list::FullGridCellList, y, search_radius)
error("particle coordinates contain NaNs")
end

# Require one extra layer in each direction to make sure neighbor cells exist
min_corner = minimum(y, dims = 2) .- search_radius
max_corner = maximum(y, dims = 2) .+ search_radius
# Require one extra layer in each direction to make sure neighbor cells exist.
# Convert to CPU in case this lives on the GPU.
min_corner = Array(minimum(y, dims = 2) .- search_radius)
max_corner = Array(maximum(y, dims = 2) .+ search_radius)

if any(min_corner .< cell_list.min_corner) || any(max_corner .> cell_list.max_corner)
error("particle coordinates are outside the domain bounds of the cell list")
Expand Down

0 comments on commit 4d2ff80

Please sign in to comment.