Skip to content

Commit

Permalink
Do not append " - blocks" to the bitset label
Browse files Browse the repository at this point in the history
  • Loading branch information
dalg24 committed Oct 18, 2023
1 parent 3490ec1 commit 380754b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
23 changes: 2 additions & 21 deletions containers/src/Kokkos_Bitset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,6 @@

namespace Kokkos {

namespace Impl {
//! Either append to the label if the property already exists, or set it.
template <typename... P>
auto with_updated_label(const ViewCtorProp<P...>& view_ctor_prop,
const std::string& label) {
using vcp_t = ViewCtorProp<P...>;
//! If the label property is already set, append. Otherwise, set label.
if constexpr (vcp_t::has_label) {
vcp_t new_ctor_props(view_ctor_prop);
static_cast<ViewCtorProp<void, std::string>&>(new_ctor_props)
.value.append(label);
return new_ctor_props;
} else {
return Impl::with_properties_if_unset(view_ctor_prop, label);
}
}
} // namespace Impl

template <typename Device = Kokkos::DefaultExecutionSpace>
class Bitset;

Expand Down Expand Up @@ -108,9 +90,8 @@ class Bitset {
"Allocation properties should not contain the 'pointer' property.");

//! Update 'label' property and allocate.
const auto prop_copy = Kokkos::Impl::with_updated_label(
Impl::with_properties_if_unset(arg_prop, std::string("Bitset")),
" - blocks");
const auto prop_copy =
Impl::with_properties_if_unset(arg_prop, std::string("Bitset"));
m_blocks =
block_view_type(prop_copy, ((m_size + block_mask) >> block_shift));

Expand Down
16 changes: 16 additions & 0 deletions containers/src/impl/Kokkos_UnorderedMap_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@
namespace Kokkos {
namespace Impl {

//! Either append to the label if the property already exists, or set it.
template <typename... P>
auto with_updated_label(const ViewCtorProp<P...>& view_ctor_prop,
const std::string& label) {
using vcp_t = ViewCtorProp<P...>;
//! If the label property is already set, append. Otherwise, set label.
if constexpr (vcp_t::has_label) {
vcp_t new_ctor_props(view_ctor_prop);
static_cast<ViewCtorProp<void, std::string>&>(new_ctor_props)
.value.append(label);
return new_ctor_props;
} else {
return Impl::with_properties_if_unset(view_ctor_prop, label);
}
}

uint32_t find_hash_size(uint32_t size);

template <typename Map>
Expand Down

0 comments on commit 380754b

Please sign in to comment.