Skip to content

Commit

Permalink
Improve perf of _set_continuous! & _set_discrete! (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
albert-de-montserrat authored Jun 18, 2024
1 parent 9ba161f commit 8bd81f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Chmy"
uuid = "33a72cf0-4690-46d7-b987-06506c2248b9"
authors = ["Ivan Utkin <[email protected]>, Ludovic Raess <[email protected]>, and contributors"]
version = "0.1.15"
version = "0.1.16"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
4 changes: 2 additions & 2 deletions src/Fields/field.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ end
dst[I...] = src[I...]
end

@kernel inbounds = true function _set_continuous!(dst, grid, loc, fun::F, args...) where {F}
@kernel inbounds = true function _set_continuous!(dst, grid, loc, fun::F, args::Vararg{Any, N}) where {F, N}
I = @index(Global, NTuple)
dst[I...] = fun(coord(grid, loc, I...)..., args...)
end

@kernel inbounds = true function _set_discrete!(dst, grid, loc, fun::F, args...) where {F}
@kernel inbounds = true function _set_discrete!(dst, grid, loc, fun::F, args::Vararg{Any, N}) where {F, N}
I = @index(Global, NTuple)
dst[I...] = fun(grid, loc, I..., args...)
end
Expand Down

0 comments on commit 8bd81f7

Please sign in to comment.