Skip to content

Commit 0a53a92

Browse files
committed
fixup! fixup! fixup! datadeps: Add at-stencil helper
1 parent 56c6504 commit 0a53a92

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/stencil.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@ const Read = In
33
const Write = Out
44
const ReadWrite = InOut
55

6-
function validate_neigh_dist(neigh_dist, size)
6+
function validate_neigh_dist(neigh_dist)
77
if !(neigh_dist isa Integer)
88
throw(ArgumentError("Neighborhood distance ($neigh_dist) must be an Integer"))
99
end
1010
if neigh_dist <= 0
1111
throw(ArgumentError("Neighborhood distance ($neigh_dist) must be greater than 0"))
1212
end
13+
end
14+
function validate_neigh_dist(neigh_dist, size)
15+
validate_neigh_dist(neigh_dist)
1316
if any(size .< neigh_dist)
1417
throw(ArgumentError("Neighborhood distance ($neigh_dist) must not be larger than the chunk size ($size)"))
1518
end
@@ -34,7 +37,7 @@ function load_neighbor_corner(arr, corner_side, neigh_dist)
3437
return move(task_processor(), collect(@view arr[start_idx:stop_idx]))
3538
end
3639
function select_neighborhood_chunks(chunks, idx, neigh_dist, boundary)
37-
@assert neigh_dist isa Integer && neigh_dist > 0 "Neighborhood distance must be an Integer greater than 0"
40+
validate_neigh_dist(neigh_dist)
3841

3942
# FIXME: Depends on neigh_dist and chunk size
4043
chunk_dist = 1

0 commit comments

Comments
 (0)