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

Experiment on pulling NVTX3 via CPM #1002

Draft
wants to merge 79 commits into
base: branch-23.08
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
965b80a
initial
isVoid Feb 28, 2023
38af8e6
Merge branch 'branch-23.04' of https://github.com/rapidsai/cuspatial …
isVoid Mar 1, 2023
02f61fe
add pragma once for floating_point.cuh
isVoid Mar 7, 2023
7bd797f
add polygon_ref structure
isVoid Mar 7, 2023
0968c15
add multipolygon_ref class
isVoid Mar 7, 2023
a659eab
update multipolygon_range class
isVoid Mar 7, 2023
c274070
update multipoint_range class
isVoid Mar 7, 2023
12ffa53
update is_point_in_polygon usage with polygon_ref
isVoid Mar 7, 2023
7490333
update multilinestring_range
isVoid Mar 7, 2023
f665287
add point to polygon kernel
isVoid Mar 7, 2023
291f6e6
add segment deduction guide
isVoid Mar 7, 2023
efa6883
add owning object type to vector factories
isVoid Mar 7, 2023
23146ef
add tests
isVoid Mar 7, 2023
ead160a
add helper files
isVoid Mar 7, 2023
09bd35f
add more tests
isVoid Mar 8, 2023
92760d1
bug fixes
isVoid Mar 8, 2023
8acb5dc
cleanups
isVoid Mar 8, 2023
a2b94fe
fix tests
isVoid Mar 8, 2023
46a67fe
optimize single point range input
isVoid Mar 8, 2023
b725b52
docs, type checks in range ctor
isVoid Mar 8, 2023
cb5706a
Merge branch 'branch-23.04' into feature/polygon_distances
isVoid Mar 8, 2023
ab59e7d
use range based for loop in is_point_in_polygon
isVoid Mar 8, 2023
b136c0b
Apply suggestions from code review
isVoid Mar 9, 2023
744f32f
add docs
isVoid Mar 9, 2023
bb6c637
style
isVoid Mar 9, 2023
756650b
Merge branch 'branch-23.04' of https://github.com/rapidsai/cuspatial …
isVoid Mar 9, 2023
8319e7c
fix bug in PiP tests
isVoid Mar 10, 2023
86d36d9
updates with test docs and API docs, address review
isVoid Mar 14, 2023
7bf8cbf
update offsets_to_keys
isVoid Mar 14, 2023
ff48dc7
update floating_point docs
isVoid Mar 14, 2023
b4420a7
use any_of
isVoid Mar 14, 2023
44e2843
add large (multigrid) tests, address reviews
isVoid Mar 14, 2023
57e6196
Merge branch 'branch-23.04' of https://github.com/rapidsai/cuspatial …
isVoid Mar 15, 2023
49972d4
add upper_bound_index.cuh
isVoid Mar 15, 2023
f000e00
remove upper_bound_index
isVoid Mar 15, 2023
57504e6
update geometry id factory
isVoid Mar 15, 2023
4865922
add get gtest scripts in cmake
isVoid Mar 15, 2023
ab52bc2
Merge branch 'branch-23.04' of https://github.com/rapidsai/cuspatial …
isVoid Mar 16, 2023
eff0e43
add generators and generator tests
isVoid Mar 17, 2023
6d14d69
add parameterized test fixture
isVoid Mar 17, 2023
5f347fd
adopt single kernel launch device multipolygon generation
isVoid Mar 18, 2023
bd78dfd
Merge branch 'branch-23.04' of https://github.com/rapidsai/cuspatial …
isVoid Mar 18, 2023
293ee0f
documentation
isVoid Mar 20, 2023
00a6728
document function
isVoid Mar 20, 2023
d910a7c
enable value parameterized test
isVoid Mar 20, 2023
bd6a4eb
revert distance benchmark
isVoid Mar 20, 2023
9e74468
mixin doc
isVoid Mar 20, 2023
fabc5ad
add point-polygon distance benchmark
isVoid Mar 20, 2023
de5a663
add benchmark file
isVoid Mar 21, 2023
5c67a80
address review comments
isVoid Mar 21, 2023
757057c
Merge branch 'benchmark/point_polygon_distance' into benchmark/point_…
isVoid Mar 21, 2023
2b46f18
Merge branch 'branch-23.04' into benchmark/point_polygon_distance_dev
isVoid Mar 21, 2023
eab8089
update sides->edge
isVoid Mar 21, 2023
dea6568
Merge branch 'branch-23.04' of https://github.com/rapidsai/cuspatial …
isVoid Mar 22, 2023
7b19c45
Merge branch 'benchmark/point_polygon_distance_dev' of github.com:isV…
isVoid Mar 22, 2023
1143977
add nvtx range and fix fixtures
isVoid Mar 23, 2023
72fc085
Merge branch 'branch-23.04' into benchmark/point_polygon_distance_dev
isVoid Mar 28, 2023
1c1fbc4
rename plural->singular form
isVoid Apr 14, 2023
4e56fe8
Merge branch 'branch-23.06' of https://github.com/rapidsai/cuspatial …
isVoid Apr 14, 2023
e662f1b
Merge branch 'benchmark/point_polygon_distance_dev' of github.com:isV…
isVoid Apr 14, 2023
80d92e4
style
isVoid Apr 14, 2023
c2e4390
Merge branch 'branch-23.06' into benchmark/point_polygon_distance_dev
harrism Apr 18, 2023
2ecb8d5
use cpm to pull nvtx
isVoid Apr 25, 2023
79416e8
Merge branch 'benchmark/point_polygon_distance_dev' of github.com:isV…
isVoid Apr 25, 2023
2688284
Merge branch 'branch-23.06' of https://github.com/rapidsai/cuspatial …
isVoid Apr 25, 2023
76b26ab
fixes broken API usage
isVoid Apr 25, 2023
8d34780
using rapids-cpm-find
isVoid Apr 25, 2023
0e66450
style
isVoid Apr 26, 2023
b089297
add build export set arg
isVoid Apr 26, 2023
172055e
Merge branch 'branch-23.06' of https://github.com/rapidsai/cuspatial …
isVoid May 3, 2023
545fdc2
update cmakelists.txt
isVoid May 3, 2023
e8e2dbe
Merge branch 'branch-23.06' of https://github.com/rapidsai/cuspatial …
isVoid May 4, 2023
aa8169b
Move
isVoid May 4, 2023
db628be
Fix bad renames
isVoid May 4, 2023
cc6ff27
Record progress
isVoid May 5, 2023
ae9fe35
Merge branch 'branch-23.06' of https://github.com/rapidsai/cuspatial …
isVoid May 9, 2023
4d4cf28
revert non nvtx3 cmake releated changes
isVoid May 10, 2023
1b978cd
add file that got removed
isVoid May 10, 2023
960d921
remove file
isVoid May 10, 2023
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
54 changes: 54 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,22 @@ include(cmake/Modules/ConfigureCUDA.cmake)
rapids_cpm_init()
# find or add cuDF
include(cmake/thirdparty/CUSPATIAL_GetCUDF.cmake)

