Skip to content

Commit

Permalink
Merge branch 'branch-24.06' of https://github.com/rapidsai/cuspatial
Browse files Browse the repository at this point in the history
…into fea/devcontainer-run-args
  • Loading branch information
trxcllnt committed May 7, 2024
2 parents c91c161 + 0324a33 commit 8c0301d
Show file tree
Hide file tree
Showing 19 changed files with 67 additions and 124 deletions.
2 changes: 0 additions & 2 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ dependencies:
- doxygen
- gcc_linux-64=11.*
- geopandas>=0.11.0
- gmock>=1.13.0
- gtest>=1.13.0
- ipython
- ipywidgets
- libcudf==24.6.*
Expand Down
2 changes: 0 additions & 2 deletions conda/environments/all_cuda-122_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ dependencies:
- doxygen
- gcc_linux-64=11.*
- geopandas>=0.11.0
- gmock>=1.13.0
- gtest>=1.13.0
- ipython
- ipywidgets
- libcudf==24.6.*
Expand Down
5 changes: 4 additions & 1 deletion conda/recipes/cuproj/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ cuda_compiler:
cuda11_compiler:
- nvcc

sysroot_version:
c_stdlib:
- sysroot

c_stdlib_version:
- "2.17"

cmake_version:
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/cuproj/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018-2023, NVIDIA CORPORATION.
# Copyright (c) 2018-2024, NVIDIA CORPORATION.

