Skip to content

Commit

Permalink
const for device-side var. Pass by reference allowed for host side, i…
Browse files Browse the repository at this point in the history
…f user is cautious.
  • Loading branch information
jonahm-LANL committed Nov 22, 2024
1 parent 53c3632 commit 14ed096
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion singularity-eos/eos/eos_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class EosBase {

// Generic evaluator
template <typename Functor_t>
PORTABLE_INLINE_FUNCTION void EvaluateDevice(Functor_t &f) const {
PORTABLE_INLINE_FUNCTION void EvaluateDevice(const Functor_t f) const {
const CRTP copy = *(static_cast<CRTP const *>(this));
f(copy);
}
Expand Down
2 changes: 1 addition & 1 deletion singularity-eos/eos/eos_variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Variant {
}

template <typename Functor_t>
PORTABLE_INLINE_FUNCTION void EvaluateDevice(Functor_t &f) const {
PORTABLE_INLINE_FUNCTION void EvaluateDevice(const Functor_t f) const {
return mpark::visit([&f](const auto &eos) { return eos.EvaluateDevice(f); }, eos_);
}

Expand Down

0 comments on commit 14ed096

Please sign in to comment.