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 15.0.7 #1072

Merged
merged 4 commits into from
Apr 19, 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 @@ -31,7 +31,7 @@ repos:
hooks:
- id: cython-lint
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v11.1.0
rev: v15.0.7
hooks:
- id: clang-format
types_or: [c, c++, cuda]
Expand Down
43 changes: 21 additions & 22 deletions cpp/include/cuspatial/detail/nvtx/nvtx3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,10 +585,10 @@ constexpr auto has_name_member() noexcept -> decltype(T::name, bool())
*/
class domain {
public:
domain(domain const&) = delete;
domain(domain const&) = delete;
domain& operator=(domain const&) = delete;
domain(domain&&) = delete;
domain& operator=(domain&&) = delete;
domain& operator=(domain&&) = delete;

/**
* @brief Returns reference to an instance of a function local static
Expand Down Expand Up @@ -663,8 +663,7 @@ class domain {
* applications will be grouped together.
*
*/
struct global {
};
struct global {};

private:
/**
Expand Down Expand Up @@ -870,12 +869,12 @@ class color {
*/
constexpr nvtxColorType_t get_type() const noexcept { return _type; }

color() = delete;
~color() = default;
color(color const&) = default;
color() = delete;
~color() = default;
color(color const&) = default;
color& operator=(color const&) = default;
color(color&&) = default;
color& operator=(color&&) = default;
color& operator=(color&&) = default;

private:
/**
Expand Down Expand Up @@ -937,12 +936,12 @@ class category {
*/
constexpr id_type get_id() const noexcept { return id_; }

category() = delete;
~category() = default;
category(category const&) = default;
category() = delete;
~category() = default;
category(category const&) = default;
category& operator=(category const&) = default;
category(category&&) = default;
category& operator=(category&&) = default;
category& operator=(category&&) = default;

private:
id_type const id_{}; ///< category's unique identifier
Expand Down Expand Up @@ -1226,12 +1225,12 @@ class registered_message {
*/
nvtxStringHandle_t get_handle() const noexcept { return handle_; }

registered_message() = delete;
~registered_message() = default;
registered_message(registered_message const&) = default;
registered_message() = delete;
~registered_message() = default;
registered_message(registered_message const&) = default;
registered_message& operator=(registered_message const&) = default;
registered_message(registered_message&&) = default;
registered_message& operator=(registered_message&&) = default;
registered_message& operator=(registered_message&&) = default;

private:
nvtxStringHandle_t const handle_{}; ///< The handle returned from
Expand Down Expand Up @@ -1612,11 +1611,11 @@ class event_attributes {
attributes_.messageType = m.get_type();
}

~event_attributes() = default;
event_attributes(event_attributes const&) = default;
~event_attributes() = default;
event_attributes(event_attributes const&) = default;
event_attributes& operator=(event_attributes const&) = default;
event_attributes(event_attributes&&) = default;
event_attributes& operator=(event_attributes&&) = default;
event_attributes& operator=(event_attributes&&) = default;

/**
* @brief Get raw pointer to underlying NVTX attributes object.
Expand Down Expand Up @@ -1741,10 +1740,10 @@ class domain_thread_range {
*/
domain_thread_range() : domain_thread_range{event_attributes{}} {}

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

/**
* @brief Destroy the domain_thread_range, ending the NVTX range event.
Expand Down Expand Up @@ -1819,7 +1818,7 @@ class domain_process_range {
if (not moved_from_) { nvtxRangeEnd(range_id_); }
}

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

domain_process_range(domain_process_range&& other) noexcept : range_id_{other.range_id_}
Expand Down
6 changes: 2 additions & 4 deletions cpp/include/cuspatial_test/base_fixture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ class RMMResourceMixin {
* class MyTestFixture : public cuspatial::test::BaseFixture {};
* ```
*/
class BaseFixture : public RMMResourceMixin, public ::testing::Test {
};
class BaseFixture : public RMMResourceMixin, public ::testing::Test {};

/**
* @brief Base test fixture class from which libcuspatial test with only value parameterization
Expand All @@ -79,8 +78,7 @@ class BaseFixture : public RMMResourceMixin, public ::testing::Test {
*/
template <typename... Ts>
class BaseFixtureWithParam : public RMMResourceMixin,
public ::testing::TestWithParam<std::tuple<Ts...>> {
};
public ::testing::TestWithParam<std::tuple<Ts...>> {};

/**
* @brief Floating point types to be used in libcuspatial tests
Expand Down
2 changes: 1 addition & 1 deletion cpp/scripts/run-clang-format.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import tempfile


EXPECTED_VERSION = "11.1.0"
EXPECTED_VERSION = "15.0.7"
VERSION_REGEX = re.compile(r"clang-format version ([0-9.]+)")
# NOTE: populate this list with more top-level dirs as we add more of them to the cuspatial repo
DEFAULT_DIRS = ["cpp/include",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
// by the quadtree_point_in_polygon_test_small.cu test file.

template <typename T>
struct JoinQuadtreeAndBoundingBoxesErrorTest : public cuspatial::test::BaseFixture {
};
struct JoinQuadtreeAndBoundingBoxesErrorTest : public cuspatial::test::BaseFixture {};

using TestTypes = ::testing::Types<float, double>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
*/

template <typename T>
struct PIPRefineTestLarge : public cuspatial::test::BaseFixture {
};
struct PIPRefineTestLarge : public cuspatial::test::BaseFixture {};

using TestTypes = ::testing::Types<float, double>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
* fully tested.
*/
template <typename T>
struct PIPRefineTestSmall : public cuspatial::test::BaseFixture {
};
struct PIPRefineTestSmall : public cuspatial::test::BaseFixture {};

using TestTypes = ::testing::Types<float, double>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
#include <type_traits>

template <typename T>
struct QuadtreePointToLinestringTestSmall : public cuspatial::test::BaseFixture {
};
struct QuadtreePointToLinestringTestSmall : public cuspatial::test::BaseFixture {};

using TestTypes = ::testing::Types<float, double>;

Expand Down
3 changes: 1 addition & 2 deletions cpp/tests/experimental/operators/linestrings_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ template <typename T>
using optional_vec2d = thrust::optional<vec_2d<T>>;

template <typename T>
struct SegmentIntersectionTest : public BaseFixture {
};
struct SegmentIntersectionTest : public BaseFixture {};

using TestTypes = ::testing::Types<float, double>;
TYPED_TEST_CASE(SegmentIntersectionTest, TestTypes);
Expand Down
3 changes: 1 addition & 2 deletions cpp/tests/experimental/spatial/haversine_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
#include <gtest/gtest.h>

template <typename T>
struct HaversineTest : public ::testing::Test {
};
struct HaversineTest : public ::testing::Test {};

// float and double are logically the same but would require separate tests due to precision.
using TestTypes = ::testing::Types<float, double>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
#include <gtest/gtest.h>

template <typename T>
struct LinestringBoundingBoxTest : public ::testing::Test {
};
struct LinestringBoundingBoxTest : public ::testing::Test {};

using cuspatial::vec_2d;
using cuspatial::test::make_device_vector;
Expand Down
6 changes: 2 additions & 4 deletions cpp/tests/experimental/spatial/linestring_distance_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ using namespace cuspatial;
using namespace cuspatial::test;

template <typename T>
struct PairwiseLinestringDistanceTest : public ::testing::Test {
};
struct PairwiseLinestringDistanceTest : public ::testing::Test {};

struct PairwiseLinestringDistanceTestUntyped : public ::testing::Test {
};
struct PairwiseLinestringDistanceTestUntyped : public ::testing::Test {};

// float and double are logically the same but would require separate tests due to precision.
using TestTypes = ::testing::Types<float, double>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ using namespace cuspatial;
using namespace cuspatial::test;

template <typename T>
struct PairwiseLinestringDistanceTestMedium : public ::testing::Test {
};
struct PairwiseLinestringDistanceTestMedium : public ::testing::Test {};

// float and double are logically the same but would require separate tests due to precision.
using TestTypes = ::testing::Types<float, double>;
Expand Down
56 changes: 27 additions & 29 deletions cpp/tests/experimental/spatial/pairwise_point_in_polygon_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ using namespace cuspatial;
using namespace cuspatial::test;

template <typename T>
struct PairwisePointInPolygonTest : public ::testing::Test {
};
struct PairwisePointInPolygonTest : public ::testing::Test {};

// float and double are logically the same but would require separate tests due to precision.
using TestTypes = ::testing::Types<float, double>;
Expand All @@ -43,13 +42,13 @@ TYPED_TEST(PairwisePointInPolygonTest, OnePolygonOneRing)
{
using T = TypeParam;
auto point_list = std::vector<std::vector<T>>{{-2.0, 0.0},
{2.0, 0.0},
{0.0, -2.0},
{0.0, 2.0},
{-0.5, 0.0},
{0.5, 0.0},
{0.0, -0.5},
{0.0, 0.5}};
{2.0, 0.0},
{0.0, -2.0},
{0.0, 2.0},
{-0.5, 0.0},
{0.5, 0.0},
{0.0, -0.5},
{0.0, 0.5}};
auto poly_offsets = make_device_vector({0, 1});
auto poly_ring_offsets = make_device_vector({0, 5});
auto poly_point = make_device_vector<vec_2d<T>>(
Expand Down Expand Up @@ -90,15 +89,15 @@ TYPED_TEST(PairwisePointInPolygonTest, TwoPolygonsOneRingEach)
auto poly_offsets = make_device_vector({0, 1, 2});
auto poly_ring_offsets = make_device_vector({0, 5, 10});
auto poly_point = make_device_vector<vec_2d<T>>({{-1.0, -1.0},
{-1.0, 1.0},
{1.0, 1.0},
{1.0, -1.0},
{-1.0, -1.0},
{0.0, 1.0},
{1.0, 0.0},
{0.0, -1.0},
{-1.0, 0.0},
{0.0, 1.0}});
{-1.0, 1.0},
{1.0, 1.0},
{1.0, -1.0},
{-1.0, -1.0},
{0.0, 1.0},
{1.0, 0.0},
{0.0, -1.0},
{-1.0, 0.0},
{0.0, 1.0}});

auto got = rmm::device_vector<int32_t>(2);
auto expected = std::vector<int>({false, false, false, false, true, true, true, true});
Expand Down Expand Up @@ -129,15 +128,15 @@ TYPED_TEST(PairwisePointInPolygonTest, OnePolygonTwoRings)
auto poly_offsets = make_device_vector({0, 1});
auto poly_ring_offsets = make_device_vector({0, 5, 10});
auto poly_point = make_device_vector<vec_2d<T>>({{-1.0, -1.0},
{1.0, -1.0},
{1.0, 1.0},
{-1.0, 1.0},
{-1.0, -1.0},
{-0.5, -0.5},
{-0.5, 0.5},
{0.5, 0.5},
{0.5, -0.5},
{-0.5, -0.5}});
{1.0, -1.0},
{1.0, 1.0},
{-1.0, 1.0},
{-1.0, -1.0},
{-0.5, -0.5},
{-0.5, 0.5},
{0.5, 0.5},
{0.5, -0.5},
{-0.5, -0.5}});

auto got = rmm::device_vector<int32_t>(1);
auto expected = std::vector<int>{0b0, 0b0, 0b1, 0b0, 0b1};
Expand Down Expand Up @@ -299,8 +298,7 @@ TYPED_TEST(PairwisePointInPolygonTest, 32PolygonSupport)
EXPECT_EQ(ret, got.end());
}

struct PairwisePointInPolygonErrorTest : public PairwisePointInPolygonTest<double> {
};
struct PairwisePointInPolygonErrorTest : public PairwisePointInPolygonTest<double> {};

TEST_F(PairwisePointInPolygonErrorTest, InsufficientPoints)
{
Expand Down
Loading