Skip to content

Commit 6d7d0d0

Browse files
authored
Update cuSpatial to use C++17 (#382)
cuDF 0.20 headers [now use C++17 features](rapidsai/cudf#7931), so we need to update to C++17 also. We will also need to update CI images to use gcc-9, as C++17 support is incomplete in gcc-7 and gcc-8. Authors: - Paul Taylor (https://github.com/trxcllnt) Approvers: - Keith Kraus (https://github.com/kkraus14) - Christopher Harris (https://github.com/cwharris) - AJ Schmidt (https://github.com/ajschmidt8) URL: #382
1 parent de08ce8 commit 6d7d0d0

File tree

8 files changed

+47
-47
lines changed

8 files changed

+47
-47
lines changed

README.md

+35-25
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,38 @@
55
**NOTE:** cuSpatial depends on [cuDF](https://github.com/rapidsai/cudf) and
66
[RMM](https://github.com/rapidsai/rmm) from [RAPIDS](https://rapids.ai/).
77

8-
## Implemented operations:
8+
## Operations
9+
910
cuSpatial supports the following operations on spatial and trajectory data:
11+
1012
1. Spatial window query
1113
2. Point-in-polygon test
1214
3. Haversine distance
1315
4. Hausdorff distance
1416
5. Deriving trajectories from point location data
1517
6. Computing distance/speed of trajectories
1618
7. Computing spatial bounding boxes of trajectories
19+
8. Quadtree-based indexing for large-scale point data
20+
9. Quadtree-based point-in-polygon spatial join
21+
10. Quadtree-based point-to-polyline nearest neighbor distance
22+
23+
Future support is planned for the following operations:
1724

18-
Future support is planned for the following operations.
1925
1. Temporal window query
2026
2. Temporal point query (year+month+day+hour+minute+second+millisecond)
21-
3. Point-to-polyline nearest neighbor distance
22-
4. Grid-based indexing for points and polygons
23-
5. Quadtree-based indexing for large-scale point data
24-
6. R-Tree-based indexing for Polygons/Polylines
27+
3. Grid-based indexing for points and polygons
28+
4. R-Tree-based indexing for Polygons/Polylines
2529

2630
## Install from Conda
31+
2732
To install via conda:
28-
```
33+
34+
```shell
2935
conda install -c conda-forge -c rapidsai-nightly cuspatial
3036
```
3137

3238
## Install from Source
39+
3340
To build and install cuSpatial from source:
3441

3542
### Install dependencies
@@ -46,28 +53,31 @@ environment created in step 3 is active.
4653
1. export `CUSPATIAL_HOME=$(pwd)/cuspatial`
4754
2. clone the cuSpatial repo
4855

49-
```
50-
git clone --recurse-submodules https://github.com/rapidsai/cuspatial.git $CUSPATIAL_HOME
51-
```
56+
```shell
57+
git clone --recurse-submodules https://github.com/rapidsai/cuspatial.git $CUSPATIAL_HOME
58+
```
5259

53-
3. Compile and install
54-
Similar to cuDF (version 0.11), simplely run 'build.sh' diectly under $CUSPATIAL_HOME<br>
55-
Note that a "build" dir is created automatically under $CUSPATIAL_HOME/cpp
60+
3. Compile and install
5661

57-
4. Run C++/Python test code <br>
62+
Similar to cuDF (version 0.20), simply run `build.sh` diectly under `$CUSPATIAL_HOME`.
5863

59-
Some tests using inline data can be run directly, e.g.,
60-
```
61-
$CUSPATIAL_HOME/cpp/build/gtests/LEGACY_HAUSDORFF_TEST
62-
$CUSPATIAL_HOME/cpp/build/gtests/POINT_IN_POLYGON_TEST
63-
python python/cuspatial/cuspatial/tests/legacy/test_hausdorff_distance.py
64-
python python/cuspatial/cuspatial/tests/test_pip.py
65-
```
64+
Note that a "build" dir is created automatically under `$CUSPATIAL_HOME/cpp`.
65+
66+
4. Run C++/Python test code
67+
68+
Some tests using inline data can be run directly, e.g.:
69+
70+
```shell
71+
$CUSPATIAL_HOME/cpp/build/gtests/LEGACY_HAUSDORFF_TEST
72+
$CUSPATIAL_HOME/cpp/build/gtests/POINT_IN_POLYGON_TEST
73+
python python/cuspatial/cuspatial/tests/legacy/test_hausdorff_distance.py
74+
python python/cuspatial/cuspatial/tests/test_pip.py
75+
```
6676

67-
Some other tests involve I/O from data files under $CUSPATIAL_HOME/test_fixtures.
68-
For example, $CUSPATIAL_HOME/cpp/build/gtests/SHAPEFILE_READER_TEST requires three
69-
pre-generated polygon shapefiles that contain 0, 1 and 2 polygons, respectively. They are available at
70-
$CUSPATIAL_HOME/test_fixtures/shapefiles <br>
77+
Some other tests involve I/O from data files under $CUSPATIAL_HOME/test_fixtures.
78+
For example, $CUSPATIAL_HOME/cpp/build/gtests/SHAPEFILE_READER_TEST requires three
79+
pre-generated polygon shapefiles that contain 0, 1 and 2 polygons, respectively. They are available at
80+
$CUSPATIAL_HOME/test_fixtures/shapefiles <br>
7181

7282
**NOTE:** Currently, cuSpatial supports reading point/polyine/polygon data using
7383
Structure of Array (SoA) format and a [shapefile reader](./cpp/src/io/shp)

conda/environments/cuspatial_dev_cuda11.0.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ channels:
88
dependencies:
99
- clang=8.0.1
1010
- clang-tools=8.0.1
11-
- cudf=0.16.*
11+
- cudf=0.20.*
1212
- cudatoolkit=11.0
1313
- gdal>=3.0.2
1414
- geopandas=0.7.0
15-
- cmake>=3.14
15+
- cmake>=3.18
1616
- cython>=0.29,<0.30
1717
- gtest
1818
- gmock

conda/environments/cuspatial_dev_cuda10.1.yml conda/environments/cuspatial_dev_cuda11.1.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ channels:
88
dependencies:
99
- clang=8.0.1
1010
- clang-tools=8.0.1
11-
- cudf=0.16.*
12-
- cudatoolkit=10.1
11+
- cudf=0.20.*
12+
- cudatoolkit=11.1
1313
- gdal>=3.0.2
1414
- geopandas=0.7.0
1515
- cmake>=3.14

conda/environments/cuspatial_dev_cuda10.2.yml conda/environments/cuspatial_dev_cuda11.2.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ channels:
88
dependencies:
99
- clang=8.0.1
1010
- clang-tools=8.0.1
11-
- cudf=0.16.*
12-
- cudatoolkit=10.2
11+
- cudf=0.20.*
12+
- cudatoolkit=11.2
1313
- gdal>=3.0.2
1414
- geopandas=0.7.0
1515
- cmake>=3.14

cpp/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ set_target_properties(cuspatial
141141
PROPERTIES BUILD_RPATH "\$ORIGIN"
142142
INSTALL_RPATH "\$ORIGIN"
143143
# set target compile options
144-
CXX_STANDARD 14
144+
CXX_STANDARD 17
145145
CXX_STANDARD_REQUIRED ON
146-
CUDA_STANDARD 14
146+
CUDA_STANDARD 17
147147
CUDA_STANDARD_REQUIRED ON
148148
POSITION_INDEPENDENT_CODE ON
149149
INTERFACE_POSITION_INDEPENDENT_CODE ON

cpp/benchmarks/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
add_library(cuspatial_benchmark_common OBJECT
2222
synchronization/synchronization.cpp)
2323

24+
target_compile_features(cuspatial_benchmark_common PUBLIC cxx_std_17 cuda_std_17)
25+
2426
target_link_libraries(cuspatial_benchmark_common
2527
PUBLIC benchmark::benchmark
2628
cudf::cudftestutil

cpp/cmake/Modules/SetGPUArchs.cmake

-10
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,6 @@ if(NOT DEFINED CUDAToolkit_VERSION AND CMAKE_CUDA_COMPILER)
3838
unset(NVCC_OUT)
3939
endif()
4040

41-
if(CUDAToolkit_VERSION_MAJOR LESS 11)
42-
list(REMOVE_ITEM SUPPORTED_CUDA_ARCHITECTURES "80")
43-
endif()
44-
if(CUDAToolkit_VERSION_MAJOR LESS 10)
45-
list(REMOVE_ITEM SUPPORTED_CUDA_ARCHITECTURES "75")
46-
endif()
47-
if(CUDAToolkit_VERSION_MAJOR LESS 9)
48-
list(REMOVE_ITEM SUPPORTED_CUDA_ARCHITECTURES "70")
49-
endif()
50-
5141
if(${PROJECT_NAME}_BUILD_FOR_ALL_ARCHS)
5242
set(CMAKE_CUDA_ARCHITECTURES ${SUPPORTED_CUDA_ARCHITECTURES})
5343

java/src/main/native/CMakeLists.txt

+2-4
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ endif()
3535
###################################################################################################
3636
# - compiler options ------------------------------------------------------------------------------
3737

38-
set(CMAKE_CXX_STANDARD 14)
38+
set(CMAKE_CXX_STANDARD 17)
3939
set(CMAKE_C_COMPILER $ENV{CC})
4040
set(CMAKE_CXX_COMPILER $ENV{CXX})
4141
set(CMAKE_CXX_STANDARD_REQUIRED ON)
4242

43-
set(CMAKE_CUDA_STANDARD 14)
43+
set(CMAKE_CUDA_STANDARD 17)
4444
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
4545

4646
if(CMAKE_COMPILER_IS_GNUCXX)
@@ -225,5 +225,3 @@ endif(PER_THREAD_DEFAULT_STREAM)
225225
# - link libraries --------------------------------------------------------------------------------
226226

227227
target_link_libraries(cuspatialjni cuspatial)
228-
229-

0 commit comments

Comments
 (0)