Skip to content

Commit 4cbe183

Browse files
authored
Merge branch 'main' into prep-13.0.3-release
2 parents bfb2fca + 972ea4a commit 4cbe183

File tree

9 files changed

+52
-14
lines changed

9 files changed

+52
-14
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,12 @@ repos:
7878
hooks:
7979
- id: actionlint
8080

81+
- repo: https://github.com/MarcoGorelli/cython-lint
82+
rev: "d9ff7ce99ef4f2ae8fba93079ca9d76c4651d4ac" # frozen: v0.18.0
83+
hooks:
84+
- id: cython-lint
85+
args: [--no-pycodestyle]
86+
exclude: ^cuda_bindings/
87+
8188
default_language_version:
8289
python: python3

cuda_bindings/cuda/bindings/cyruntime_types.pxi.in

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,20 @@ cdef extern from "library_types.h":
15911591

15921592
ctypedef cudaEmulationStrategy_t cudaEmulationStrategy
15931593

1594+
cdef enum cudaEmulationMantissaControl_t:
1595+
CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC = 0
1596+
CUDA_EMULATION_MANTISSA_CONTROL_FIXED = 1
1597+
1598+
ctypedef cudaEmulationMantissaControl_t cudaEmulationMantissaControl
1599+
1600+
cdef enum cudaEmulationSpecialValuesSupport_t:
1601+
CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NONE = 0
1602+
CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_INFINITY = 1
1603+
CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NAN = 2
1604+
CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_DEFAULT = 65535
1605+
1606+
ctypedef cudaEmulationSpecialValuesSupport_t cudaEmulationSpecialValuesSupport
1607+
15941608
cdef enum libraryPropertyType_t:
15951609
MAJOR_VERSION = 0
15961610
MINOR_VERSION = 1

cuda_bindings/cuda/bindings/driver.pyx.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4822,7 +4822,8 @@ class CUmemPool_attribute(IntEnum):
48224822

48234823
#: (value type = int) Allow cuMemAllocAsync to insert new stream
48244824
#: dependencies in order to establish the stream ordering required to
4825-
#: reuse a piece of memory released by cuFreeAsync (default enabled).
4825+
#: reuse a piece of memory released by cuMemFreeAsync (default
4826+
#: enabled).
48264827
CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES = cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES{{endif}}
48274828
{{if 'CU_MEMPOOL_ATTR_RELEASE_THRESHOLD' in found_values}}
48284829

cuda_bindings/cuda/bindings/runtime.pyx.in

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,32 @@ class cudaEmulationStrategy(IntEnum):
15781578

15791579
_dict_cudaEmulationStrategy = dict(((int(v), v) for k, v in cudaEmulationStrategy.__members__.items()))
15801580
{{endif}}
1581+
{{if 'cudaEmulationMantissaControl_t' in found_types}}
1582+
1583+
class cudaEmulationMantissaControl(IntEnum):
1584+
""""""
1585+
{{if 'CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC' in found_values}}
1586+
CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC = cyruntime.cudaEmulationMantissaControl_t.CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC{{endif}}
1587+
{{if 'CUDA_EMULATION_MANTISSA_CONTROL_FIXED' in found_values}}
1588+
CUDA_EMULATION_MANTISSA_CONTROL_FIXED = cyruntime.cudaEmulationMantissaControl_t.CUDA_EMULATION_MANTISSA_CONTROL_FIXED{{endif}}
1589+
1590+
_dict_cudaEmulationMantissaControl = dict(((int(v), v) for k, v in cudaEmulationMantissaControl.__members__.items()))
1591+
{{endif}}
1592+
{{if 'cudaEmulationSpecialValuesSupport_t' in found_types}}
1593+
1594+
class cudaEmulationSpecialValuesSupport(IntEnum):
1595+
""""""
1596+
{{if 'CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NONE' in found_values}}
1597+
CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NONE = cyruntime.cudaEmulationSpecialValuesSupport_t.CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NONE{{endif}}
1598+
{{if 'CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_INFINITY' in found_values}}
1599+
CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_INFINITY = cyruntime.cudaEmulationSpecialValuesSupport_t.CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_INFINITY{{endif}}
1600+
{{if 'CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NAN' in found_values}}
1601+
CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NAN = cyruntime.cudaEmulationSpecialValuesSupport_t.CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NAN{{endif}}
1602+
{{if 'CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_DEFAULT' in found_values}}
1603+
CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_DEFAULT = cyruntime.cudaEmulationSpecialValuesSupport_t.CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_DEFAULT{{endif}}
1604+
1605+
_dict_cudaEmulationSpecialValuesSupport = dict(((int(v), v) for k, v in cudaEmulationSpecialValuesSupport.__members__.items()))
1606+
{{endif}}
15811607
{{if 'libraryPropertyType_t' in found_types}}
15821608

