Skip to content

Commit

Permalink
Remove unused functions from utils
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterTh committed Nov 26, 2024
1 parent f0ca5db commit 9ee07b3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ macro(fetch_content_from_submodule DEPNAME RELPATH)
# - another depencency of celerity-runtime that it transitively shares a depencency with (SimSYCL -> libenvpp)
# The top-level CMake project must ensure that there are no conflicts between dependency versions in this case.
if(${DEPNAME}_FOUND)
message(STATUS "Using system ${DEPNAME} in ${${DEPNAME}_DIR}")
message(STATUS "Using existing ${DEPNAME} in ${${DEPNAME}_DIR}, please ensure that the version (${${DEPNAME}_VERSION}) is compatible")
set(CELERITY_DETAIL_USE_SYSTEM_${DEPNAME} ON)
else()
message(STATUS "Fetching ${DEPNAME} from submodule")
Expand Down
17 changes: 0 additions & 17 deletions include/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,6 @@ auto as(P* p) {
return static_cast<std::conditional_t<std::is_const_v<P>, const T*, T*>>(p);
}

template <typename BitMaskT>
constexpr inline uint32_t popcount(const BitMaskT bit_mask) noexcept {
static_assert(std::is_integral_v<BitMaskT> && std::is_unsigned_v<BitMaskT>, "popcount argument needs to be an unsigned integer type.");

uint32_t counter = 0;
for(auto b = bit_mask; b; b >>= 1) {
counter += b & 1;
}
return counter;
}

// Implementation from Boost.ContainerHash, licensed under the Boost Software License, Version 1.0.
inline void hash_combine(std::size_t& seed, std::size_t value) { seed ^= value + 0x9e3779b9 + (seed << 6) + (seed >> 2); }

Expand Down Expand Up @@ -195,12 +184,6 @@ bool contains(const Container& container, const Key& key) {
}
}

template <typename Container, typename Predicate>
void erase_if(Container& container, const Predicate& predicate) {
using std::begin, std::end;
container.erase(std::remove_if(begin(container), end(container), predicate), end(container));
}

/// Replaces all occurrences of `pattern` in `in` with `with`. If `pattern` is empty, returns the input string unchanged.
std::string replace_all(const std::string_view& input, const std::string_view& pattern, const std::string_view& replacement);

Expand Down
2 changes: 1 addition & 1 deletion vendor/libenvpp

0 comments on commit 9ee07b3

Please sign in to comment.