Skip to content

Commit

Permalink
Update clang-format to 16.0.1. (#1412)
Browse files Browse the repository at this point in the history
This PR updates the clang-format version used by pre-commit.

Authors:
  - Bradley Dice (https://github.com/bdice)
  - Jordan Jacobelli (https://github.com/jjacobelli)

Approvers:
  - Ray Douglass (https://github.com/raydouglass)
  - Corey J. Nolet (https://github.com/cjnolet)
  - Ben Frederickson (https://github.com/benfred)

URL: #1412
  • Loading branch information
bdice authored Apr 25, 2023
1 parent c0c4d52 commit 83c326e
Show file tree
Hide file tree
Showing 170 changed files with 636 additions and 853 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ repos:
additional_dependencies: [toml]
args: ["--config=pyproject.toml"]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v11.1.0
rev: v16.0.1
hooks:
- id: clang-format
types_or: [c, c++, cuda]
Expand Down
4 changes: 2 additions & 2 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ channels:
dependencies:
- breathe
- c-compiler
- clang-tools=11.1.0
- clang=11.1.0
- clang-tools=16.0.1
- clang=16.0.1
- cmake>=3.23.1,!=3.25.0
- cuda-profiler-api=11.8.86
- cuda-python >=11.7.1,<12.0
Expand Down
4 changes: 2 additions & 2 deletions conda/environments/bench_ann_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ channels:
- nvidia
dependencies:
- c-compiler
- clang-tools=11.1.0
- clang=11.1.0
- clang-tools=16.0.1
- clang=16.0.1
- cmake>=3.23.1,!=3.25.0
- cuda-profiler-api=11.8.86
- cudatoolkit=11.8
Expand Down
4 changes: 2 additions & 2 deletions cpp/bench/ann/src/common/dataset.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class BinFile {
uint32_t subset_first_row = 0,
uint32_t subset_size = 0);
~BinFile() { fclose(fp_); }
BinFile(const BinFile&) = delete;
BinFile(const BinFile&) = delete;
BinFile& operator=(const BinFile&) = delete;

void get_shape(size_t* nrows, int* ndims)
Expand Down Expand Up @@ -219,7 +219,7 @@ class Dataset {
Dataset(const std::string& name, const std::string& distance) : name_(name), distance_(distance)
{
}
Dataset(const Dataset&) = delete;
Dataset(const Dataset&) = delete;
Dataset& operator=(const Dataset&) = delete;
virtual ~Dataset();

Expand Down
41 changes: 20 additions & 21 deletions cpp/bench/prims/matrix/select_k.cu
Original file line number Diff line number Diff line change
Expand Up @@ -157,34 +157,33 @@ const std::vector<select::params> kInputs{
{10, 1000000, 256, true, false, true},
};

#define SELECTION_REGISTER(KeyT, IdxT, A) \
namespace BENCHMARK_PRIVATE_NAME(selection) \
{ \
using SelectK = selection<KeyT, IdxT, select::Algo::A>; \
RAFT_BENCH_REGISTER(SelectK, #KeyT "/" #IdxT "/" #A, kInputs); \
#define SELECTION_REGISTER(KeyT, IdxT, A) \
namespace BENCHMARK_PRIVATE_NAME(selection) { \
using SelectK = selection<KeyT, IdxT, select::Algo::A>; \
RAFT_BENCH_REGISTER(SelectK, #KeyT "/" #IdxT "/" #A, kInputs); \
}

SELECTION_REGISTER(float, uint32_t, kPublicApi); // NOLINT
SELECTION_REGISTER(float, uint32_t, kRadix8bits); // NOLINT
SELECTION_REGISTER(float, uint32_t, kRadix11bits); // NOLINT
SELECTION_REGISTER(float, uint32_t, kRadix11bitsExtraPass); // NOLINT
SELECTION_REGISTER(float, uint32_t, kWarpAuto); // NOLINT
SELECTION_REGISTER(float, uint32_t, kWarpImmediate); // NOLINT
SELECTION_REGISTER(float, uint32_t, kWarpFiltered); // NOLINT
SELECTION_REGISTER(float, uint32_t, kWarpDistributed); // NOLINT
SELECTION_REGISTER(float, uint32_t, kWarpDistributedShm); // NOLINT
SELECTION_REGISTER(float, uint32_t, kPublicApi); // NOLINT
SELECTION_REGISTER(float, uint32_t, kRadix8bits); // NOLINT
SELECTION_REGISTER(float, uint32_t, kRadix11bits); // NOLINT
SELECTION_REGISTER(float, uint32_t, kRadix11bitsExtraPass); // NOLINT
SELECTION_REGISTER(float, uint32_t, kWarpAuto); // NOLINT
SELECTION_REGISTER(float, uint32_t, kWarpImmediate); // NOLINT
SELECTION_REGISTER(float, uint32_t, kWarpFiltered); // NOLINT
SELECTION_REGISTER(float, uint32_t, kWarpDistributed); // NOLINT
SELECTION_REGISTER(float, uint32_t, kWarpDistributedShm); // NOLINT

SELECTION_REGISTER(double, uint32_t, kRadix8bits); // NOLINT
SELECTION_REGISTER(double, uint32_t, kRadix11bits); // NOLINT
SELECTION_REGISTER(double, uint32_t, kRadix11bitsExtraPass); // NOLINT
SELECTION_REGISTER(double, uint32_t, kWarpAuto); // NOLINT

SELECTION_REGISTER(double, int64_t, kRadix8bits); // NOLINT
SELECTION_REGISTER(double, int64_t, kRadix11bits); // NOLINT
SELECTION_REGISTER(double, int64_t, kRadix11bitsExtraPass); // NOLINT
SELECTION_REGISTER(double, int64_t, kWarpImmediate); // NOLINT
SELECTION_REGISTER(double, int64_t, kWarpFiltered); // NOLINT
SELECTION_REGISTER(double, int64_t, kWarpDistributed); // NOLINT
SELECTION_REGISTER(double, int64_t, kWarpDistributedShm); // NOLINT
SELECTION_REGISTER(double, int64_t, kRadix8bits); // NOLINT
SELECTION_REGISTER(double, int64_t, kRadix11bits); // NOLINT
SELECTION_REGISTER(double, int64_t, kRadix11bitsExtraPass); // NOLINT
SELECTION_REGISTER(double, int64_t, kWarpImmediate); // NOLINT
SELECTION_REGISTER(double, int64_t, kWarpFiltered); // NOLINT
SELECTION_REGISTER(double, int64_t, kWarpDistributed); // NOLINT
SELECTION_REGISTER(double, int64_t, kWarpDistributedShm); // NOLINT

} // namespace raft::matrix
9 changes: 4 additions & 5 deletions cpp/bench/prims/neighbors/knn.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,10 @@ inline const std::vector<TransferStrategy> kNoCopyOnly{TransferStrategy::NO_COPY
inline const std::vector<Scope> kScopeFull{Scope::BUILD_SEARCH};
inline const std::vector<Scope> kAllScopes{Scope::BUILD_SEARCH, Scope::SEARCH, Scope::BUILD};

#define KNN_REGISTER(ValT, IdxT, ImplT, inputs, strats, scope) \
namespace BENCHMARK_PRIVATE_NAME(knn) \
{ \
using KNN = knn<ValT, IdxT, ImplT<ValT, IdxT>>; \
RAFT_BENCH_REGISTER(KNN, #ValT "/" #IdxT "/" #ImplT, inputs, strats, scope); \
#define KNN_REGISTER(ValT, IdxT, ImplT, inputs, strats, scope) \
namespace BENCHMARK_PRIVATE_NAME(knn) { \
using KNN = knn<ValT, IdxT, ImplT<ValT, IdxT>>; \
RAFT_BENCH_REGISTER(KNN, #ValT "/" #IdxT "/" #ImplT, inputs, strats, scope); \
}

} // namespace raft::bench::spatial
2 changes: 1 addition & 1 deletion cpp/include/raft/cluster/detail/kmeans_balanced.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ __global__ void __launch_bounds__((WarpSize * BlockDimY))
adjust_centers_kernel(MathT* centers, // [n_clusters, dim]
IdxT n_clusters,
IdxT dim,
const T* dataset, // [n_rows, dim]
const T* dataset, // [n_rows, dim]
IdxT n_rows,
const LabelT* labels, // [n_rows]
const CounterT* cluster_sizes, // [n_clusters]
Expand Down
8 changes: 3 additions & 5 deletions cpp/include/raft/cluster/single_linkage_types.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022, NVIDIA CORPORATION.
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -77,9 +77,7 @@ class linkage_output {
}
};

class linkage_output_int : public linkage_output<int> {
};
class linkage_output_int64 : public linkage_output<int64_t> {
};
class linkage_output_int : public linkage_output<int> {};
class linkage_output_int64 : public linkage_output<int64_t> {};

}; // namespace raft::cluster
8 changes: 4 additions & 4 deletions cpp/include/raft/common/cub_wrappers.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, NVIDIA CORPORATION.
* Copyright (c) 2022-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,9 +24,9 @@

#pragma once

#pragma message(__FILE__ \
" is deprecated and will be removed in a future release." \
" Please note that there is no equivalent in RAFT's public API"
#pragma message(__FILE__ \
" is deprecated and will be removed in a future release." \
" Please note that there is no equivalent in RAFT's public API"
" so this file will eventually be removed altogether.")

#include <raft/util/detail/cub_wrappers.cuh>
8 changes: 4 additions & 4 deletions cpp/include/raft/common/device_loads_stores.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2022, NVIDIA CORPORATION.
* Copyright (c) 2020-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,8 +24,8 @@

#pragma once

#pragma message(__FILE__ \
" is deprecated and will be removed in a future release." \
" Please use the raft/util version instead.")
#pragma message(__FILE__ \
" is deprecated and will be removed in a future release." \
" Please use the raft/util version instead.")

#include <raft/util/device_loads_stores.cuh>
8 changes: 4 additions & 4 deletions cpp/include/raft/common/scatter.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2022, NVIDIA CORPORATION.
* Copyright (c) 2020-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,8 +24,8 @@

#pragma once

#pragma message(__FILE__ \
" is deprecated and will be removed in a future release." \
" Please use the raft/matrix version instead.")
#pragma message(__FILE__ \
" is deprecated and will be removed in a future release." \
" Please use the raft/matrix version instead.")

#include <raft/util/scatter.cuh>
8 changes: 4 additions & 4 deletions cpp/include/raft/common/seive.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2022, NVIDIA CORPORATION.
* Copyright (c) 2020-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,8 +24,8 @@

#pragma once

#pragma message(__FILE__ \
" is deprecated and will be removed in a future release." \
" Please use the raft/util version instead.")
#pragma message(__FILE__ \
" is deprecated and will be removed in a future release." \
" Please use the raft/util version instead.")

#include <raft/util/seive.hpp>
2 changes: 1 addition & 1 deletion cpp/include/raft/core/csr_matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class compressed_structure
constexpr auto operator=(compressed_structure const&) noexcept(
std::is_nothrow_copy_assignable<indptr_container_type>::value)
-> compressed_structure& = default;
constexpr auto operator =(compressed_structure&&) noexcept(
constexpr auto operator=(compressed_structure&&) noexcept(
std::is_nothrow_move_assignable<indptr_container_type>::value)
-> compressed_structure& = default;

Expand Down
4 changes: 2 additions & 2 deletions cpp/include/raft/core/cublas_macros.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, NVIDIA CORPORATION.
* Copyright (c) 2022-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,7 @@
#include <raft/core/error.hpp>

///@todo: enable this once we have logger enabled
//#include <cuml/common/logger.hpp>
// #include <cuml/common/logger.hpp>

#include <cstdint>

Expand Down
4 changes: 2 additions & 2 deletions cpp/include/raft/core/cusolver_macros.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, NVIDIA CORPORATION.
* Copyright (c) 2022-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,7 @@
#include <cusolverDn.h>
#include <cusolverSp.h>
///@todo: enable this once logging is enabled
//#include <cuml/common/logger.hpp>
// #include <cuml/common/logger.hpp>
#include <raft/util/cudart_utils.hpp>
#include <type_traits>

Expand Down
4 changes: 2 additions & 2 deletions cpp/include/raft/core/cusparse_macros.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2022, NVIDIA CORPORATION.
* Copyright (c) 2019-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,7 +19,7 @@
#include <cusparse.h>
#include <raft/core/error.hpp>
///@todo: enable this once logging is enabled
//#include <cuml/common/logger.hpp>
// #include <cuml/common/logger.hpp>

#define _CUSPARSE_ERR_TO_STR(err) \
case err: return #err;
Expand Down
8 changes: 4 additions & 4 deletions cpp/include/raft/core/detail/logger.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, NVIDIA CORPORATION.
* Copyright (c) 2022-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,8 +15,8 @@
*/
#pragma once

#pragma message(__FILE__ \
" is deprecated and will be removed in future releases." \
" Please use the <raft/core/logger.hpp> version instead.")
#pragma message(__FILE__ \
" is deprecated and will be removed in future releases." \
" Please use the <raft/core/logger.hpp> version instead.")

#include <raft/core/logger.hpp>
8 changes: 3 additions & 5 deletions cpp/include/raft/core/detail/mdspan_numpy_serializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace numpy_serializer {

#if RAFT_SYSTEM_LITTLE_ENDIAN == 1
#define RAFT_NUMPY_HOST_ENDIAN_CHAR RAFT_NUMPY_LITTLE_ENDIAN_CHAR
#else // RAFT_SYSTEM_LITTLE_ENDIAN == 1
#else // RAFT_SYSTEM_LITTLE_ENDIAN == 1
#define RAFT_NUMPY_HOST_ENDIAN_CHAR RAFT_NUMPY_BIG_ENDIAN_CHAR
#endif // RAFT_SYSTEM_LITTLE_ENDIAN == 1

Expand Down Expand Up @@ -110,11 +110,9 @@ struct header_t {
};

template <class T>
struct is_complex : std::false_type {
};
struct is_complex : std::false_type {};
template <class T>
struct is_complex<std::complex<T>> : std::true_type {
};
struct is_complex<std::complex<T>> : std::true_type {};

template <typename T, typename std::enable_if_t<std::is_floating_point_v<T>, bool> = true>
inline dtype_t get_numpy_dtype()
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/raft/core/detail/nvtx.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022, NVIDIA CORPORATION.
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -191,7 +191,7 @@ inline void pop_range()
nvtxDomainRangePop(domain_store<Domain>::value());
}

#else // NVTX_ENABLED
#else // NVTX_ENABLED

template <typename Domain, typename... Args>
inline void push_range(const char* format, Args... args)
Expand Down
23 changes: 8 additions & 15 deletions cpp/include/raft/core/detail/span.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, NVIDIA CORPORATION.
* Copyright (c) 2022-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -37,8 +37,7 @@ template <std::size_t Extent, std::size_t Offset, std::size_t Count>
struct extent_value_t
: public std::integral_constant<
std::size_t,
Count != dynamic_extent ? Count : (Extent != dynamic_extent ? Extent - Offset : Extent)> {
};
Count != dynamic_extent ? Count : (Extent != dynamic_extent ? Extent - Offset : Extent)> {};

/*!
* If N is dynamic_extent, the extent of the returned span E is also
Expand All @@ -47,31 +46,25 @@ struct extent_value_t
template <typename T, std::size_t Extent>
struct extent_as_bytes_value_t
: public std::integral_constant<std::size_t,
Extent == dynamic_extent ? Extent : sizeof(T) * Extent> {
};
Extent == dynamic_extent ? Extent : sizeof(T) * Extent> {};

template <std::size_t From, std::size_t To>
struct is_allowed_extent_conversion_t
: public std::integral_constant<bool,
From == To || From == dynamic_extent || To == dynamic_extent> {
};
From == To || From == dynamic_extent || To == dynamic_extent> {};

template <class From, class To>
struct is_allowed_element_type_conversion_t
: public std::integral_constant<bool, std::is_convertible<From (*)[], To (*)[]>::value> {
};
: public std::integral_constant<bool, std::is_convertible<From (*)[], To (*)[]>::value> {};

template <class T>
struct is_span_oracle_t : std::false_type {
};
struct is_span_oracle_t : std::false_type {};

template <class T, bool is_device, std::size_t Extent>
struct is_span_oracle_t<span<T, is_device, Extent>> : std::true_type {
};
struct is_span_oracle_t<span<T, is_device, Extent>> : std::true_type {};

template <class T>
struct is_span_t : public is_span_oracle_t<typename std::remove_cv<T>::type> {
};
struct is_span_t : public is_span_oracle_t<typename std::remove_cv<T>::type> {};

template <class InputIt1, class InputIt2, class Compare>
_RAFT_HOST_DEVICE constexpr auto lexicographical_compare(InputIt1 first1,
Expand Down
Loading

0 comments on commit 83c326e

Please sign in to comment.