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 cuSpatial to use C++17 #382

Merged
merged 2 commits into from
Apr 13, 2021
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
60 changes: 35 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,38 @@
**NOTE:** cuSpatial depends on [cuDF](https://github.com/rapidsai/cudf) and
[RMM](https://github.com/rapidsai/rmm) from [RAPIDS](https://rapids.ai/).

## Implemented operations:
## Operations

cuSpatial supports the following operations on spatial and trajectory data:

1. Spatial window query
2. Point-in-polygon test
3. Haversine distance
4. Hausdorff distance
5. Deriving trajectories from point location data
6. Computing distance/speed of trajectories
7. Computing spatial bounding boxes of trajectories
8. Quadtree-based indexing for large-scale point data
9. Quadtree-based point-in-polygon spatial join
10. Quadtree-based point-to-polyline nearest neighbor distance

Future support is planned for the following operations:

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

## Install from Conda

To install via conda:
```

```shell
conda install -c conda-forge -c rapidsai-nightly cuspatial
```

## Install from Source

To build and install cuSpatial from source:

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

```
git clone --recurse-submodules https://github.com/rapidsai/cuspatial.git $CUSPATIAL_HOME
```
```shell
git clone --recurse-submodules https://github.com/rapidsai/cuspatial.git $CUSPATIAL_HOME
```

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

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

Some tests using inline data can be run directly, e.g.,
```
$CUSPATIAL_HOME/cpp/build/gtests/LEGACY_HAUSDORFF_TEST
$CUSPATIAL_HOME/cpp/build/gtests/POINT_IN_POLYGON_TEST
python python/cuspatial/cuspatial/tests/legacy/test_hausdorff_distance.py
python python/cuspatial/cuspatial/tests/test_pip.py
```
Note that a "build" dir is created automatically under `$CUSPATIAL_HOME/cpp`.

4. Run C++/Python test code

Some tests using inline data can be run directly, e.g.:

```shell
$CUSPATIAL_HOME/cpp/build/gtests/LEGACY_HAUSDORFF_TEST
$CUSPATIAL_HOME/cpp/build/gtests/POINT_IN_POLYGON_TEST
python python/cuspatial/cuspatial/tests/legacy/test_hausdorff_distance.py
python python/cuspatial/cuspatial/tests/test_pip.py
```

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

**NOTE:** Currently, cuSpatial supports reading point/polyine/polygon data using
Structure of Array (SoA) format and a [shapefile reader](./cpp/src/io/shp)
Expand Down
4 changes: 2 additions & 2 deletions conda/environments/cuspatial_dev_cuda11.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ channels:
dependencies:
- clang=8.0.1
- clang-tools=8.0.1
- cudf=0.16.*
- cudf=0.20.*
- cudatoolkit=11.0
- gdal>=3.0.2
- geopandas=0.7.0
- cmake>=3.14
- cmake>=3.18
- cython>=0.29,<0.30
- gtest
- gmock
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ channels:
dependencies:
- clang=8.0.1
- clang-tools=8.0.1
- cudf=0.16.*
- cudatoolkit=10.1
- cudf=0.20.*
- cudatoolkit=11.1
- gdal>=3.0.2
- geopandas=0.7.0
- cmake>=3.14
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ channels:
dependencies:
- clang=8.0.1
- clang-tools=8.0.1
- cudf=0.16.*
- cudatoolkit=10.2
- cudf=0.20.*
- cudatoolkit=11.2
- gdal>=3.0.2
- geopandas=0.7.0
- cmake>=3.14
Expand Down
4 changes: 2 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ set_target_properties(cuspatial
PROPERTIES BUILD_RPATH "\$ORIGIN"
INSTALL_RPATH "\$ORIGIN"
# set target compile options
CXX_STANDARD 14
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CUDA_STANDARD 14
CUDA_STANDARD 17
CUDA_STANDARD_REQUIRED ON
POSITION_INDEPENDENT_CODE ON
INTERFACE_POSITION_INDEPENDENT_CODE ON
Expand Down
2 changes: 2 additions & 0 deletions cpp/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
add_library(cuspatial_benchmark_common OBJECT
synchronization/synchronization.cpp)

target_compile_features(cuspatial_benchmark_common PUBLIC cxx_std_17 cuda_std_17)

target_link_libraries(cuspatial_benchmark_common
PUBLIC benchmark::benchmark
cudf::cudftestutil
Expand Down
10 changes: 0 additions & 10 deletions cpp/cmake/Modules/SetGPUArchs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@ if(NOT DEFINED CUDAToolkit_VERSION AND CMAKE_CUDA_COMPILER)
unset(NVCC_OUT)
endif()

if(CUDAToolkit_VERSION_MAJOR LESS 11)
list(REMOVE_ITEM SUPPORTED_CUDA_ARCHITECTURES "80")
endif()
if(CUDAToolkit_VERSION_MAJOR LESS 10)
list(REMOVE_ITEM SUPPORTED_CUDA_ARCHITECTURES "75")
endif()
if(CUDAToolkit_VERSION_MAJOR LESS 9)
list(REMOVE_ITEM SUPPORTED_CUDA_ARCHITECTURES "70")
endif()

if(${PROJECT_NAME}_BUILD_FOR_ALL_ARCHS)
set(CMAKE_CUDA_ARCHITECTURES ${SUPPORTED_CUDA_ARCHITECTURES})

Expand Down
6 changes: 2 additions & 4 deletions java/src/main/native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ endif()
###################################################################################################
# - compiler options ------------------------------------------------------------------------------

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX})
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)

if(CMAKE_COMPILER_IS_GNUCXX)
Expand Down Expand Up @@ -225,5 +225,3 @@ endif(PER_THREAD_DEFAULT_STREAM)
# - link libraries --------------------------------------------------------------------------------

target_link_libraries(cuspatialjni cuspatial)