15831609
class libraryPropertyType(IntEnum):

cuda_bindings/docs/source/module/driver.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4851,7 +4851,7 @@ Data types used by CUDA driver
48514851
.. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES
48524852

48534853

4854-
(value type = int) Allow cuMemAllocAsync to insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released by cuFreeAsync (default enabled).
4854+
(value type = int) Allow cuMemAllocAsync to insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released by cuMemFreeAsync (default enabled).
48554855

48564856

48574857
.. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD

cuda_core/cuda/core/experimental/_context.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from dataclasses import dataclass
66

7-
from cuda.core.experimental._utils.clear_error_support import assert_type
87
from cuda.core.experimental._utils.cuda_utils import driver
98

109

cuda_core/cuda/core/experimental/_memory.pyx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ from cuda.core.experimental._utils.cuda_utils cimport (
2020
)
2121

2222
import abc
23-
import array
24-
import contextlib
2523
import cython
2624
from dataclasses import dataclass, field
2725
from typing import Iterable, Literal, Optional, TYPE_CHECKING, TypeVar, Union
@@ -34,9 +32,6 @@ from cuda.core.experimental._dlpack import DLDeviceType, make_py_capsule
3432
from cuda.core.experimental._stream import Stream
3533
from cuda.core.experimental._utils.cuda_utils import ( driver, Transaction, get_binding_version )
3634

37-
if platform.system() == "Linux":
38-
import socket
39-
4035
if TYPE_CHECKING:
4136
from ._device import Device
4237
import uuid

cuda_core/cuda/core/experimental/_memoryview.pyx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
cimport cython
6-
75
from ._dlpack cimport *
86

97
import functools
10-
from typing import Any, Optional
8+
from typing import Optional
119

1210
import numpy
1311

@@ -226,7 +224,7 @@ cdef class _StridedMemoryViewProxy:
226224

227225

228226
cdef StridedMemoryView view_as_dlpack(obj, stream_ptr, view=None):
229-
cdef int dldevice, device_id, i
227+
cdef int dldevice, device_id
230228
cdef bint is_device_accessible, is_readonly
231229
is_device_accessible = False
232230
dldevice, device_id = obj.__dlpack_device__()

cuda_core/cuda/core/experimental/_stream.pyx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ from cuda.core.experimental._utils.cuda_utils cimport (
1818
)
1919

2020
import cython
21-
import os
2221
import warnings
2322
from dataclasses import dataclass
2423
from typing import TYPE_CHECKING, Optional, Protocol, Union
@@ -29,7 +28,6 @@ if TYPE_CHECKING:
2928
from cuda.core.experimental._context import Context
3029
from cuda.core.experimental._event import Event, EventOptions
3130
from cuda.core.experimental._graph import GraphBuilder
32-
from cuda.core.experimental._utils.clear_error_support import assert_type
3331
from cuda.core.experimental._utils.cuda_utils import (
3432
driver,
3533
)

0 commit comments

Comments
 (0)