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

Transition build system of cuda_cccl to scikit-build-core #3597

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
4 changes: 3 additions & 1 deletion python/cuda_cccl/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
cuda/cccl/include
build
dist
*egg-info
*~
31 changes: 31 additions & 0 deletions python/cuda_cccl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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)

install(
DIRECTORY ${CUB_SOURCE_DIR}/cub
DESTINATION ${_dest_incl_dir}
)
install(
DIRECTORY ${Thrust_SOURCE_DIR}/thrust
DESTINATION ${_dest_incl_dir}
)
install(
DIRECTORY ${libcudacxx_SOURCE_DIR}/include
DESTINATION ${_dest_incl_dir}
)
1 change: 1 addition & 0 deletions python/cuda_cccl/LICENSE
Empty file.
1 change: 1 addition & 0 deletions python/cuda_cccl/cuda/cccl/include/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Intentionally empty
2 changes: 1 addition & 1 deletion python/cuda_cccl/cuda/cccl/include_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_include_paths() -> IncludePaths:

return IncludePaths(
cuda=cuda_incl,
libcudacxx=cccl_incl / "libcudacxx",
libcudacxx=cccl_incl,
cub=cccl_incl,
thrust=cccl_incl,
)
38 changes: 30 additions & 8 deletions python/cuda_cccl/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,49 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

[build-system]
requires = ["setuptools>=61.0.0"]
build-backend = "setuptools.build_meta"
requires = ["scikit-build-core>=0.10", "setuptools"]
build-backend = "scikit_build_core.build"

[project]
name = "cuda-cccl"
dynamic = ["version"]
description = "Experimental Package with CCCL headers to support JIT compilation"
authors = [{ name = "NVIDIA Corporation" }]
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Environment :: GPU :: NVIDIA CUDA",
"License :: OSI Approved :: Apache Software License",
]
license-files = ["LICENSE"]
requires-python = ">=3.9"
dynamic = ["version", "readme"]
readme = { file = "README.md", content-type = "text/markdown" }

[project.urls]
Homepage = "https://github.com/NVIDIA/cccl"

[tool.setuptools.dynamic]
version = { attr = "cuda.cccl._version.__version__" }
readme = { file = ["README.md"], content-type = "text/markdown" }
[tool.scikit-build]
minimum-version = "build-system.requires"
build-dir = "build/{wheel_tag}"

[tool.setuptools.package-data]
cuda = ["cccl/include/**/*"]
[tool.scikit-build.cmake]
version = ">=3.21"
args = []
build-type = "Release"
source-dir = "."

[tool.scikit-build.ninja]
version = ">=1.11"
make-fallback = true

[tool.scikit-build.wheel]
py-api = "py3"
platlib = ""

[tool.scikit-build.wheel.packages]
"cuda" = "cuda"
"cuda/cccl" = "cuda/cccl"

[tool.scikit-build.metadata.version]
provider = "scikit_build_core.metadata.regex"
input = "cuda/cccl/_version.py"
# use default regex
51 changes: 0 additions & 51 deletions python/cuda_cccl/setup.py

This file was deleted.

21 changes: 21 additions & 0 deletions python/cuda_cccl/test/test_cuda_cccl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import cuda.cccl as c4l
oleksandr-pavlyk marked this conversation as resolved.
Show resolved Hide resolved


def test_headers():
inc_paths = c4l.get_include_paths()
assert hasattr(inc_paths, "cuda")
assert hasattr(inc_paths, "cub")
assert hasattr(inc_paths, "libcudacxx")
assert hasattr(inc_paths, "thrust")
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_version():
v = c4l.__version__
assert isinstance(v, str)
Loading