Skip to content

Commit

Permalink
Introduce cuda.parallel module (#2276)
Browse files Browse the repository at this point in the history
  • Loading branch information
gevtushenko authored Aug 23, 2024
1 parent 529f910 commit d62e979
Show file tree
Hide file tree
Showing 16 changed files with 604 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/actions/docs-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ runs:
cp -rf ./docs/_build/docs/cudax/latest/* _site/cudax
mkdir _site/cuda_cooperative
cp -rf ./docs/_build/docs/cuda_cooperative/latest/* _site/cuda_cooperative
mkdir _site/cuda_parallel
cp -rf ./docs/_build/docs/cuda_parallel/latest/* _site/cuda_parallel
./docs/scrape_docs.bash ./_site
# Update docs as workflow artifact:
Expand Down
8 changes: 4 additions & 4 deletions c/include/cccl/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ struct cccl_type_info

enum class cccl_op_kind_t
{
stateless,
stateful
stateless = 0,
stateful = 1
};

struct cccl_op_t
Expand All @@ -61,8 +61,8 @@ struct cccl_op_t

enum class cccl_iterator_kind_t
{
pointer,
iterator
pointer = 0,
iterator = 1
};

struct cccl_value_t
Expand Down
6 changes: 4 additions & 2 deletions ci/update_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ CUB_CMAKE_VERSION_FILE="cub/cub/cmake/cub-config-version.cmake"
LIBCUDACXX_CMAKE_VERSION_FILE="libcudacxx/lib/cmake/libcudacxx/libcudacxx-config-version.cmake"
THRUST_CMAKE_VERSION_FILE="thrust/thrust/cmake/thrust-config-version.cmake"
CUDAX_CMAKE_VERSION_FILE="cudax/lib/cmake/cudax/cudax-config-version.cmake"
PYCUDA_VERSION_FILE="python/cuda_cooperative/cuda/cooperative/_version.py"
CUDA_COOPERATIVE_VERSION_FILE="python/cuda_cooperative/cuda/cooperative/_version.py"
CUDA_PARALLEL_VERSION_FILE="python/cuda_parallel/cuda/parallel/_version.py"

# Calculated version codes
new_cccl_version=$((major * 1000000 + minor * 1000 + patch)) # MMMmmmppp
Expand Down Expand Up @@ -102,7 +103,8 @@ update_file "$CUDAX_CMAKE_VERSION_FILE" "set(cudax_VERSION_MAJOR \([0-9]\+\))" "
update_file "$CUDAX_CMAKE_VERSION_FILE" "set(cudax_VERSION_MINOR \([0-9]\+\))" "set(cudax_VERSION_MINOR $minor)"
update_file "$CUDAX_CMAKE_VERSION_FILE" "set(cudax_VERSION_PATCH \([0-9]\+\))" "set(cudax_VERSION_PATCH $patch)"

update_file "$PYCUDA_VERSION_FILE" "^__version__ = \"\([0-9.]\+\)\"" "__version__ = \"$pymajor.$pyminor.$major.$minor.$patch\""
update_file "$CUDA_COOPERATIVE_VERSION_FILE" "^__version__ = \"\([0-9.]\+\)\"" "__version__ = \"$pymajor.$pyminor.$major.$minor.$patch\""
update_file "$CUDA_PARALLEL_VERSION_FILE" "^__version__ = \"\([0-9.]\+\)\"" "__version__ = \"$pymajor.$pyminor.$major.$minor.$patch\""

if [ "$DRY_RUN" = true ]; then
echo "Dry run completed. No changes made."
Expand Down
13 changes: 13 additions & 0 deletions docs/cuda_parallel/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. _cuda_parallel-module:

CUDA Parallel
==================================================

.. warning::
Python exposure of parallel algorithms is in public beta.
The API is subject to change without notice.

.. automodule:: cuda.parallel.experimental
:members:
:undoc-members:
:imported-members:
4 changes: 4 additions & 0 deletions docs/python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ CUDA Python Core Libraries
:maxdepth: 3

cuda.cooperative <https://nvidia.github.io/cccl/cuda_cooperative/>
cuda.parallel <https://nvidia.github.io/cccl/cuda_parallel/>

Welcome to the CUDA Core Compute Libraries (CCCL) libraries for Python.

- `cuda.cooperative <https://nvidia.github.io/cccl/cuda_cooperative/>`__
is a still-experimental library exposing cooperative algorithms to Python.

- `cuda.parallel <https://nvidia.github.io/cccl/cuda_parallel/>`__
is a still-experimental library exposing parallel algorithms to Python.
26 changes: 25 additions & 1 deletion docs/repo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ sphinx_exclude_patterns = [
"VERSION.md",
]

project_build_order = [ "libcudacxx", "cudax", "cub", "thrust", "cccl", "cuda_cooperative" ]
project_build_order = [ "libcudacxx", "cudax", "cub", "thrust", "cccl", "cuda_cooperative", "cuda_parallel" ]

# deps can be used to link to other projects' documentation
deps = [
[ "libcudacxx", "_build/docs/libcudacxx/latest" ],
[ "cub", "_build/docs/cub/latest" ],
[ "thrust", "_build/docs/thrust/latest" ],
[ "cuda_cooperative", "_build/docs/cuda_cooperative/latest" ],
[ "cuda_parallel", "_build/docs/cuda_parallel/latest" ],
]

[repo_docs.projects.libcudacxx]
Expand Down Expand Up @@ -304,6 +305,29 @@ python_paths = [
"${root}/../python/cuda_cooperative"
]

[repo_docs.projects.cuda_parallel]
name = "cuda.parallel"
docs_root = "cuda_parallel"
logo = "../img/logo.png"

repo_url = "https://github.com/NVIDIA/cccl/python/cuda"
social_media_set = ""
social_media = [
[ "github", "https://github.com/NVIDIA/cccl" ],
]

autodoc.mock_imports = [
"numba",
"pynvjitlink",
"cuda.nvrtc",
"llvmlite"
]

enhanced_search_enabled = true
python_paths = [
"${root}/../python/cuda_parallel"
]

[repo_docs.projects.cudax]
name = "Cudax: Experimental new features"
docs_root = "cudax"
Expand Down
4 changes: 4 additions & 0 deletions python/cuda_parallel/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cuda/_include
env
*egg-info
*so
1 change: 1 addition & 0 deletions python/cuda_parallel/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include cuda/_include *
12 changes: 12 additions & 0 deletions python/cuda_parallel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# `cuda.parallel`: Experimental CUDA Core Compute Library for Python

## Documentation

Please visit the documentation here: https://nvidia.github.io/cccl/python.html.

## Local development

```bash
pip3 install -e .[test]
pytest -v ./tests/
```
6 changes: 6 additions & 0 deletions python/cuda_parallel/cuda/parallel/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

import cuda.parallel.experimental
from cuda.parallel._version import __version__
7 changes: 7 additions & 0 deletions python/cuda_parallel/cuda/parallel/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# This file is generated by ci/update_version.sh
# Do not edit this file manually.
__version__ = "0.1.2.6.0"
Loading

0 comments on commit d62e979

Please sign in to comment.