-
Notifications
You must be signed in to change notification settings - Fork 170
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
Initial monorepo setup. #88
Closed
Closed
Changes from 3 commits
Commits
Show all changes
408 commits
Select commit
Hold shift + click to select a range
cf9c8c4
Attempt to pass per CUDA matrix to nested workflow.
jrhemstad 794c1a5
Fix syntax
jrhemstad ff51fe8
Update per_cuda to pass the per_cuda_matrix to include:
jrhemstad 942429d
Test if I can access field fromJSON
jrhemstad 4d9fe86
Add missing runs-on
jrhemstad 89d9b2d
Wrap with toJSON to get it to print.
jrhemstad 8ae3755
Try passing the per_cuda_matrix to the per_cuda workflow again.
jrhemstad 11b3423
Wrap with toJSON.
jrhemstad d5f1d52
Make per_cuda a matrix job on the provided matrix.
jrhemstad 7ce3f0b
Remove commented code.
jrhemstad 0af43bb
Add cuda version to per_cuda job.
jrhemstad 9a1a6ed
Add per_compiler workflow.
jrhemstad 958fa09
Add missing compiler_name input.
jrhemstad 606fdd8
Don't wrap build matrix in "include{}" to avoid hard coding into the …
jrhemstad fba52e4
Correctly pass per_cuda_matrix into get_groups
jrhemstad 47dfc05
Extra name field.
jrhemstad 071a3c3
Wrap the inputs.per_cuda_matrix in quotes.
jrhemstad 64623ff
Store input to environment variable.
jrhemstad c9e2e99
Don't use fromJSON when assigning to variable.
jrhemstad 8d890d0
Use new approach where entire matrix is passed through and later filt…
jrhemstad a778156
Remove defunct dependency.
jrhemstad 38689bc
Update names and add stub CUB.
jrhemstad 884d817
Update thrust/cub names.
jrhemstad 2eb14b8
Make per_compiler a matrix.
jrhemstad c7da9e2
Fix matrix variable name.
jrhemstad 79cf0e6
Store matrix to envrionment variable first.
jrhemstad 57b49dd
Single quotes the full matrix.
jrhemstad 3129f60
Test is passing matrix is working correctly.
jrhemstad e0177f2
Double quotes.
jrhemstad fa66c83
Restore computing per compiler matrix.
jrhemstad 79d8b0f
Use toJSON
jrhemstad 0f21fec
Test matrix assignment.
jrhemstad 5bb4a7b
test
jrhemstad 1649795
test
jrhemstad 5472ae2
test2
jrhemstad 39b7a24
Use toJSON
jrhemstad 1651cab
Don't quote toJSON output
jrhemstad f2ad7bc
Restore setting PER_COMPILER_MATRIX.
jrhemstad 8c176ee
Make per_compiler depend on matrix job.
jrhemstad 2f29d60
Fix per_compiler name.
jrhemstad 986ecc8
Remove per_compiler name.
jrhemstad 410b7d1
Rename to per_library.
jrhemstad ed09d7f
Update top-level matrix to explode cuda/host compiler.
jrhemstad 3d8f885
Missing quotes in format call
jrhemstad 9795615
Fix per_cuda name.
jrhemstad 3edc03c
Fix passed compiler.
jrhemstad 47cb54f
Fix thrust name.
jrhemstad c7d4168
Update per_cuda name.
jrhemstad 06ba886
Fix per cuda name again.
jrhemstad af81f0f
Add C++ dialect and CPU to name.
jrhemstad fa95636
Add CUB/libcu++.
jrhemstad 3a21bfb
Fix libcu++ name
jrhemstad c5a9365
Add build/test
jrhemstad ceee780
Make per_cuda call another build-and-test workflow.
jrhemstad 537de60
Fix steps.
jrhemstad e5137bd
Remove unneccessary passing of cuda/compiler to per_cuda.
jrhemstad 5ec9e86
missing brace
jrhemstad 133b46f
Remove space.
jrhemstad db1cc0b
test hang.
jrhemstad 35508bb
Test hanging workflow
jrhemstad 8a451d6
Fix echo
jrhemstad 4dff392
Fix passed matrix entries
jrhemstad 2c9c159
Test why is it hanging
jrhemstad a36c8fd
Test cuda_version
jrhemstad f094bbf
test compiler.name
jrhemstad ecd8596
Test passing all matrix fields.
jrhemstad 76d4da8
remove build archs
jrhemstad 3a50521
Add random sleep to build step.
jrhemstad 7502a28
Missing paren
jrhemstad 08d4af1
Make cuda11 sleep for 10m
jrhemstad 7ebaa9c
Fix sleep time.
jrhemstad c6787d9
Reference the right input...
jrhemstad 995ec60
Make C++14 builds sleep
jrhemstad 671f54c
Add a comment that explains the overlap.
jrhemstad 25bc3a8
Remove sleep
jrhemstad e3558e1
Restructure workflow files
jrhemstad 41bf24b
Rename per_cuda
jrhemstad a5ab85c
Update step names
jrhemstad 2e16520
Only run test if build succeeded.
jrhemstad 5f92657
Add references to stub build/test scripts.
jrhemstad 9104134
fail-fast false
jrhemstad b6893d3
Flesh out build and test jobs.
jrhemstad 7a26196
Update stub test scripts
jrhemstad 4bebf4d
Factor format call into env
jrhemstad 165f431
Undo factoring format into env.
jrhemstad 8f0cba5
Rename matrix "include:" to "pull-request"
jrhemstad 1552fb4
Factor out root workflow into reusable workflow.
jrhemstad fc460c7
Fix inputs to linux-build-and-test
jrhemstad c1a0e66
Extra brace.
jrhemstad 33fee4c
Fix jq syntax
jrhemstad b85151c
Don't give root linux job a name.
jrhemstad 2c2a7c5
Go back to library jobs in root workflow.
jrhemstad 8504a99
Fix env
jrhemstad af1ff44
Correct swapped inputs.
jrhemstad 0faba7b
Use more specific env accessor.
jrhemstad 42b4427
Hardcode matrix/build type instead of env.
jrhemstad 4e6582c
Fix compute-matrix name.
jrhemstad 138577f
Access inputs instead of env for name.
jrhemstad c103ace
Delete unused linux-build-and-test workflow
jrhemstad 63b6492
Update names
jrhemstad 5ea15cb
Shorten name
jrhemstad 629050f
Use cpu as name.
jrhemstad 88f65d0
Fix matrix passed for thrust
jrhemstad e235125
Remove CPU from leaf job name.
jrhemstad fb4401d
Remove CPU from test name.
jrhemstad e3c09ae
Remove old test prints.
jrhemstad 2808357
Merge branch 'monorepo_submodules' into monorepo-workflow
jrhemstad 365fa2b
Allow TOPLEVEL_PROJECT logic to be force enabled.
alliepiper dc64548
Clean up some comments.
alliepiper fbf3bf9
Add Thrust and CUB build scripts.
jrhemstad ad2059f
Move source-tree location of cccl CMake package to lib/.
alliepiper d69ddf4
Force exact version checks when locating CCCL subprojects.
alliepiper 21f63ef
Add devcontainers and generator script.
jrhemstad d7185e1
Add a root devcontainer.json instead of a template.
jrhemstad ad55569
Fix various issues with CMake package testing.
alliepiper 3eb36b0
Add test after checkout
jrhemstad 5267ea8
Forgot that I'm checking out to repo/ now.
jrhemstad 4eadcac
Make build/test jobs conditional on input script.
jrhemstad 8fe6326
Test only passing test script.
jrhemstad 52196bb
Rename "build_type" to "matrix_type" to avoid confusion.
jrhemstad 9b7700d
Try "always()" instead of !cancelled().
jrhemstad 4949bb0
build_type -> matrix_type
jrhemstad 9351ecc
Try !cancelled().
jrhemstad 5dd0b0a
Try committing again?
jrhemstad c2adb0b
always()
jrhemstad d7f2372
success() || failure()
jrhemstad d2f743b
Try it on a single line?
jrhemstad 0c53f87
Use expression syntax
jrhemstad 8f1bf44
Revert checking out into repo folder for now.
jrhemstad 270994f
Merge branch 'test-action-runner-workflows' into monorepo-workflow
jrhemstad 898f9a0
Merge branch 'monorepo_submodules' into monorepo-workflow
jrhemstad 57b7738
Ensure we get full path to host compiler in build script.
jrhemstad 47af73a
Enable running thrust build on actual container.
jrhemstad 9c1dfaa
Ubuntu typo.
jrhemstad e816b82
Remove fetch-depth 0 and persist-credentials.
jrhemstad 0158c3b
Disable cub/libcu++ for now.
jrhemstad 26d9528
echo git version in container
jrhemstad bdd73dc
Update git for submodule support with action checkout.
jrhemstad 5f30e95
Update default shell to exit on first error.
jrhemstad 84bdaa5
Ignore C++ dialect deprecation warning.
jrhemstad 76c4455
Padd through macro to ignore deprecation warnings.
jrhemstad 5790bd7
Set bash script to fail if any command fails.
jrhemstad 3656d1a
Remove erroneous cmake flag
jrhemstad 9f2a4c1
Ignore CUB deprecation warnings too.
jrhemstad 06ba15d
clang16 isn't supported.
jrhemstad 5ddceb9
Bump libcudacxx to address review comments.
alliepiper 6d76b84
Make build verbose.
jrhemstad 4bdc3ea
Pass correct GPU archs through to build script
jrhemstad adc8b08
Bump Thrust for RDC flag fix.
alliepiper 007cdeb
Add name field to devcontainers.
jrhemstad 7812265
Use cmake options for ignoring deprecation warnings.
jrhemstad a5feaa4
fromJSON on gpu archs
jrhemstad 88c7875
Use string for GPU archs.
jrhemstad 5607728
Single quotes.
jrhemstad 0094a7f
remove the from JSON.
jrhemstad d405adc
Update comment on matrix
jrhemstad a181ef2
Remove temporary warning suppression from Thrust/CUB.
alliepiper fa1f8b2
Merge branch 'monorepo_submodules' into monorepo-workflow
jrhemstad b713ce9
Add `LANGUAGES` keyword to CMake project calls.
alliepiper 3011b3c
Simplify some genexes and update compiler ID where needed.
alliepiper f778ea0
Remove unnecessary NVC++ tweaks.
alliepiper 3a5c324
Add guards against unsupported arch options.
alliepiper 05d2594
Enable PIC for RDC targets.
alliepiper c98570a
Make os in matrix more general.
jrhemstad d089ac0
Update os docs.
jrhemstad 2c06500
Test build-and-test with windows support.
jrhemstad ef2f34e
Syntax
jrhemstad 1294673
Factor into env.
jrhemstad f690335
Update to use format().
jrhemstad 36c8342
Make the whole container line optionally empty.
jrhemstad 7779208
All in format().
jrhemstad 5ae412e
format
jrhemstad 116a594
Don't specify option.
jrhemstad 7881447
test specifying workflow as input.
jrhemstad 2bfaabc
quotes
jrhemstad 27c7e20
Can't dynamically specify "uses:"
jrhemstad ffb2d57
Set image name in env variable.
jrhemstad 86640fd
Try specifying options even if image is empty.
jrhemstad 40ae5f2
Remove stale "workflow:" input
jrhemstad dbeebb4
Actually remove the workflow: input.
jrhemstad 4d86945
Don't change the name of the Thrust job.
jrhemstad af74d4e
Enable thrust test job.
jrhemstad fbe793f
Don't update git.
jrhemstad f20375e
Remove windows from the matrix for now.
jrhemstad 4fa5573
Update git version
jrhemstad 16e9f41
Get rid of outdated apt package.
jrhemstad 2d472fd
Add NVIDIA_VISIBLE_DEVICES env to test job container.
jrhemstad 8f51aaa
Update more CUDA compiler id checks.
alliepiper 4cd24c5
Move dev build toggle to the cccl project level.
alliepiper d7442ea
Turn on install rules for everything.
jrhemstad 3a8bca4
Merge branch 'monorepo_submodules' into monorepo-workflow
jrhemstad dfc22b3
Factor common logic out of build_thrust.sh
jrhemstad 9e792fd
Add CUB build/test and enable in matrix.
jrhemstad 8bef2c6
Remove install tests from Thrust/CUB.
alliepiper cbca5f5
Rebase submodules on upstream main branches.
alliepiper 9dbf498
only build for sm70 for now
jrhemstad 6f38850
Add libcu++ test script and enable libcu++ test jobs.
jrhemstad 1472205
Merge branch 'monorepo_submodules' into monorepo-workflow
jrhemstad 3798769
Update how RDC flags are applied to Catch2 utilities.
alliepiper ab23f7f
Merge branch 'monorepo_submodules' into monorepo-workflow
jrhemstad 39dba74
Add a step to calculate sccache hit rate.
jrhemstad 71578a6
Update sccache script to print file contents.
jrhemstad 355611d
Add sccache to job summary.
jrhemstad 4c1bfb5
Fix writing the hit rate to job summary.
jrhemstad 0ed4be5
Remove set -x to only write hit_rate to stderr
jrhemstad 2c48d27
Add final "CI" job that can be used as status check.
jrhemstad a4406f4
Delete old workflow files.
jrhemstad e00d3ae
Delete old CI scripts.
jrhemstad c57c6cc
Remove devcontainers from this branch.
jrhemstad d641186
Add devcontainers.
jrhemstad 00ff865
Merge branch 'add_devcontainers' into monorepo-workflow
jrhemstad 17c74a1
Make thrust/cub tests timeout after 15 seconds.
jrhemstad 8177c03
Update permissions according to AJ's suggestion.
jrhemstad 1c16b96
Add .cache to gitignore.
jrhemstad 6424b79
Add overview of CI pipeline.
jrhemstad 44dee4f
Add mermaid diagram.
jrhemstad ceb7fe7
Better diagram
jrhemstad a929f5b
Update readme.
jrhemstad 20c7778
Fix link.
jrhemstad 1c451aa
Add links to matrix file.
jrhemstad 9b66bf5
Update CI doc and link to it from readme.
jrhemstad 93b3de4
Fix bullet indentation.
jrhemstad e5e148b
Expand build/test.
jrhemstad e603fb1
Add examples.
jrhemstad dc762e5
Echo command to clone PR on failure.
jrhemstad bed0bff
Factor image name into environment variable.
jrhemstad 121e8b1
Pass build and test job images as inputs.
jrhemstad f025df2
Fix notice syntax.
jrhemstad adeebed
Update CUDA11.0 to 11.1 in matrix.
jrhemstad e6f34a6
Explicitly check exit code from script.
jrhemstad 0b4a733
Update to exit with the exit code on error.
jrhemstad ed32d99
Add repro instructions.
jrhemstad 7478f9c
Update repro instructions.
jrhemstad f12daca
Update clone instruction to recurse submodules.
jrhemstad eb3778f
Don't use host networking.
jrhemstad fe1b66c
Disable test jobs for now.
jrhemstad 65c328c
Update devcontainers.
jrhemstad 69f45d6
Update devcontainers.
jrhemstad 33bde08
Add launch script and repro instructions.
jrhemstad 773c4a8
Update repro message.
jrhemstad bb785b1
Add repro instructions.
jrhemstad 437965a
Add libcu++ build job.
jrhemstad c542f6f
typo
jrhemstad 9d122cd
Merge pull request #99 from jrhemstad/monorepo-workflow
jrhemstad 9850287
Merge pull request #105 from NVIDIA/add_devcontainers
jrhemstad faf9cc9
Update the libcu++ submodule
miscco 43884f1
Fix test issues with libcu++
miscco f8e1511
Add fix fo gcc-7
miscco 68e80ad
Incorporate fix for old nvcc and old gcc
miscco 2ac1397
Update CUB to prepare for repo unification.
alliepiper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea/ | ||
*build*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[submodule "libcudacxx"] | ||
path = libcudacxx | ||
url = ../libcudacxx.git | ||
[submodule "cub"] | ||
path = cub | ||
url = ../cub | ||
[submodule "thrust"] | ||
path = thrust | ||
url = ../thrust |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# 3.15 is the minimum for including the project with add_subdirectory. | ||
# 3.21 is the minimum for the developer build. | ||
cmake_minimum_required(VERSION 3.15) | ||
|
||
# Determine whether CCCL is the top-level project or included into | ||
# another project via add_subdirectory() | ||
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}") | ||
alliepiper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
set(CCCL_TOPLEVEL_PROJECT ON) | ||
else() | ||
set(CCCL_TOPLEVEL_PROJECT OFF) | ||
endif() | ||
|
||
# TODO find_package for add_subdir usecases, use components for subprojects. | ||
alliepiper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
project(CCCL NONE) | ||
|
||
# Optionally include installation rules for non-top-level builds: | ||
option(CCCL_ENABLE_INSTALL_RULES "Enable installation of CCCL." ${CCCL_TOPLEVEL_PROJECT}) | ||
if (CCCL_ENABLE_INSTALL_RULES) | ||
include(cmake/CCCLInstallRules.cmake) | ||
endif() | ||
|
||
# Support adding Thrust to a parent project via add_subdirectory. | ||
alliepiper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# See examples/cmake/add_subdir/CMakeLists.txt for details. | ||
if (NOT CCCL_TOPLEVEL_PROJECT) | ||
include(cmake/CCCLAddSubdir.cmake) | ||
return() | ||
endif() | ||
|
||
# We require a higher cmake version for dev builds | ||
cmake_minimum_required(VERSION 3.21) | ||
|
||
option(CCCL_ENABLE_LIBCUDACXX "Enable the libcu++ developer build." ON) | ||
option(CCCL_ENABLE_CUB "Enable the CUB developer build." ON) | ||
option(CCCL_ENABLE_THRUST "Enable the Thrust developer build." ON) | ||
option(CCCL_ENABLE_TESTING "Enable CUDA C++ Core Library tests." ON) | ||
|
||
include(CTest) | ||
enable_testing() | ||
|
||
if (CCCL_ENABLE_LIBCUDACXX) | ||
add_subdirectory(libcudacxx) | ||
endif() | ||
|
||
if (CCCL_ENABLE_CUB) | ||
add_subdirectory(cub) | ||
endif() | ||
|
||
if (CCCL_ENABLE_THRUST) | ||
add_subdirectory(thrust) | ||
endif() | ||
|
||
if (CCCL_ENABLE_TESTING) | ||
add_subdirectory(test) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
find_package(CCCL REQUIRED CONFIG | ||
alliepiper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
NO_DEFAULT_PATH # Only check the explicit path in HINTS: | ||
HINTS "${CCCL_SOURCE_DIR}" | ||
COMPONENTS ${CCCL_REQUIRED_COMPONENTS} | ||
OPTIONAL_COMPONENTS ${CCCL_OPTIONAL_COMPONENTS} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Bring in CMAKE_INSTALL_LIBDIR | ||
include(GNUInstallDirs) | ||
|
||
# CCCL has no installable binaries, no need to build before installing: | ||
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE) | ||
|
||
install(DIRECTORY "${CCCL_SOURCE_DIR}/share/cmake/cccl" | ||
alliepiper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/" | ||
PATTERN *.cmake.in EXCLUDE | ||
) |
Submodule libcudacxx
added at
c9a2d6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# TODO How should we encode this as a source of truth? | ||
set(CCCL_VERSION_MAJOR 2) | ||
set(CCCL_VERSION_MINOR 2) | ||
set(CCCL_VERSION_PATCH 0) | ||
set(CCCL_VERSION_TWEAK 0) | ||
|
||
set(CCCL_VERSION "${CCCL_VERSION_MAJOR}.${CCCL_VERSION_MINOR}.${CCCL_VERSION_PATCH}.${CCCL_VERSION_TWEAK}") | ||
|
||
set(PACKAGE_VERSION ${CCCL_VERSION}) | ||
set(PACKAGE_VERSION_COMPATIBLE FALSE) | ||
set(PACKAGE_VERSION_EXACT FALSE) | ||
set(PACKAGE_VERSION_UNSUITABLE FALSE) | ||
|
||
# Semantic versioning: | ||
if(PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION) | ||
if(CCCL_VERSION_MAJOR VERSION_EQUAL PACKAGE_FIND_VERSION_MAJOR) | ||
set(PACKAGE_VERSION_COMPATIBLE TRUE) | ||
alliepiper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
endif() | ||
|
||
if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) | ||
set(PACKAGE_VERSION_EXACT TRUE) | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# | ||
# find_package(CCCL) config file. | ||
# | ||
# Imports the Thrust, CUB, and libcudacxx components of the NVIDIA | ||
# CUDA/C++ Core Libraries. | ||
|
||
unset(cccl_version) # TODO | ||
alliepiper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
set(cccl_cmake_dir "${CMAKE_CURRENT_LIST_DIR}") | ||
|
||
if (${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) | ||
set(cccl_quiet_flag "QUIET") | ||
else() | ||
set(cccl_quiet_flag "") | ||
endif() | ||
|
||
foreach(component ${${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS}) | ||
alliepiper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
unset(req) | ||
alliepiper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED_${component}) | ||
set(cccl_comp_required_flag "REQUIRED") | ||
endif() | ||
|
||
if(component STREQUAL "libcudacxx") | ||
alliepiper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
find_package(libcudacxx ${cccl_version} CONFIG | ||
${cccl_quiet_flag} | ||
${cccl_comp_required_flag} | ||
NO_DEFAULT_PATH # Only check the explicit HINTS below: | ||
HINTS | ||
"${cccl_cmake_dir}/../../../libcudacxx/lib/cmake/" # Source layout (GitHub) | ||
"${cccl_cmake_dir}/.." # Install layout | ||
) | ||
elseif(component STREQUAL "CUB") | ||
find_package(CUB ${cccl_version} CONFIG | ||
${cccl_quiet_flag} | ||
${cccl_comp_required_flag} | ||
NO_DEFAULT_PATH # Only check the explicit HINTS below: | ||
HINTS | ||
"${cccl_cmake_dir}/../../../cub/cub/cmake/" # Source layout (GitHub) | ||
"${cccl_cmake_dir}/.." # Install layout | ||
) | ||
elseif(component STREQUAL "Thrust") | ||
find_package(Thrust ${cccl_version} CONFIG | ||
${cccl_quiet_flag} | ||
${cccl_comp_required_flag} | ||
NO_DEFAULT_PATH # Only check the explicit HINTS below: | ||
HINTS | ||
"${cccl_cmake_dir}/../../../thrust/thrust/cmake/" # Source layout (GitHub) | ||
"${cccl_cmake_dir}/.." # Install layout | ||
) | ||
else() | ||
message(FATAL_ERROR "Invalid CCCL component requested: '${component}'") | ||
endif() | ||
endforeach() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
if (NOT CCCL_CONFIG) | ||
set(CCCL_CONFIG "${CMAKE_CURRENT_LIST_FILE}") | ||
endif() | ||
find_package_handle_standard_args(CCCL CONFIG_MODE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_subdirectory(cmake) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
set(cmake_opts | ||
-D "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" | ||
-D "CMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}" | ||
-D "CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" | ||
) | ||
|
||
# Temporary installation prefix for tests against installed project: | ||
set(tmp_install_prefix "${CMAKE_CURRENT_BINARY_DIR}/test_install") | ||
|
||
# Add a build-and-test CTest. | ||
# - full_test_name_var will be set to the full name of the test. | ||
# - subdir is the relative path to the test project directory. | ||
# - test_id is used to generate a unique name for this test, allowing the | ||
# subdir to be reused. | ||
# - Any additional args will be passed to the project configure step. | ||
function(cccl_add_compile_test full_test_name_var subdir test_id) | ||
set(test_name cccl.test.cmake.${subdir}.${test_id}) | ||
set(src_dir "${CMAKE_CURRENT_SOURCE_DIR}/${subdir}") | ||
set(build_dir "${CMAKE_CURRENT_BINARY_DIR}/${subdir}/${test_id}") | ||
add_test(NAME ${test_name} | ||
COMMAND "${CMAKE_CTEST_COMMAND}" | ||
--build-and-test "${src_dir}" "${build_dir}" | ||
--build-generator "${CMAKE_GENERATOR}" | ||
--build-options | ||
${cmake_opts} | ||
${ARGN} | ||
--test-command "${CMAKE_CTEST_COMMAND}" --output-on-failure | ||
) | ||
set(${full_test_name_var} ${test_name} PARENT_SCOPE) | ||
endfunction() | ||
|
||
foreach (root_type IN ITEMS SOURCE INSTALL) | ||
if (root_type STREQUAL "INSTALL") | ||
set(cccl_root "${tmp_install_prefix}") | ||
else() | ||
set(cccl_root "${CCCL_SOURCE_DIR}") | ||
endif() | ||
|
||
foreach (components IN ITEMS DEFAULT Thrust CUB libcudacxx) | ||
set(package_types CCCL) | ||
if (NOT components STREQUAL "DEFAULT") | ||
list(APPEND package_types NATIVE) | ||
endif() | ||
if (root_type STREQUAL "SOURCE") | ||
list(APPEND package_types SUBDIR) | ||
endif() | ||
foreach (package_type IN LISTS package_types) | ||
string(TOLOWER "${root_type}.${package_type}.${components}" suffix) | ||
cccl_add_compile_test(test_name | ||
test_export | ||
"${suffix}" | ||
-D "CCCL_ROOT=${cccl_root}" | ||
-D "ROOT_TYPE=${root_type}" | ||
-D "COMPONENTS=${components}" | ||
-D "PACKAGE_TYPE=${package_type}" | ||
) | ||
|
||
if (root_type STREQUAL "INSTALL") | ||
set_tests_properties(${test_name} PROPERTIES FIXTURES_REQUIRED install_tree) | ||
endif() | ||
endforeach() # package_type | ||
endforeach() # components | ||
endforeach() # root_type | ||
|
||
################################################################################ | ||
# Install tree fixtures | ||
add_test(NAME cccl.test.cmake.install_tree.install | ||
COMMAND "${CMAKE_COMMAND}" | ||
--install "${CCCL_BINARY_DIR}" | ||
--prefix "${tmp_install_prefix}" | ||
) | ||
set_tests_properties(cccl.test.cmake.install_tree.install PROPERTIES | ||
FIXTURES_SETUP install_tree | ||
) | ||
|
||
add_test(NAME cccl.test.cmake.install_tree.cleanup | ||
COMMAND "${CMAKE_COMMAND}" -E rm -rf "${tmp_install_prefix}" | ||
) | ||
set_tests_properties(cccl.test.cmake.install_tree.cleanup PROPERTIES | ||
FIXTURES_CLEANUP install_tree | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Update to add a copyright header.
I'll add the text we need.