Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump clang format version #431

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ ci:

repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v13.0.0
rev: v16.0.6
hooks:
- id: clang-format
files: \.(cu|cuh|h|hpp|cpp|inl)$
'types_or': [file]
types_or: [c, c++, cuda]
args: ['-fallback-style=none', '-style=file', '-i']
- repo: local
hooks:
Expand Down
2 changes: 1 addition & 1 deletion include/cuco/aow_storage.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class aow_storage : public detail::aow_storage_base<T, WindowSize, Extent> {
aow_storage& operator=(aow_storage&&) = default;
~aow_storage() = default; ///< Destructor

aow_storage(aow_storage const&) = delete;
aow_storage(aow_storage const&) = delete;
aow_storage& operator=(aow_storage const&) = delete;

/**
Expand Down
6 changes: 2 additions & 4 deletions include/cuco/detail/extent/extent.inl
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,10 @@ template <int32_t CGSize, int32_t WindowSize, typename SizeType>
namespace detail {

template <typename...>
struct is_window_extent : std::false_type {
};
struct is_window_extent : std::false_type {};

template <typename SizeType, std::size_t N>
struct is_window_extent<window_extent<SizeType, N>> : std::true_type {
};
struct is_window_extent<window_extent<SizeType, N>> : std::true_type {};

template <typename T>
inline constexpr bool is_window_extent_v = is_window_extent<T>::value;
Expand Down
24 changes: 8 additions & 16 deletions include/cuco/detail/pair/tuple_helpers.inl
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,16 @@
*/

template <typename T1, typename T2>
struct tuple_size<cuco::pair<T1, T2>> : integral_constant<size_t, 2> {
};
struct tuple_size<cuco::pair<T1, T2>> : integral_constant<size_t, 2> {};

template <typename T1, typename T2>
struct tuple_size<const cuco::pair<T1, T2>> : tuple_size<cuco::pair<T1, T2>> {
};
struct tuple_size<const cuco::pair<T1, T2>> : tuple_size<cuco::pair<T1, T2>> {};

template <typename T1, typename T2>
struct tuple_size<volatile cuco::pair<T1, T2>> : tuple_size<cuco::pair<T1, T2>> {
};
struct tuple_size<volatile cuco::pair<T1, T2>> : tuple_size<cuco::pair<T1, T2>> {};

template <typename T1, typename T2>
struct tuple_size<const volatile cuco::pair<T1, T2>> : tuple_size<cuco::pair<T1, T2>> {
};
struct tuple_size<const volatile cuco::pair<T1, T2>> : tuple_size<cuco::pair<T1, T2>> {};

template <std::size_t I, typename T1, typename T2>
struct tuple_element<I, cuco::pair<T1, T2>> {
Expand All @@ -46,20 +42,16 @@ struct tuple_element<1, cuco::pair<T1, T2>> {
};

template <typename T1, typename T2>
struct tuple_element<0, const cuco::pair<T1, T2>> : tuple_element<0, cuco::pair<T1, T2>> {
};
struct tuple_element<0, const cuco::pair<T1, T2>> : tuple_element<0, cuco::pair<T1, T2>> {};

template <typename T1, typename T2>
struct tuple_element<1, const cuco::pair<T1, T2>> : tuple_element<1, cuco::pair<T1, T2>> {
};
struct tuple_element<1, const cuco::pair<T1, T2>> : tuple_element<1, cuco::pair<T1, T2>> {};

template <typename T1, typename T2>
struct tuple_element<0, volatile cuco::pair<T1, T2>> : tuple_element<0, cuco::pair<T1, T2>> {
};
struct tuple_element<0, volatile cuco::pair<T1, T2>> : tuple_element<0, cuco::pair<T1, T2>> {};

template <typename T1, typename T2>
struct tuple_element<1, volatile cuco::pair<T1, T2>> : tuple_element<1, cuco::pair<T1, T2>> {
};
struct tuple_element<1, volatile cuco::pair<T1, T2>> : tuple_element<1, cuco::pair<T1, T2>> {};

template <typename T1, typename T2>
struct tuple_element<0, const volatile cuco::pair<T1, T2>> : tuple_element<0, cuco::pair<T1, T2>> {
Expand Down
21 changes: 7 additions & 14 deletions include/cuco/detail/traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,17 @@
namespace cuco::detail {

template <typename T, typename = void>
struct is_std_pair_like : cuda::std::false_type {
};
struct is_std_pair_like : cuda::std::false_type {};

template <typename T>
struct is_std_pair_like<T,
cuda::std::void_t<decltype(std::get<0>(cuda::std::declval<T>())),
decltype(std::get<1>(cuda::std::declval<T>()))>>
: cuda::std::
conditional_t<std::tuple_size<T>::value == 2, cuda::std::true_type, cuda::std::false_type> {
};
conditional_t<std::tuple_size<T>::value == 2, cuda::std::true_type, cuda::std::false_type> {};

template <typename T, typename = void>
struct is_cuda_std_pair_like : cuda::std::false_type {
};
struct is_cuda_std_pair_like : cuda::std::false_type {};

template <typename T>
struct is_cuda_std_pair_like<
Expand All @@ -47,12 +44,10 @@ struct is_cuda_std_pair_like<
decltype(cuda::std::get<1>(cuda::std::declval<T>()))>>
: cuda::std::conditional_t<cuda::std::tuple_size<T>::value == 2,
cuda::std::true_type,
cuda::std::false_type> {
};
cuda::std::false_type> {};

template <typename T, typename = void>
struct is_thrust_pair_like_impl : cuda::std::false_type {
};
struct is_thrust_pair_like_impl : cuda::std::false_type {};

template <typename T>
struct is_thrust_pair_like_impl<
Expand All @@ -61,13 +56,11 @@ struct is_thrust_pair_like_impl<
decltype(thrust::get<1>(cuda::std::declval<T>()))>>
: cuda::std::conditional_t<thrust::tuple_size<T>::value == 2,
cuda::std::true_type,
cuda::std::false_type> {
};
cuda::std::false_type> {};

template <typename T>
struct is_thrust_pair_like
: is_thrust_pair_like_impl<cuda::std::remove_reference_t<decltype(thrust::raw_reference_cast(
cuda::std::declval<T>()))>> {
};
cuda::std::declval<T>()))>> {};

} // namespace cuco::detail
2 changes: 1 addition & 1 deletion include/cuco/dynamic_map.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class dynamic_map {
dynamic_map(dynamic_map&&) = delete;

dynamic_map& operator=(dynamic_map const&) = delete;
dynamic_map& operator=(dynamic_map&&) = delete;
dynamic_map& operator=(dynamic_map&&) = delete;

/**
* @brief Constructs a dynamically-sized map with the specified initial capacity, growth factor
Expand Down
4 changes: 2 additions & 2 deletions include/cuco/static_map.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class static_map {
storage_ref_type,
Operators...>; ///< Non-owning container ref type

static_map(static_map const&) = delete;
static_map(static_map const&) = delete;
static_map& operator=(static_map const&) = delete;

static_map(static_map&&) = default; ///< Move constructor
Expand Down Expand Up @@ -866,7 +866,7 @@ class static_map {
static_map(static_map&&) = delete;

static_map& operator=(static_map const&) = delete;
static_map& operator=(static_map&&) = delete;
static_map& operator=(static_map&&) = delete;

/**
* @brief Indicates if concurrent insert/find is supported for the key/value types.
Expand Down
2 changes: 1 addition & 1 deletion include/cuco/static_multimap.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class static_multimap {
using probe_sequence_type =
cuco::legacy::detail::probe_sequence<ProbeSequence, Key, Value, Scope>; ///< Probe scheme type

static_multimap(static_multimap const&) = delete;
static_multimap(static_multimap const&) = delete;
static_multimap& operator=(static_multimap const&) = delete;

static_multimap(static_multimap&&) = default; ///< Move constructor
Expand Down
2 changes: 1 addition & 1 deletion include/cuco/static_set.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class static_set {
storage_ref_type,
Operators...>; ///< Non-owning container ref type

static_set(static_set const&) = delete;
static_set(static_set const&) = delete;
static_set& operator=(static_set const&) = delete;

static_set(static_set&&) = default; ///< Move constructor
Expand Down
3 changes: 1 addition & 2 deletions include/cuco/utility/key_generator.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ namespace distribution {
/**
* @brief Tag struct representing a random distribution of unique keys.
*/
struct unique {
};
struct unique {};

/**
* @brief Tag struct representing a uniform distribution.
Expand Down
15 changes: 6 additions & 9 deletions include/cuco/utility/traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ namespace cuco {
*
*/
template <typename T, typename = void>
struct is_bitwise_comparable : std::false_type {
};
struct is_bitwise_comparable : std::false_type {};

/// By default, only types with unique object representations are allowed
template <typename T>
struct is_bitwise_comparable<T, std::enable_if_t<std::has_unique_object_representations_v<T>>>
: std::true_type {
};
: std::true_type {};

template <typename T>
inline constexpr bool is_bitwise_comparable_v = is_bitwise_comparable<T>::value;
Expand All @@ -54,11 +52,10 @@ inline constexpr bool is_bitwise_comparable_v = is_bitwise_comparable<T>::value;
* @brief Declares that a type `Type` is bitwise comparable.
*
*/
#define CUCO_DECLARE_BITWISE_COMPARABLE(Type) \
namespace cuco { \
template <> \
struct is_bitwise_comparable<Type> : std::true_type { \
}; \
#define CUCO_DECLARE_BITWISE_COMPARABLE(Type) \
namespace cuco { \
template <> \
struct is_bitwise_comparable<Type> : std::true_type {}; \
}

template <bool value, typename... Args>
Expand Down
Loading