if (USE_NVTX)

rapids_cpm_find(
NVTX3 3.1.0
GLOBAL_TARGETS nvtx3-cpp
CPM_ARGS
GITHUB_REPOSITORY NVIDIA/NVTX
GIT_TAG v3.1.0-c-cpp
GIT_SHALLOW TRUE
DOWNLOAD_ONLY TRUE
)
include(${NVTX3_SOURCE_DIR}/nvtxImportedTargets.cmake)

endif()

# find or install GoogleTest
if (CUSPATIAL_BUILD_TESTS)
include(cmake/thirdparty/get_gtest.cmake)
Expand Down Expand Up @@ -199,6 +215,7 @@ target_compile_definitions(cuspatial PUBLIC "SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${

# Specify the target module library dependencies
target_link_libraries(cuspatial PUBLIC cudf::cudf)
target_link_libraries(cuspatial PRIVATE nvtx3-cpp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a PUBLIC dependency not a PRIVATE one. The nvtx3 headers are included by the cuspatial public headers and therefore consumers of cuspatial will also need nvtx3.

This will resolve the test compilation failures.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We expected to need PUBLIC here and tried it but it caused another issue. @isVoid Can you provide the logs?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nvtx3 project doesn't have have install / export rules for the targets they create it looks like. So you would get errors when trying to export the cuspatial targets as they now depend on targets that have no way to be exported.

What we should do is specify DOWNLOAD_ONLY when getting nvtx3 and directly including nvtxImportedTargets.cmake ( https://github.com/NVIDIA/NVTX/blob/v3.1.0-c-cpp/CMakeLists.txt#L33 ).

We will need to also setup install rules for this file and the nvtx3 headers, plus a custom FINAL_CODE_BLOCK I expect for the rapids_export.

I expect that this is why previously cuspatial copied nvtx3 directly, as it dramatically simplified the build-system.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exactly what we ran into. We tried setting it to PUBLIC and used rapids_cpm_find.

The nvtx3 project doesn't have have install / export rules for the targets they create it looks like.

Should we look into contributing to nvtx3 to provide install / export rules?

Copy link
Member

@harrism harrism Apr 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we look into contributing to nvtx3 to provide install / export rules?

Yes but don't hold your breath for it to be put in a release anytime soon. It took them about 2 years to release the last merged feature I was waiting on. So you will probably need to take Rob's DOWNLOAD_ONLY suggestion as well.


add_library(cuspatial::cuspatial ALIAS cuspatial)

Expand Down Expand Up @@ -249,6 +266,11 @@ install(TARGETS cuspatial
install(DIRECTORY ${CUSPATIAL_SOURCE_DIR}/include/cuspatial
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

message("Installing ${NVTX3_SOURCE_DIR}/include/nvtx3 to /home/coder/scratch")

install(DIRECTORY ${NVTX3_SOURCE_DIR}
DESTINATION /home/coder/scratch)

set(doc_string
[=[
Provide targets for the cuSpatial library.
Expand All @@ -273,6 +295,32 @@ rapids_export(
DOCUMENTATION doc_string
)

set(nvtx3_final_code_block
[=[
if(NOT TARGET nvtx3-c)
add_library(nvtx3-c INTERFACE IMPORTED GLOBAL)
set_target_properties(nvtx3-c PROPERTIES VERSION ${NVTX3_VERSION})
target_include_directories(nvtx3-c INTERFACE
set_target_properties(nvtx3-c PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include")
target_link_libraries(nvtx3-c INTERFACE ${CMAKE_DL_LIBS})

#-------------------------------------------------------
# Define "nvtx3-cpp" library for the NVTX v3 C++ API
# Separate target allows attaching independent compiler requirements if needed
add_library(nvtx3-cpp INTERFACE IMPORTED GLOBAL)
set_target_properties(nvtx3-cpp PROPERTIES VERSION ${NVTX3_VERSION})
target_link_libraries(nvtx3-cpp INTERFACE nvtx3-c)
endif()
]=]
)

rapids_export(
INSTALL nvtx3-cpp
EXPORT_SET cuspatial-exports
GLOBAL_TARGETS nvtx3-cpp
FINAL_CODE_BLOCK nvtx3_final_code_block
)

################################################################################################
# - build export -------------------------------------------------------------------------------
Expand All @@ -285,6 +333,12 @@ rapids_export(
DOCUMENTATION doc_string
)

rapids_export(
BUILD nvtx3-cpp
EXPORT_SET cuspatial-exports
GLOBAL_TARGETS nvtx3-cpp
FINAL_CODE_BLOCK nvtx3_final_code_block
)

# ##################################################################################################
# * build documentation ----------------------------------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions cpp/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,15 @@ ConfigureBench(HAUSDORFF_BENCH
distance/hausdorff_benchmark.cpp)

ConfigureNVBench(DISTANCES_BENCH
distance/pairwise_point_polygon_distance.cu
distance/pairwise_linestring_distance.cu)

ConfigureNVBench(POINTS_IN_RANGE_BENCH
points_in_range.cu)

ConfigureNVBench(POINT_IN_POLYGON_BENCH
point_in_polygon.cu)

ConfigureNVBench(QUADTREE_ON_POINTS_BENCH
indexing/quadtree_on_points.cu)

Expand Down
Loading