{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
Expand Down Expand Up @@ -52,7 +52,7 @@ requirements:
{% endif %}
- cuda-version ={{ cuda_version }}
- ninja
- sysroot_{{ target_platform }} {{ sysroot_version }}
- {{ stdlib("c") }}
host:
{% if cuda_major != "11" %}
- cuda-cudart-dev
Expand Down
5 changes: 4 additions & 1 deletion conda/recipes/cuspatial/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ cuda_compiler:
cuda11_compiler:
- nvcc

sysroot_version:
c_stdlib:
- sysroot

c_stdlib_version:
- "2.17"

cmake_version:
Expand Down
2 changes: 1 addition & 1 deletion conda/recipes/cuspatial/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ requirements:
{% endif %}
- cuda-version ={{ cuda_version }}
- ninja
- sysroot_{{ target_platform }} {{ sysroot_version }}
- {{ stdlib("c") }}
host:
{% if cuda_major != "11" %}
- cuda-cudart-dev
Expand Down
5 changes: 4 additions & 1 deletion conda/recipes/libcuspatial/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ cmake_version:
gtest_version:
- ">=1.13.0"

sysroot_version:
c_stdlib:
- sysroot

c_stdlib_version:
- "2.17"
8 changes: 2 additions & 6 deletions conda/recipes/libcuspatial/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018-2023, NVIDIA CORPORATION.
# Copyright (c) 2018-2024, NVIDIA CORPORATION.

{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
Expand Down Expand Up @@ -42,12 +42,10 @@ requirements:
- cuda-version ={{ cuda_version }}
- cmake {{ cmake_version }}
- ninja
- sysroot_{{ target_platform }} {{ sysroot_version }}
- {{ stdlib("c") }}
host:
- cuda-version ={{ cuda_version }}
- doxygen
- gmock {{ gtest_version }}
- gtest {{ gtest_version }}
- libcudf ={{ minor_version }}
- librmm ={{ minor_version }}
- sqlite
Expand Down Expand Up @@ -129,5 +127,3 @@ outputs:
- cuda-cudart
{% endif %}
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
- gmock {{ gtest_version }}
- gtest {{ gtest_version }}
5 changes: 3 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ rapids_cpm_init()
include(cmake/thirdparty/get_cudf.cmake)
# find or install GoogleTest
if (CUSPATIAL_BUILD_TESTS)
include(cmake/thirdparty/get_gtest.cmake)
include(${rapids-cmake-dir}/cpm/gtest.cmake)
rapids_cpm_gtest(BUILD_STATIC)
endif()
# find or add ranger
include (cmake/thirdparty/get_ranger.cmake)
Expand Down Expand Up @@ -222,7 +223,7 @@ endif()
if(CUSPATIAL_BUILD_BENCHMARKS)
# Find or install GoogleBench
include(${rapids-cmake-dir}/cpm/gbench.cmake)
rapids_cpm_gbench()
rapids_cpm_gbench(BUILD_STATIC)

# Find or install NVBench Temporarily force downloading of fmt because current versions of nvbench
# do not support the latest version of fmt, which is automatically pulled into our conda
Expand Down
39 changes: 0 additions & 39 deletions cpp/cmake/thirdparty/get_gtest.cmake

This file was deleted.

7 changes: 4 additions & 3 deletions cpp/cuproj/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ include(cmake/thirdparty/get_rmm.cmake)

# find or install GoogleTest and Proj
if (CUPROJ_BUILD_TESTS)
include(cmake/thirdparty/get_gtest.cmake)
include(cmake/thirdparty/get_proj.cmake)
include(${rapids-cmake-dir}/cpm/gtest.cmake)
rapids_cpm_gtest(BUILD_STATIC)
include(cmake/thirdparty/get_proj.cmake)
endif()

###################################################################################################
Expand Down Expand Up @@ -162,7 +163,7 @@ endif()
if(CUPROJ_BUILD_BENCHMARKS)
# Find or install GoogleBench
include(${rapids-cmake-dir}/cpm/gbench.cmake)
rapids_cpm_gbench()
rapids_cpm_gbench(BUILD_STATIC)

# Find or install NVBench Temporarily force downloading of fmt because current versions of nvbench
# do not support the latest version of fmt, which is automatically pulled into our conda
Expand Down
39 changes: 0 additions & 39 deletions cpp/cuproj/cmake/thirdparty/get_gtest.cmake

This file was deleted.

2 changes: 2 additions & 0 deletions cpp/tests/bounding_boxes/linestring_bounding_boxes_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <cudf/table/table_view.hpp>
#include <cudf_test/column_wrapper.hpp>

#include <gtest/gtest.h>

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

using T = float;
Expand Down
2 changes: 2 additions & 0 deletions cpp/tests/bounding_boxes/polygon_bounding_boxes_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <cudf_test/column_utilities.hpp>
#include <cudf_test/column_wrapper.hpp>

#include <gtest/gtest.h>

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

using T = float;
Expand Down
2 changes: 2 additions & 0 deletions cpp/tests/join/quadtree_point_in_polygon_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <cudf_test/column_wrapper.hpp>
#include <cudf_test/table_utilities.hpp>

#include <gtest/gtest.h>

#include <memory>

using T = float;
Expand Down
48 changes: 27 additions & 21 deletions cpp/tests/join/quadtree_point_in_polygon_test_large.cu
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ template <typename T>
inline auto generate_points(
std::vector<std::vector<T>> const& quads,
uint32_t points_per_quad,
cuspatial::vec_2d<T> v_min,
cuspatial::vec_2d<T> v_max,
std::size_t seed,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource())
{
auto engine = cuspatial::test::deterministic_engine(0);
auto uniform = cuspatial::test::make_normal_dist<T>(0.0, 1.0);
auto pgen = cuspatial::test::point_generator(cuspatial::vec_2d<T>{0.0, 0.0},
cuspatial::vec_2d<T>{1.0, 1.0},
engine,
engine,
uniform,
uniform);
auto engine_x = cuspatial::test::deterministic_engine(42);
auto engine_y = cuspatial::test::deterministic_engine(137);
auto uniform_x = cuspatial::test::make_normal_dist<T>(v_min.x, v_max.x);
auto uniform_y = cuspatial::test::make_normal_dist<T>(v_min.y, v_max.y);
auto pgen =
cuspatial::test::point_generator(v_min, v_max, engine_x, engine_y, uniform_x, uniform_y);
auto num_points = quads.size() * points_per_quad;
rmm::device_uvector<cuspatial::vec_2d<T>> points(num_points, stream, mr);

Expand Down Expand Up @@ -97,12 +97,12 @@ TYPED_TEST(PIPRefineTestLarge, TestLarge)
{7, 8, 3, 4},
{0, 4, 4, 8}};

auto points_in = generate_points<T>(quads, min_size, 0, this->stream());
auto points_in = generate_points<T>(quads, min_size, v_min, v_max, 0, this->stream());

auto [point_indices, quadtree] = quadtree_on_points(
auto [point_indices, quadtree] = cuspatial::quadtree_on_points(
points_in.begin(), points_in.end(), v_min, v_max, scale, max_depth, min_size, this->stream());

auto points = rmm::device_uvector<vec_2d<T>>(quads.size() * min_size, this->stream());
auto points = rmm::device_uvector<vec_2d<T>>(point_indices.size(), this->stream());
thrust::gather(rmm::exec_policy(this->stream()),
point_indices.begin(),
point_indices.end(),
Expand Down Expand Up @@ -160,10 +160,13 @@ TYPED_TEST(PIPRefineTestLarge, TestLarge)
quadtree,
point_indices.begin(),
point_indices.end(),
points.begin(),
points_in.begin(),
multipolygons,
this->stream());

EXPECT_GT(actual_point_indices.size(), 0);
EXPECT_GT(actual_poly_indices.size(), 0);

thrust::stable_sort_by_key(rmm::exec_policy(this->stream()),
actual_point_indices.begin(),
actual_point_indices.end(),
Expand All @@ -172,17 +175,17 @@ TYPED_TEST(PIPRefineTestLarge, TestLarge)
{ // verify
rmm::device_uvector<int32_t> hits(points.size(), this->stream());

auto points_range = make_multipoint_range(
auto points_range = cuspatial::make_multipoint_range(
points.size(), thrust::make_counting_iterator(0), points.size(), points.begin());

auto polygons_range = make_multipolygon_range(multipolygons.size(),
thrust::make_counting_iterator(0),
multipolygons.size(),
multipolygons.part_offset_begin(),
multipolygons.num_rings(),
multipolygons.ring_offset_begin(),
multipolygons.num_points(),
multipolygons.point_begin());
auto polygons_range = cuspatial::make_multipolygon_range(multipolygons.size(),
thrust::make_counting_iterator(0),
multipolygons.size(),
multipolygons.part_offset_begin(),
multipolygons.num_rings(),
multipolygons.ring_offset_begin(),
multipolygons.num_points(),
multipolygons.point_begin());

auto hits_end =
cuspatial::point_in_polygon(points_range, polygons_range, hits.begin(), this->stream());
Expand All @@ -209,6 +212,9 @@ TYPED_TEST(PIPRefineTestLarge, TestLarge)
auto d_expected_poly_indices = rmm::device_vector<std::uint32_t>(expected_poly_indices);
auto d_expected_point_indices = rmm::device_vector<std::uint32_t>(expected_point_indices);

EXPECT_GT(d_expected_poly_indices.size(), 0);
EXPECT_GT(d_expected_point_indices.size(), 0);

thrust::stable_sort_by_key(rmm::exec_policy(this->stream()),
d_expected_point_indices.begin(),
d_expected_point_indices.end(),
Expand Down
2 changes: 2 additions & 0 deletions cpp/tests/join/quadtree_point_to_nearest_linestring_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <cudf_test/column_wrapper.hpp>
#include <cudf_test/table_utilities.hpp>

#include <gtest/gtest.h>

#include <memory>

using T = float;
Expand Down
4 changes: 0 additions & 4 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ dependencies:
packages:
- c-compiler
- cxx-compiler
- gmock>=1.13.0
- gtest>=1.13.0
- libcudf==24.6.*
- librmm==24.6.*
- proj
Expand Down Expand Up @@ -167,8 +165,6 @@ dependencies:
packages:
- c-compiler
- cxx-compiler
- gmock>=1.13.0
- gtest>=1.13.0
- librmm==24.6.*
- proj
- sqlite
Expand Down
8 changes: 8 additions & 0 deletions python/cuproj/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,11 @@ wheel.packages = ["cuproj"]
provider = "scikit_build_core.metadata.regex"
input = "cuproj/VERSION"
regex = "(?P<value>.*)"

[tool.pytest.ini_options]
xfail_strict = true
filterwarnings = [
"error",
# https://github.com/pytest-dev/pytest-cov/issues/557
"ignore:The --rsyncdir command line argument:DeprecationWarning",
]

0 comments on commit 8c0301d

Please sign in to comment.