Skip to content

Commit

Permalink
Update to clang 16.0.6. (#1343)
Browse files Browse the repository at this point in the history
This PR updates rmm to use clang 16.0.6. The previous version 16.0.1 has some minor formatting issues affecting several RAPIDS repos.

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

Approvers:
  - Mark Harris (https://github.com/harrism)

URL: #1343
  • Loading branch information
bdice authored Sep 19, 2023
1 parent 068f705 commit 144a0ba
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
hooks:
- id: cython-lint
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.1
rev: v16.0.6
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
8 changes: 4 additions & 4 deletions include/rmm/device_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,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
2 changes: 1 addition & 1 deletion include/rmm/exec_policy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ using thrust_exec_policy_nosync_t =
thrust_exec_policy_t; ///< When used with Thrust < 1.16.0, thrust_exec_policy_nosync_t is an
///< alias for thrust_exec_policy_t
using exec_policy_nosync =
exec_policy; ///< When used with Thrust < 1.16.0, exec_policy_nosync is an alias for exec_policy
exec_policy; ///< When used with Thrust < 1.16.0, exec_policy_nosync is an alias for exec_policy
#endif

} // namespace rmm
2 changes: 1 addition & 1 deletion include/rmm/mr/device/device_memory_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class device_memory_resource {
virtual ~device_memory_resource() = default;
device_memory_resource(device_memory_resource const&) = default; ///< @default_copy_constructor
device_memory_resource(device_memory_resource&&) noexcept =
default; ///< @default_move_constructor
default; ///< @default_move_constructor
device_memory_resource& operator=(device_memory_resource const&) =
default; ///< @default_copy_assignment{device_memory_resource}
device_memory_resource& operator=(device_memory_resource&&) noexcept =
Expand Down
2 changes: 1 addition & 1 deletion include/rmm/mr/device/fixed_size_memory_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class fixed_size_memory_resource
}

private:
Upstream* upstream_mr_; // The resource from which to allocate new blocks
Upstream* upstream_mr_; // The resource from which to allocate new blocks

std::size_t const block_size_; // size of blocks this MR allocates
std::size_t const upstream_chunk_size_; // size of chunks allocated from heap MR
Expand Down
4 changes: 2 additions & 2 deletions include/rmm/mr/device/logging_resource_adaptor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ class logging_resource_adaptor final : public device_memory_resource {

std::shared_ptr<spdlog::logger> logger_; ///< spdlog logger object

Upstream* upstream_; ///< The upstream resource used for satisfying
///< allocation requests
Upstream* upstream_; ///< The upstream resource used for satisfying
///< allocation requests
};

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/mr/device/arena_mr_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ TEST_F(ArenaTest, SizeSmallerThanSuperblockSize) // NOLINT

TEST_F(ArenaTest, AllocateNinetyPercent) // NOLINT
{
EXPECT_NO_THROW([]() { // NOLINT(cppcoreguidelines-avoid-goto)
EXPECT_NO_THROW([]() { // NOLINT(cppcoreguidelines-avoid-goto)
auto const free = rmm::detail::available_device_memory().first;
auto const ninety_percent =
rmm::detail::align_up(static_cast<std::size_t>(static_cast<double>(free) * 0.9),
Expand All @@ -497,7 +497,7 @@ TEST_F(ArenaTest, AllocateNinetyPercent) // NOLINT

TEST_F(ArenaTest, SmallMediumLarge) // NOLINT
{
EXPECT_NO_THROW([]() { // NOLINT(cppcoreguidelines-avoid-goto)
EXPECT_NO_THROW([]() { // NOLINT(cppcoreguidelines-avoid-goto)
arena_mr mr(rmm::mr::get_current_device_resource());
auto* small = mr.allocate(256);
auto* medium = mr.allocate(64_MiB);
Expand All @@ -511,7 +511,7 @@ TEST_F(ArenaTest, SmallMediumLarge) // NOLINT

TEST_F(ArenaTest, Defragment) // NOLINT
{
EXPECT_NO_THROW([]() { // NOLINT(cppcoreguidelines-avoid-goto)
EXPECT_NO_THROW([]() { // NOLINT(cppcoreguidelines-avoid-goto)
auto const arena_size = superblock::minimum_size * 4;
arena_mr mr(rmm::mr::get_current_device_resource(), arena_size);
std::vector<std::thread> threads;
Expand Down
2 changes: 1 addition & 1 deletion tests/mr/device/failure_callback_mr_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ bool failure_handler(std::size_t /*bytes*/, void* arg)
retried = true;
return true; // First time we request an allocation retry
}
return false; // Second time we let the adaptor throw std::bad_alloc
return false; // Second time we let the adaptor throw std::bad_alloc
}

TEST(FailureCallbackTest, RetryAllocationOnce)
Expand Down
2 changes: 1 addition & 1 deletion tests/mr/device/pool_mr_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ TEST(PoolTest, ForceGrowth)
EXPECT_NO_THROW(mr.allocate(1000));
EXPECT_THROW(mr.allocate(4000), rmm::out_of_memory); // too much
EXPECT_NO_THROW(mr.allocate(500));
EXPECT_NO_THROW(mr.allocate(2000)); // fits
EXPECT_NO_THROW(mr.allocate(2000)); // fits
}
}

Expand Down

0 comments on commit 144a0ba

Please sign in to comment.