-
Notifications
You must be signed in to change notification settings - Fork 188
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
Transition build system of cuda_cccl and cuda_parallel to scikit-build-core #3597
Merged
shwina
merged 8 commits into
NVIDIA:main
from
oleksandr-pavlyk:transition-cuda-cccl-to-scikit-build-core
Feb 3, 2025
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f3fbf3a
Rewrite of cuda_cccl build system
oleksandr-pavlyk c000604
Make project.version metadata dynamic
oleksandr-pavlyk b2be856
Delete existing cuda_cccl
oleksandr-pavlyk dd191f7
Rename new_cuda_cccl to cuda_cccl to become ready to open a PR
oleksandr-pavlyk a00a02f
Fix build break
oleksandr-pavlyk 792fd5d
Expand tests for cuda_cccl
oleksandr-pavlyk d392111
Change cuda_parallel over to use scikit-build-core
oleksandr-pavlyk 8e76841
Delete unused _setup.py
oleksandr-pavlyk 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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
cuda/cccl/include | ||
build | ||
dist | ||
*egg-info | ||
*~ |
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,35 @@ | ||
cmake_minimum_required(VERSION 3.21...3.31 FATAL_ERROR) | ||
|
||
# include_guard(GLOBAL) | ||
|
||
project( | ||
CCCL_HEADERS | ||
VERSION ${SKBUILD_PROJECT_VERSION} | ||
LANGUAGES C CXX | ||
DESCRIPTION "Headers of NVIDIA CUDA Core Compute Libraries" | ||
) | ||
|
||
add_subdirectory(../.. _parent_cccl) | ||
|
||
find_package(CUB REQUIRED) | ||
find_package(Thrust REQUIRED) | ||
find_package(libcudacxx REQUIRED) | ||
|
||
set(_dest_incl_dir cuda/cccl/include) | ||
|
||
# No end slash: create ${_dest_inc_dir}/cub | ||
install( | ||
DIRECTORY ${CUB_SOURCE_DIR}/cub | ||
DESTINATION ${_dest_incl_dir} | ||
) | ||
# No end slash: create ${_dest_inc_dir}/thrust | ||
install( | ||
DIRECTORY ${Thrust_SOURCE_DIR}/thrust | ||
DESTINATION ${_dest_incl_dir} | ||
) | ||
# Slash at the end: copy content of | ||
# include/ into ${_dest_inc_dir}/ | ||
install( | ||
DIRECTORY ${libcudacxx_SOURCE_DIR}/include/ | ||
DESTINATION ${_dest_incl_dir} | ||
) |
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 @@ | ||
../../LICENSE |
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 @@ | ||
# Intentionally empty |
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
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
This file was deleted.
Oops, something went wrong.
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,63 @@ | ||
import pytest | ||
from cuda import cccl | ||
|
||
|
||
def test_version(): | ||
v = cccl.__version__ | ||
assert isinstance(v, str) | ||
|
||
|
||
@pytest.fixture | ||
def inc_paths(): | ||
return cccl.get_include_paths() | ||
|
||
|
||
def test_headers_has_cuda(inc_paths): | ||
assert hasattr(inc_paths, "cuda") | ||
|
||
|
||
def test_headers_has_cub(inc_paths): | ||
assert hasattr(inc_paths, "cub") | ||
|
||
|
||
def test_headers_has_cudacxx(inc_paths): | ||
assert hasattr(inc_paths, "libcudacxx") | ||
|
||
|
||
def test_headers_has_thrust(inc_paths): | ||
assert hasattr(inc_paths, "thrust") | ||
|
||
|
||
def test_headers_as_tuple(inc_paths): | ||
tpl = inc_paths.as_tuple() | ||
assert len(tpl) == 4 | ||
|
||
thrust_, cub_, cudacxx_, cuda_ = tpl | ||
assert cuda_ == inc_paths.cuda | ||
assert cub_ == inc_paths.cub | ||
assert cudacxx_ == inc_paths.libcudacxx | ||
assert thrust_ == inc_paths.thrust | ||
|
||
|
||
def test_cub_version(inc_paths): | ||
cub_dir = inc_paths.cub / "cub" | ||
cub_version = cub_dir / "version.cuh" | ||
assert cub_version.exists() | ||
|
||
|
||
def test_thrust_version(inc_paths): | ||
thrust_dir = inc_paths.thrust / "thrust" | ||
thrust_version = thrust_dir / "version.h" | ||
assert thrust_version.exists() | ||
|
||
|
||
def test_cudacxx_version(inc_paths): | ||
cudacxx_dir = inc_paths.libcudacxx / "cuda" | ||
cudacxx_version = cudacxx_dir / "version" | ||
assert cudacxx_version.exists() | ||
|
||
|
||
def test_nv_target(inc_paths): | ||
nv_dir = inc_paths.libcudacxx / "nv" | ||
nv_target = nv_dir / "target" | ||
assert nv_target.exists() |
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,24 @@ | ||
cmake_minimum_required(VERSION 3.21) | ||
|
||
project( | ||
cuda_parallel | ||
# VERSION ${SKBUILD_PROJECT_VERSION} | ||
DESCRIPTION "Python package cuda_parallel" | ||
LANGUAGES CUDA CXX | ||
) | ||
|
||
set(_cccl_root ../..) | ||
|
||
include(${_cccl_root}/cmake/AppendOptionIfAvailable.cmake) | ||
include(${_cccl_root}/cmake/CCCLConfigureTarget.cmake) | ||
include(${_cccl_root}/cmake/CCCLBuildCompilerTargets.cmake) | ||
cccl_build_compiler_targets() | ||
|
||
set(CCCL_ENABLE_C ON) | ||
set(CCCL_C_PARALLEL_LIBRARY_OUTPUT_DIRECTORY ${SKBUILD_PROJECT_NAME}) | ||
add_subdirectory(${_cccl_root} _parent_cccl) | ||
|
||
install( | ||
TARGETS cccl.c.parallel | ||
DESTINATION cuda/parallel/experimental/cccl | ||
) |
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 @@ | ||
../../LICENSE |
Empty file.
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
This file was deleted.
Oops, something went wrong.
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.
Nice addition!
Is this run in the CI?
(For cuda_parallel and cuda_cooperative the tests are run from ci/test_python.sh)