|
66 | 66 | @inline function for_particle_neighbor(f, system_coords, neighbor_coords, |
67 | 67 | neighborhood_search, particles, parallel::Val{true}) |
68 | 68 | @threaded for particle in particles |
69 | | - for_particle_neighbor_inner(f, system_coords, neighbor_coords, neighborhood_search, |
70 | | - particle) |
| 69 | + foreach_neighbor(f, system_coords, neighbor_coords, neighborhood_search, particle) |
71 | 70 | end |
72 | 71 |
|
73 | 72 | return nothing |
|
76 | 75 | @inline function for_particle_neighbor(f, system_coords, neighbor_coords, |
77 | 76 | neighborhood_search, particles, parallel::Val{false}) |
78 | 77 | for particle in particles |
79 | | - for_particle_neighbor_inner(f, system_coords, neighbor_coords, neighborhood_search, |
80 | | - particle) |
| 78 | + foreach_neighbor(f, system_coords, neighbor_coords, neighborhood_search, particle) |
81 | 79 | end |
82 | 80 |
|
83 | 81 | return nothing |
84 | 82 | end |
85 | 83 |
|
86 | | -# Use this function barrier and unpack inside to avoid passing closures to Polyester.jl |
87 | | -# with `@batch` (`@threaded`). |
88 | | -# Otherwise, `@threaded` does not work here with Julia ARM on macOS. |
89 | | -# See https://github.com/JuliaSIMD/Polyester.jl/issues/88. |
90 | | -@inline function for_particle_neighbor_inner(f, system_coords, neighbor_system_coords, |
91 | | - neighborhood_search, particle) |
92 | | - (; search_radius, periodic_box) = neighborhood_search |
| 84 | +@inline function foreach_neighbor(f, system_coords, neighbor_system_coords, |
| 85 | + neighborhood_search, particle; |
| 86 | + search_radius = neighborhood_search.search_radius) |
| 87 | + (; periodic_box) = neighborhood_search |
93 | 88 |
|
94 | 89 | particle_coords = extract_svector(system_coords, Val(ndims(neighborhood_search)), |
95 | 90 | particle) |
|
0 commit comments