Skip to content

Commit

Permalink
rename cuda.py to cuda.core
Browse files Browse the repository at this point in the history
  • Loading branch information
leofang committed Oct 5, 2024
1 parent 7770a63 commit d765fb7
Show file tree
Hide file tree
Showing 24 changed files with 49 additions and 49 deletions.
1 change: 1 addition & 0 deletions cuda_core/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include cuda/core *.pyx *.pxd
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions cuda_core/cuda/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

from cuda.core._compiler import Compiler
from cuda.core._device import Device
from cuda.core._event import EventOptions
from cuda.core._launcher import LaunchConfig, launch
from cuda.core._stream import Stream, StreamOptions
from cuda.core._version import __version__
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

from cuda import nvrtc
from cuda.py._utils import handle_return
from cuda.py._module import Module
from cuda.core._utils import handle_return
from cuda.core._module import Module


class Compiler:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from dataclasses import dataclass

from cuda import cuda, cudart
from cuda.py._utils import handle_return
from cuda.core._utils import handle_return


@dataclass
Expand Down
10 changes: 5 additions & 5 deletions cuda_py/cuda/py/_device.py → cuda_core/cuda/core/_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import warnings

from cuda import cuda, cudart
from cuda.py._utils import handle_return, ComputeCapability, CUDAError, \
from cuda.core._utils import handle_return, ComputeCapability, CUDAError, \
precondition
from cuda.py._context import Context, ContextOptions
from cuda.py._memory import _DefaultAsyncMempool, Buffer, MemoryResource
from cuda.py._stream import default_stream, Stream, StreamOptions
from cuda.core._context import Context, ContextOptions
from cuda.core._memory import _DefaultAsyncMempool, Buffer, MemoryResource
from cuda.core._stream import default_stream, Stream, StreamOptions


_tls = threading.local()
Expand Down Expand Up @@ -125,7 +125,7 @@ def use(self, ctx: Context=None) -> Union[Context, None]:
Entry point of this object. Users always start a code by
calling this method, e.g.
>>> from cuda.py import Device
>>> from cuda.core import Device
>>> dev0 = Device(0)
>>> dev0.use()
>>> # ... do work on device 0 ...
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions cuda_py/cuda/py/_event.py → cuda_core/cuda/core/_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from typing import Optional

from cuda import cuda
from cuda.py._utils import check_or_create_options
from cuda.py._utils import CUDAError
from cuda.py._utils import handle_return
from cuda.core._utils import check_or_create_options
from cuda.core._utils import CUDAError
from cuda.core._utils import handle_return


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import numpy as np

from cuda import cuda, cudart
from cuda.py._utils import CUDAError, check_or_create_options, handle_return
from cuda.py._memory import Buffer
from cuda.py._module import Kernel
from cuda.py._stream import Stream
from cuda.core._utils import CUDAError, check_or_create_options, handle_return
from cuda.core._memory import Buffer
from cuda.core._module import Kernel
from cuda.core._stream import Stream


@dataclass
Expand Down
6 changes: 3 additions & 3 deletions cuda_py/cuda/py/_memory.py → cuda_core/cuda/core/_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import warnings

from cuda import cuda
from cuda.py._dlpack import DLDeviceType, make_py_capsule
from cuda.py._stream import default_stream
from cuda.py._utils import handle_return
from cuda.core._dlpack import DLDeviceType, make_py_capsule
from cuda.core._stream import default_stream
from cuda.core._utils import handle_return


PyCapsule = TypeVar("PyCapsule")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ from typing import Any, Optional
from cuda import cuda
import numpy

from cuda.py._utils import handle_return
from cuda.core._utils import handle_return


# TODO(leofang): support NumPy structured dtypes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

from cuda import cuda, cudart
from cuda.py._utils import handle_return
from cuda.core._utils import handle_return


_backend = {
Expand Down
14 changes: 7 additions & 7 deletions cuda_py/cuda/py/_stream.py → cuda_core/cuda/core/_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
from typing import Optional, Tuple, TYPE_CHECKING, Union

if TYPE_CHECKING:
from cuda.py._device import Device
from cuda.core._device import Device
from cuda import cuda, cudart
from cuda.py._context import Context
from cuda.py._event import Event, EventOptions
from cuda.py._utils import check_or_create_options
from cuda.py._utils import get_device_from_ctx
from cuda.py._utils import handle_return
from cuda.core._context import Context
from cuda.core._event import Event, EventOptions
from cuda.core._utils import check_or_create_options
from cuda.core._utils import get_device_from_ctx
from cuda.core._utils import handle_return


@dataclass
Expand Down Expand Up @@ -181,7 +181,7 @@ def device(self) -> Device:
# Note that Stream.device.context might not necessarily agree with
# Stream.context, in cases where a different CUDA context is set
# current after a stream was created.
from cuda.py._device import Device # avoid circular import
from cuda.core._device import Device # avoid circular import
if self._device_id is None:
# Get the stream context first
if self._ctx_handle is None:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions cuda_core/cuda/core/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from cuda.core._memoryview import GPUMemoryView, viewable
8 changes: 4 additions & 4 deletions cuda_py/pyproject.toml → cuda_core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ build-backend = "setuptools.build_meta"


[project]
name = "cuda-py"
name = "cuda-core"
dynamic = [
"version",
"readme",
]
requires-python = '>=3.9'
description = "cuda.py: (experimental) pythonic CUDA module"
description = "cuda.core: (experimental) pythonic CUDA module"
authors = [
{ name = "NVIDIA Corporation" }
]
Expand Down Expand Up @@ -44,9 +44,9 @@ classifiers = [


[tool.setuptools]
packages = ["cuda", "cuda.py"]
packages = ["cuda", "cuda.core"]


[tool.setuptools.dynamic]
version = { attr = "cuda.py._version.__version__" }
version = { attr = "cuda.core._version.__version__" }
readme = { file = ["README.md"], content-type = "text/markdown" }
12 changes: 6 additions & 6 deletions cuda_py/setup.py → cuda_core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

ext_modules = (
Extension(
"cuda.py._dlpack",
sources=["cuda/py/_dlpack.pyx"],
"cuda.core._dlpack",
sources=["cuda/core/_dlpack.pyx"],
language="c++",
),
Extension(
"cuda.py._memoryview",
sources=["cuda/py/_memoryview.pyx"],
"cuda.core._memoryview",
sources=["cuda/core/_memoryview.pyx"],
language="c++",
),
)
Expand All @@ -24,9 +24,9 @@
ext_modules=cythonize(ext_modules,
verbose=True, language_level=3,
compiler_directives={'embedsignature': True}),
packages=find_packages(include=['cuda.py', 'cuda.py.*']),
packages=find_packages(include=['cuda.core', 'cuda.core.*']),
package_data=dict.fromkeys(
find_packages(include=["cuda.py.*"]),
find_packages(include=["cuda.core.*"]),
["*.pxd", "*.pyx", "*.py"],
),
zip_safe=False,
Expand Down
1 change: 0 additions & 1 deletion cuda_py/MANIFEST.in

This file was deleted.

10 changes: 0 additions & 10 deletions cuda_py/cuda/py/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion cuda_py/cuda/py/utils.py

This file was deleted.

0 comments on commit d765fb7

Please sign in to comment.