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

Fixes for Python 3.7 docs environment #3206

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions docs/cuda_parallel/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ CUDA Parallel
Python exposure of parallel algorithms is in public beta.
The API is subject to change without notice.

Algorithms
----------

.. automodule:: cuda.parallel.experimental.algorithms
:members:
:undoc-members:
:imported-members:

Iterators
---------

.. automodule:: cuda.parallel.experimental.iterators
:members:
:undoc-members:
Expand Down
12 changes: 10 additions & 2 deletions python/cuda_parallel/cuda/parallel/experimental/_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import os
import shutil
from importlib.resources import files, as_file
import ctypes
from functools import lru_cache
from typing import List, Optional
Expand All @@ -31,6 +30,10 @@ def _get_cuda_path() -> Optional[str]:

@lru_cache()
def get_bindings() -> ctypes.CDLL:
# TODO: once docs env supports Python >= 3.9, we
# can move this to a module-level import.
from importlib.resources import as_file, files

with as_file(files("cuda.parallel.experimental")) as f:
cccl_c_path = str(f / "cccl" / "libcccl.c.parallel.so")
_bindings = ctypes.CDLL(cccl_c_path)
Expand All @@ -52,13 +55,18 @@ def get_bindings() -> ctypes.CDLL:

@lru_cache()
def get_paths() -> List[bytes]:
# TODO: once docs env supports Python >= 3.9, we
# can move this to a module-level import.
from importlib.resources import as_file, files

with as_file(files("cuda.parallel")) as f:
# Using `.parent` for compatibility with pip install --editable:
cub_include_path = str(f.parent / "_include")
thrust_include_path = cub_include_path
libcudacxx_include_path = str(os.path.join(cub_include_path, "libcudacxx"))
cuda_include_path = None
if cuda_path := _get_cuda_path():
cuda_path = _get_cuda_path()
if cuda_path is not None:
cuda_include_path = str(os.path.join(cuda_path, "include"))
paths = [
f"-I{path}".encode()
Expand Down
Loading