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

Update clang-format to 16.0.1. #1246

Merged
merged 2 commits into from
Apr 14, 2023
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ repos:
hooks:
- id: cython-lint
- 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
2 changes: 1 addition & 1 deletion benchmarks/random_allocations/random_allocations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void random_allocation_free(rmm::mr::device_memory_resource& mr,
{
std::default_random_engine generator;

max_usage *= size_mb; // convert to bytes
max_usage *= size_mb; // convert to bytes

constexpr int allocation_probability{73}; // percent
constexpr int max_op_chance{99};
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/replay/replay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ struct replay_benchmark {
{
}

~replay_benchmark() = default;
replay_benchmark(replay_benchmark const&) = delete;
replay_benchmark& operator=(replay_benchmark const&) = delete;
~replay_benchmark() = default;
replay_benchmark(replay_benchmark const&) = delete;
replay_benchmark& operator=(replay_benchmark const&) = delete;
replay_benchmark& operator=(replay_benchmark&& other) noexcept = delete;

/// Add an allocation to the map (NOT thread safe)
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/synchronization/synchronization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ class cuda_event_timer {
~cuda_event_timer();

// disable copy and move
cuda_event_timer(cuda_event_timer const&) = delete;
cuda_event_timer(cuda_event_timer const&) = delete;
cuda_event_timer& operator=(cuda_event_timer const&) = delete;
cuda_event_timer(cuda_event_timer&&) = delete;
cuda_event_timer& operator=(cuda_event_timer&&) = delete;
cuda_event_timer& operator=(cuda_event_timer&&) = delete;

private:
cudaEvent_t start{};
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/utilities/log_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ enum class action { ALLOCATE, FREE, ALLOCATE_FAILURE };
*
*/
struct event {
event() = default;
event(event const&) = default;
event& operator=(event const&) = default;
event(event&&) noexcept = default;
event() = default;
event(event const&) = default;
event& operator=(event const&) = default;
event(event&&) noexcept = default;
event& operator=(event&&) noexcept = default;
~event() = default;
event(action act, std::size_t size, void const* ptr)
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/utilities/simulated_memory_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ class simulated_memory_resource final : public device_memory_resource {
~simulated_memory_resource() override = default;

// Disable copy (and move) semantics.
simulated_memory_resource(simulated_memory_resource const&) = delete;
simulated_memory_resource(simulated_memory_resource const&) = delete;
simulated_memory_resource& operator=(simulated_memory_resource const&) = delete;
simulated_memory_resource(simulated_memory_resource&&) = delete;
simulated_memory_resource& operator=(simulated_memory_resource&&) = delete;
simulated_memory_resource& operator=(simulated_memory_resource&&) = delete;

/**
* @brief Query whether the resource supports use of non-null CUDA streams for
Expand Down
2 changes: 1 addition & 1 deletion include/rmm/cuda_stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class cuda_stream {
cuda_stream& operator=(cuda_stream&&) = default;
~cuda_stream() = default;
cuda_stream(cuda_stream const&) = delete; // Copying disallowed: one stream one owner
cuda_stream& operator=(cuda_stream&) = delete;
cuda_stream& operator=(cuda_stream&) = delete;

/**
* @brief Construct a new cuda stream object
Expand Down
6 changes: 3 additions & 3 deletions include/rmm/cuda_stream_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class cuda_stream_pool {
}
~cuda_stream_pool() = default;

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

/**
Expand Down
10 changes: 5 additions & 5 deletions include/rmm/cuda_stream_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ namespace rmm {
*/
class cuda_stream_view {
public:
constexpr cuda_stream_view() = default;
constexpr cuda_stream_view(cuda_stream_view const&) = default;
constexpr cuda_stream_view(cuda_stream_view&&) = default;
constexpr cuda_stream_view() = default;
constexpr cuda_stream_view(cuda_stream_view const&) = default;
constexpr cuda_stream_view(cuda_stream_view&&) = default;
constexpr cuda_stream_view& operator=(cuda_stream_view const&) = default;
constexpr cuda_stream_view& operator=(cuda_stream_view&&) = default;
~cuda_stream_view() = default;
constexpr cuda_stream_view& operator=(cuda_stream_view&&) = default;
~cuda_stream_view() = default;

// Disable construction from literal 0
constexpr cuda_stream_view(int) = delete; //< Prevent cast from 0
Expand Down
10 changes: 5 additions & 5 deletions include/rmm/device_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class device_buffer {
public:
// The copy constructor and copy assignment operator without a stream are deleted because they
// provide no way to specify an explicit stream
device_buffer(device_buffer const& other) = delete;
device_buffer(device_buffer const& other) = delete;
device_buffer& operator=(device_buffer const& other) = delete;

/**
Expand Down Expand Up @@ -394,10 +394,10 @@ class device_buffer {
[[nodiscard]] mr::device_memory_resource* memory_resource() const noexcept { return _mr; }

private:
void* _data{nullptr}; ///< Pointer to device memory allocation
std::size_t _size{}; ///< Requested size of the device memory allocation
std::size_t _capacity{}; ///< The actual size of the device memory allocation
cuda_stream_view _stream{}; ///< Stream to use for device memory deallocation
void* _data{nullptr}; ///< Pointer to device memory allocation
std::size_t _size{}; ///< Requested size of the device memory allocation
std::size_t _capacity{}; ///< The actual size of the device memory allocation
cuda_stream_view _stream{}; ///< Stream to use for device memory deallocation
mr::device_memory_resource* _mr{
mr::get_current_device_resource()}; ///< The memory resource used to
///< allocate/deallocate device memory
Expand Down
3 changes: 1 addition & 2 deletions include/rmm/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,4 @@ inline spdlog::logger& logger()
} // namespace rmm

template <>
struct fmt::formatter<rmm::detail::bytes> : fmt::ostream_formatter {
};
struct fmt::formatter<rmm::detail::bytes> : fmt::ostream_formatter {};
10 changes: 5 additions & 5 deletions include/rmm/mr/device/aligned_resource_adaptor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ class aligned_resource_adaptor final : public device_memory_resource {
"Allocation alignment is not a power of 2.");
}

aligned_resource_adaptor() = delete;
~aligned_resource_adaptor() override = default;
aligned_resource_adaptor(aligned_resource_adaptor const&) = delete;
aligned_resource_adaptor(aligned_resource_adaptor&&) = delete;
aligned_resource_adaptor() = delete;
~aligned_resource_adaptor() override = default;
aligned_resource_adaptor(aligned_resource_adaptor const&) = delete;
aligned_resource_adaptor(aligned_resource_adaptor&&) = delete;
aligned_resource_adaptor& operator=(aligned_resource_adaptor const&) = delete;
aligned_resource_adaptor& operator=(aligned_resource_adaptor&&) = delete;
aligned_resource_adaptor& operator=(aligned_resource_adaptor&&) = delete;

/**
* @brief Get the upstream memory resource.
Expand Down
6 changes: 3 additions & 3 deletions include/rmm/mr/device/arena_memory_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ class arena_memory_resource final : public device_memory_resource {
~arena_memory_resource() override = default;

// Disable copy (and move) semantics.
arena_memory_resource(arena_memory_resource const&) = delete;
arena_memory_resource& operator=(arena_memory_resource const&) = delete;
arena_memory_resource(arena_memory_resource&&) noexcept = delete;
arena_memory_resource(arena_memory_resource const&) = delete;
arena_memory_resource& operator=(arena_memory_resource const&) = delete;
arena_memory_resource(arena_memory_resource&&) noexcept = delete;
arena_memory_resource& operator=(arena_memory_resource&&) noexcept = delete;

/**
Expand Down
8 changes: 4 additions & 4 deletions include/rmm/mr/device/binning_memory_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ class binning_memory_resource final : public device_memory_resource {
*/
~binning_memory_resource() override = default;

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

/**
* @brief Query whether the resource supports use of non-null streams for
Expand Down
10 changes: 5 additions & 5 deletions include/rmm/mr/device/callback_memory_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ class callback_memory_resource final : public device_memory_resource {
{
}

callback_memory_resource() = delete;
~callback_memory_resource() override = default;
callback_memory_resource(callback_memory_resource const&) = delete;
callback_memory_resource& operator=(callback_memory_resource const&) = delete;
callback_memory_resource(callback_memory_resource&&) noexcept = default;
callback_memory_resource() = delete;
~callback_memory_resource() override = default;
callback_memory_resource(callback_memory_resource const&) = delete;
callback_memory_resource& operator=(callback_memory_resource const&) = delete;
callback_memory_resource(callback_memory_resource&&) noexcept = default;
callback_memory_resource& operator=(callback_memory_resource&&) noexcept = default;

private:
Expand Down
6 changes: 3 additions & 3 deletions include/rmm/mr/device/cuda_async_memory_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ class cuda_async_memory_resource final : public device_memory_resource {
RMM_ASSERT_CUDA_SUCCESS(rmm::detail::async_alloc::cudaMemPoolDestroy(pool_handle()));
#endif
}
cuda_async_memory_resource(cuda_async_memory_resource const&) = delete;
cuda_async_memory_resource(cuda_async_memory_resource&&) = delete;
cuda_async_memory_resource(cuda_async_memory_resource const&) = delete;
cuda_async_memory_resource(cuda_async_memory_resource&&) = delete;
cuda_async_memory_resource& operator=(cuda_async_memory_resource const&) = delete;
cuda_async_memory_resource& operator=(cuda_async_memory_resource&&) = delete;
cuda_async_memory_resource& operator=(cuda_async_memory_resource&&) = delete;

/**
* @brief Query whether the resource supports use of non-null CUDA streams for
Expand Down
8 changes: 4 additions & 4 deletions include/rmm/mr/device/cuda_async_view_memory_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ class cuda_async_view_memory_resource final : public device_memory_resource {
[[nodiscard]] cudaMemPool_t pool_handle() const noexcept { return cuda_pool_handle_; }
#endif

cuda_async_view_memory_resource() = default;
cuda_async_view_memory_resource(cuda_async_view_memory_resource const&) = default;
cuda_async_view_memory_resource(cuda_async_view_memory_resource&&) = default;
cuda_async_view_memory_resource() = default;
cuda_async_view_memory_resource(cuda_async_view_memory_resource const&) = default;
cuda_async_view_memory_resource(cuda_async_view_memory_resource&&) = default;
cuda_async_view_memory_resource& operator=(cuda_async_view_memory_resource const&) = default;
cuda_async_view_memory_resource& operator=(cuda_async_view_memory_resource&&) = default;
cuda_async_view_memory_resource& operator=(cuda_async_view_memory_resource&&) = default;

/**
* @brief Query whether the resource supports use of non-null CUDA streams for
Expand Down
10 changes: 5 additions & 5 deletions include/rmm/mr/device/cuda_memory_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ namespace rmm::mr {
*/
class cuda_memory_resource final : public device_memory_resource {
public:
cuda_memory_resource() = default;
~cuda_memory_resource() override = default;
cuda_memory_resource(cuda_memory_resource const&) = default;
cuda_memory_resource(cuda_memory_resource&&) = default;
cuda_memory_resource() = default;
~cuda_memory_resource() override = default;
cuda_memory_resource(cuda_memory_resource const&) = default;
cuda_memory_resource(cuda_memory_resource&&) = default;
cuda_memory_resource& operator=(cuda_memory_resource const&) = default;
cuda_memory_resource& operator=(cuda_memory_resource&&) = default;
cuda_memory_resource& operator=(cuda_memory_resource&&) = default;

/**
* @brief Query whether the resource supports use of non-null CUDA streams for
Expand Down
20 changes: 10 additions & 10 deletions include/rmm/mr/device/detail/arena.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ class superblock final : public byte_span {
}

// Disable copy semantics.
superblock(superblock const&) = delete;
superblock(superblock const&) = delete;
superblock& operator=(superblock const&) = delete;
// Allow move semantics.
superblock(superblock&&) noexcept = default;
superblock(superblock&&) noexcept = default;
superblock& operator=(superblock&&) noexcept = default;

~superblock() = default;
Expand Down Expand Up @@ -515,9 +515,9 @@ class global_arena final {
}

// Disable copy (and move) semantics.
global_arena(global_arena const&) = delete;
global_arena& operator=(global_arena const&) = delete;
global_arena(global_arena&&) noexcept = delete;
global_arena(global_arena const&) = delete;
global_arena& operator=(global_arena const&) = delete;
global_arena(global_arena&&) noexcept = delete;
global_arena& operator=(global_arena&&) noexcept = delete;

/**
Expand Down Expand Up @@ -803,9 +803,9 @@ class arena {
explicit arena(global_arena<Upstream>& global_arena) : global_arena_{global_arena} {}

// Disable copy (and move) semantics.
arena(arena const&) = delete;
arena& operator=(arena const&) = delete;
arena(arena&&) noexcept = delete;
arena(arena const&) = delete;
arena& operator=(arena const&) = delete;
arena(arena&&) noexcept = delete;
arena& operator=(arena&&) noexcept = delete;

~arena() = default;
Expand Down Expand Up @@ -979,10 +979,10 @@ class arena_cleaner {
explicit arena_cleaner(std::shared_ptr<arena<Upstream>> const& arena) : arena_(arena) {}

// Disable copy (and move) semantics.
arena_cleaner(arena_cleaner const&) = delete;
arena_cleaner(arena_cleaner const&) = delete;
arena_cleaner& operator=(arena_cleaner const&) = delete;
arena_cleaner(arena_cleaner&&) noexcept = delete;
arena_cleaner& operator=(arena_cleaner&&) = delete;
arena_cleaner& operator=(arena_cleaner&&) = delete;

~arena_cleaner()
{
Expand Down
4 changes: 2 additions & 2 deletions include/rmm/mr/device/detail/coalescing_free_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ struct coalescing_free_list : free_list<block> {
coalescing_free_list() = default;
~coalescing_free_list() override = default;

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

/**
* @brief Inserts a block into the `free_list` in the correct order, coalescing it with the
Expand Down
4 changes: 2 additions & 2 deletions include/rmm/mr/device/detail/fixed_size_free_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ struct fixed_size_free_list : free_list<block_base> {
fixed_size_free_list() = default;
~fixed_size_free_list() override = default;

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

/**
* @brief Construct a new free_list from range defined by input iterators
Expand Down
4 changes: 2 additions & 2 deletions include/rmm/mr/device/detail/free_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ class free_list {
free_list() = default;
virtual ~free_list() = default;

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

using block_type = BlockType;
using list_type = ListType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ class stream_ordered_memory_resource : public crtp<PoolResource>, public device_
public:
~stream_ordered_memory_resource() override { release(); }

stream_ordered_memory_resource() = default;
stream_ordered_memory_resource(stream_ordered_memory_resource const&) = delete;
stream_ordered_memory_resource(stream_ordered_memory_resource&&) = delete;
stream_ordered_memory_resource() = default;
stream_ordered_memory_resource(stream_ordered_memory_resource const&) = delete;
stream_ordered_memory_resource(stream_ordered_memory_resource&&) = delete;
stream_ordered_memory_resource& operator=(stream_ordered_memory_resource const&) = delete;
stream_ordered_memory_resource& operator=(stream_ordered_memory_resource&&) = delete;
stream_ordered_memory_resource& operator=(stream_ordered_memory_resource&&) = delete;

protected:
using free_list = FreeListType;
Expand Down Expand Up @@ -269,10 +269,10 @@ class stream_ordered_memory_resource : public crtp<PoolResource>, public device_
~event_wrapper() { RMM_ASSERT_CUDA_SUCCESS(cudaEventDestroy(event)); }
cudaEvent_t event{};

event_wrapper(event_wrapper const&) = delete;
event_wrapper(event_wrapper const&) = delete;
event_wrapper& operator=(event_wrapper const&) = delete;
event_wrapper(event_wrapper&&) noexcept = delete;
event_wrapper& operator=(event_wrapper&&) = delete;
event_wrapper& operator=(event_wrapper&&) = delete;
};

/**
Expand Down
10 changes: 5 additions & 5 deletions include/rmm/mr/device/device_memory_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ namespace rmm::mr {
*/
class device_memory_resource {
public:
device_memory_resource() = default;
virtual ~device_memory_resource() = default;
device_memory_resource(device_memory_resource const&) = default;
device_memory_resource& operator=(device_memory_resource const&) = default;
device_memory_resource(device_memory_resource&&) noexcept = default;
device_memory_resource() = default;
virtual ~device_memory_resource() = default;
device_memory_resource(device_memory_resource const&) = default;
device_memory_resource& operator=(device_memory_resource const&) = default;
device_memory_resource(device_memory_resource&&) noexcept = default;
device_memory_resource& operator=(device_memory_resource&&) noexcept = default;

/**
Expand Down
Loading