Skip to content

Commit

Permalink
unorderedmap: adding missing constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
romintomasetti committed Jan 27, 2024
1 parent 2015055 commit c9100d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions containers/src/Kokkos_UnorderedMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ class UnorderedMap {
m_keys[new_index] = k;
#endif

if (!is_set) {
if constexpr (!is_set) {
KOKKOS_NONTEMPORAL_PREFETCH_STORE(&m_values[new_index]);
#ifdef KOKKOS_ENABLE_SYCL
Kokkos::atomic_store(&m_values[new_index], v);
Expand Down Expand Up @@ -844,7 +844,7 @@ class UnorderedMap {
sizeof(size_type) * src.m_next_index.extent(0));
raw_deep_copy(tmp.m_keys.data(), src.m_keys.data(),
sizeof(key_type) * src.m_keys.extent(0));
if (!is_set) {
if constexpr (!is_set) {
raw_deep_copy(tmp.m_values.data(), src.m_values.data(),
sizeof(impl_value_type) * src.m_values.extent(0));
}
Expand Down
4 changes: 2 additions & 2 deletions containers/src/impl/Kokkos_UnorderedMap_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct UnorderedMapErase {
next = m_map.m_next_index[curr];
m_map.m_next_index[curr] = invalid_index;
m_map.m_keys[curr] = key_type();
if (m_map.is_set) m_map.m_values[curr] = value_type();
if constexpr (map_type::is_set) m_map.m_values[curr] = value_type();
curr = next;
m_map.m_hash_lists(i) = next;
}
Expand All @@ -117,7 +117,7 @@ struct UnorderedMapErase {
m_map.m_next_index[prev] = next;
m_map.m_next_index[curr] = invalid_index;
m_map.m_keys[curr] = key_type();
if (map_type::is_set) m_map.m_values[curr] = value_type();
if constexpr (map_type::is_set) m_map.m_values[curr] = value_type();
}
curr = next;
}
Expand Down

0 comments on commit c9100d8

Please sign in to comment.