nvmath-python 0.5.0__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nvmath/__init__.pxd +0 -0
- nvmath/__init__.py +37 -0
- nvmath/_internal/__init__.py +0 -0
- nvmath/_internal/layout.py +58 -0
- nvmath/_utils.py +363 -0
- nvmath/bindings/__init__.pxd +0 -0
- nvmath/bindings/__init__.py +44 -0
- nvmath/bindings/_internal/__init__.pxd +0 -0
- nvmath/bindings/_internal/__init__.py +0 -0
- nvmath/bindings/_internal/cublas.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/_internal/cublas.pxd +518 -0
- nvmath/bindings/_internal/cublasLt.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/_internal/cublasLt.pxd +54 -0
- nvmath/bindings/_internal/cudss.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/_internal/cudss.pxd +44 -0
- nvmath/bindings/_internal/cufft.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/_internal/cufft.pxd +69 -0
- nvmath/bindings/_internal/cufftMp.pxd +77 -0
- nvmath/bindings/_internal/curand.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/_internal/curand.pxd +42 -0
- nvmath/bindings/_internal/cusolver.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/_internal/cusolver.pxd +15 -0
- nvmath/bindings/_internal/cusolverDn.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/_internal/cusolverDn.pxd +386 -0
- nvmath/bindings/_internal/cusparse.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/_internal/cusparse.pxd +270 -0
- nvmath/bindings/_internal/mathdx.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/_internal/mathdx.pxd +79 -0
- nvmath/bindings/_internal/nvshmem.pxd +29 -0
- nvmath/bindings/_internal/utils.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/_internal/utils.pxd +186 -0
- nvmath/bindings/cublas.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/cublas.pxd +545 -0
- nvmath/bindings/cublas.pyi +18 -0
- nvmath/bindings/cublasLt.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/cublasLt.pxd +99 -0
- nvmath/bindings/cudss.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/cudss.pxd +83 -0
- nvmath/bindings/cudss.pyi +249 -0
- nvmath/bindings/cufft.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/cufft.pxd +114 -0
- nvmath/bindings/cufftMp.pxd +124 -0
- nvmath/bindings/curand.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/curand.pxd +71 -0
- nvmath/bindings/cusolver.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/cusolver.pxd +60 -0
- nvmath/bindings/cusolverDn.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/cusolverDn.pxd +410 -0
- nvmath/bindings/cusparse.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/cusparse.pxd +329 -0
- nvmath/bindings/cycublas.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/cycublas.pxd +657 -0
- nvmath/bindings/cycublasLt.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/cycublasLt.pxd +1010 -0
- nvmath/bindings/cycudss.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/cycudss.pxd +191 -0
- nvmath/bindings/cycufft.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/cycufft.pxd +320 -0
- nvmath/bindings/cycufftMp.pxd +333 -0
- nvmath/bindings/cycurand.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/cycurand.pxd +146 -0
- nvmath/bindings/cycusolver.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/cycusolver.pxd +143 -0
- nvmath/bindings/cycusolverDn.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/cycusolverDn.pxd +414 -0
- nvmath/bindings/cycusparse.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/cycusparse.pxd +476 -0
- nvmath/bindings/cymathdx.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/cymathdx.pxd +363 -0
- nvmath/bindings/cynvshmem.pxd +126 -0
- nvmath/bindings/mathdx.cp313-win_amd64.pyd +0 -0
- nvmath/bindings/mathdx.pxd +131 -0
- nvmath/bindings/mathdx.pyi +686 -0
- nvmath/bindings/nvpl/__init__.pxd +0 -0
- nvmath/bindings/nvpl/__init__.py +11 -0
- nvmath/bindings/nvpl/_internal/__init__.pxd +0 -0
- nvmath/bindings/nvpl/_internal/__init__.py +0 -0
- nvmath/bindings/nvpl/_internal/fft.pxd +36 -0
- nvmath/bindings/nvpl/cyfft.pxd +87 -0
- nvmath/bindings/nvpl/fft.pxd +100 -0
- nvmath/bindings/nvshmem.pxd +54 -0
- nvmath/device/__init__.py +23 -0
- nvmath/device/_deprecated.py +33 -0
- nvmath/device/caching.py +51 -0
- nvmath/device/common.py +131 -0
- nvmath/device/common_backend.py +125 -0
- nvmath/device/common_cuda.py +156 -0
- nvmath/device/common_mathdx.py +97 -0
- nvmath/device/common_numba.py +159 -0
- nvmath/device/common_opaque_tensor.py +128 -0
- nvmath/device/cublasdx.py +1085 -0
- nvmath/device/cublasdx_backend.py +552 -0
- nvmath/device/cublasdx_numba.py +528 -0
- nvmath/device/cufftdx.py +551 -0
- nvmath/device/cufftdx_backend.py +194 -0
- nvmath/device/cufftdx_numba.py +123 -0
- nvmath/device/curand_kernel.py +9147 -0
- nvmath/device/nvrtc.py +95 -0
- nvmath/device/patch.py +35 -0
- nvmath/device/random.py +417 -0
- nvmath/device/random_helpers.py +23 -0
- nvmath/device/random_states.py +189 -0
- nvmath/device/types.py +11 -0
- nvmath/device/vector_types_numba.py +203 -0
- nvmath/distributed/__init__.py +117 -0
- nvmath/distributed/_internal/__init__.py +0 -0
- nvmath/distributed/_internal/nvshmem.py +243 -0
- nvmath/distributed/_internal/tensor_ifc_cupy.py +111 -0
- nvmath/distributed/_internal/tensor_ifc_numpy.py +53 -0
- nvmath/distributed/_internal/tensor_ifc_torch.py +108 -0
- nvmath/distributed/_internal/tensor_wrapper.py +59 -0
- nvmath/distributed/_utils.py +152 -0
- nvmath/distributed/fft/__init__.py +6 -0
- nvmath/distributed/fft/_configuration.py +86 -0
- nvmath/distributed/fft/fft.py +1737 -0
- nvmath/distributed/reshape/__init__.py +6 -0
- nvmath/distributed/reshape/_configuration.py +39 -0
- nvmath/distributed/reshape/reshape.py +1249 -0
- nvmath/fft/__init__.py +7 -0
- nvmath/fft/_configuration.py +208 -0
- nvmath/fft/_exec_utils.py +116 -0
- nvmath/fft/_helpers.py +260 -0
- nvmath/fft/fft.py +2346 -0
- nvmath/internal/__init__.py +5 -0
- nvmath/internal/enum_utils.py +142 -0
- nvmath/internal/formatters.py +87 -0
- nvmath/internal/mem_limit.py +51 -0
- nvmath/internal/package_ifc.py +119 -0
- nvmath/internal/package_ifc_cuda.py +43 -0
- nvmath/internal/package_ifc_cupy.py +49 -0
- nvmath/internal/package_ifc_torch.py +31 -0
- nvmath/internal/package_wrapper.py +14 -0
- nvmath/internal/tensor_ifc.py +143 -0
- nvmath/internal/tensor_ifc_cupy.py +185 -0
- nvmath/internal/tensor_ifc_numpy.py +157 -0
- nvmath/internal/tensor_ifc_torch.py +115 -0
- nvmath/internal/tensor_wrapper.py +160 -0
- nvmath/internal/typemaps.py +154 -0
- nvmath/internal/utils.py +634 -0
- nvmath/linalg/__init__.py +11 -0
- nvmath/linalg/_internal/__init__.py +3 -0
- nvmath/linalg/_internal/algo_cap_ifc.py +86 -0
- nvmath/linalg/_internal/algo_config_ifc.py +87 -0
- nvmath/linalg/_internal/enum_to_tuples.py +64 -0
- nvmath/linalg/_internal/epilog_protocol.py +738 -0
- nvmath/linalg/_internal/matmul_desc_ifc.py +72 -0
- nvmath/linalg/_internal/matmul_pref_ifc.py +65 -0
- nvmath/linalg/_internal/matrix_layout_ifc.py +59 -0
- nvmath/linalg/_internal/typemaps.py +135 -0
- nvmath/linalg/_internal/utils.py +96 -0
- nvmath/linalg/advanced/__init__.py +8 -0
- nvmath/linalg/advanced/_algorithmmod.py +142 -0
- nvmath/linalg/advanced/_configuration.py +320 -0
- nvmath/linalg/advanced/helpers/__init__.py +5 -0
- nvmath/linalg/advanced/helpers/matmul.py +173 -0
- nvmath/linalg/advanced/matmulmod.py +2855 -0
- nvmath/memory.py +266 -0
- nvmath/sparse/__init__.py +18 -0
- nvmath/sparse/_internal/__init__.py +21 -0
- nvmath/sparse/_internal/common_utils.py +81 -0
- nvmath/sparse/_internal/cudss_config_ifc.py +584 -0
- nvmath/sparse/_internal/cudss_data_ifc.py +291 -0
- nvmath/sparse/_internal/cudss_utils.py +398 -0
- nvmath/sparse/_internal/sparse_csr_ifc.py +154 -0
- nvmath/sparse/_internal/sparse_format_helpers.py +88 -0
- nvmath/sparse/_internal/sparse_tensor_ifc.py +80 -0
- nvmath/sparse/advanced/__init__.py +7 -0
- nvmath/sparse/advanced/_configuration.py +150 -0
- nvmath/sparse/advanced/direct_solver.py +1705 -0
- nvmath_python-0.5.0.dist-info/METADATA +122 -0
- nvmath_python-0.5.0.dist-info/RECORD +174 -0
- nvmath_python-0.5.0.dist-info/WHEEL +5 -0
- nvmath_python-0.5.0.dist-info/licenses/LICENSE +177 -0
- nvmath_python-0.5.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
from libc.stdint cimport int32_t, int64_t, intptr_t
|
|
6
|
+
from libcpp.vector cimport vector
|
|
7
|
+
from libcpp cimport bool as cppbool
|
|
8
|
+
from libcpp cimport nullptr_t, nullptr
|
|
9
|
+
from libcpp.memory cimport unique_ptr
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
cdef extern from * nogil:
|
|
13
|
+
"""
|
|
14
|
+
template<typename T>
|
|
15
|
+
class nullable_unique_ptr {
|
|
16
|
+
public:
|
|
17
|
+
nullable_unique_ptr() noexcept = default;
|
|
18
|
+
|
|
19
|
+
nullable_unique_ptr(std::nullptr_t) noexcept = delete;
|
|
20
|
+
|
|
21
|
+
explicit nullable_unique_ptr(T* data, bool own_data):
|
|
22
|
+
own_data_(own_data)
|
|
23
|
+
{
|
|
24
|
+
if (own_data)
|
|
25
|
+
manager_.reset(data);
|
|
26
|
+
else
|
|
27
|
+
raw_data_ = data;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
nullable_unique_ptr(const nullable_unique_ptr&) = delete;
|
|
31
|
+
|
|
32
|
+
nullable_unique_ptr& operator=(const nullable_unique_ptr&) = delete;
|
|
33
|
+
|
|
34
|
+
nullable_unique_ptr(nullable_unique_ptr&& other) noexcept
|
|
35
|
+
{
|
|
36
|
+
own_data_ = other.own_data_;
|
|
37
|
+
other.own_data_ = false; // ownership is transferred
|
|
38
|
+
if (own_data_)
|
|
39
|
+
{
|
|
40
|
+
manager_ = std::move(other.manager_);
|
|
41
|
+
raw_data_ = nullptr; // just in case
|
|
42
|
+
}
|
|
43
|
+
else
|
|
44
|
+
{
|
|
45
|
+
manager_.reset(nullptr); // just in case
|
|
46
|
+
raw_data_ = other.raw_data_;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
nullable_unique_ptr& operator=(nullable_unique_ptr&& other) noexcept
|
|
51
|
+
{
|
|
52
|
+
own_data_ = other.own_data_;
|
|
53
|
+
other.own_data_ = false; // ownership is transferred
|
|
54
|
+
if (own_data_)
|
|
55
|
+
{
|
|
56
|
+
manager_ = std::move(other.manager_);
|
|
57
|
+
raw_data_ = nullptr; // just in case
|
|
58
|
+
}
|
|
59
|
+
else
|
|
60
|
+
{
|
|
61
|
+
manager_.reset(nullptr); // just in case
|
|
62
|
+
raw_data_ = other.raw_data_;
|
|
63
|
+
}
|
|
64
|
+
return *this;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
~nullable_unique_ptr() = default;
|
|
68
|
+
|
|
69
|
+
void reset(T* data, bool own_data)
|
|
70
|
+
{
|
|
71
|
+
own_data_ = own_data;
|
|
72
|
+
if (own_data_)
|
|
73
|
+
{
|
|
74
|
+
manager_.reset(data);
|
|
75
|
+
raw_data_ = nullptr;
|
|
76
|
+
}
|
|
77
|
+
else
|
|
78
|
+
{
|
|
79
|
+
manager_.reset(nullptr);
|
|
80
|
+
raw_data_ = data;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
void swap(nullable_unique_ptr& other) noexcept
|
|
85
|
+
{
|
|
86
|
+
std::swap(manager_, other.manager_);
|
|
87
|
+
std::swap(raw_data_, other.raw_data_);
|
|
88
|
+
std::swap(own_data_, other.own_data_);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/*
|
|
92
|
+
* Get the pointer to the underlying object (this is different from data()!).
|
|
93
|
+
*/
|
|
94
|
+
T* get() const noexcept
|
|
95
|
+
{
|
|
96
|
+
if (own_data_)
|
|
97
|
+
return manager_.get();
|
|
98
|
+
else
|
|
99
|
+
return raw_data_;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/*
|
|
103
|
+
* Get the pointer to the underlying buffer (this is different from get()!).
|
|
104
|
+
*/
|
|
105
|
+
void* data() noexcept
|
|
106
|
+
{
|
|
107
|
+
if (own_data_)
|
|
108
|
+
return manager_.get()->data();
|
|
109
|
+
else
|
|
110
|
+
return raw_data_;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
T& operator*()
|
|
114
|
+
{
|
|
115
|
+
if (own_data_)
|
|
116
|
+
return *manager_;
|
|
117
|
+
else
|
|
118
|
+
return *raw_data_;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
private:
|
|
122
|
+
std::unique_ptr<T> manager_{};
|
|
123
|
+
T* raw_data_{nullptr};
|
|
124
|
+
bool own_data_{false};
|
|
125
|
+
};
|
|
126
|
+
"""
|
|
127
|
+
# xref: cython/Cython/Includes/libcpp/memory.pxd
|
|
128
|
+
cdef cppclass nullable_unique_ptr[T]:
|
|
129
|
+
nullable_unique_ptr()
|
|
130
|
+
nullable_unique_ptr(T*, cppbool)
|
|
131
|
+
nullable_unique_ptr(nullable_unique_ptr[T]&)
|
|
132
|
+
|
|
133
|
+
# Modifiers
|
|
134
|
+
void reset(T*, cppbool)
|
|
135
|
+
void swap(nullable_unique_ptr&)
|
|
136
|
+
|
|
137
|
+
# Observers
|
|
138
|
+
T* get()
|
|
139
|
+
T& operator*()
|
|
140
|
+
void* data()
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
cdef extern from "<cuComplex.h>" nogil:
|
|
144
|
+
ctypedef struct cuComplex:
|
|
145
|
+
pass
|
|
146
|
+
ctypedef struct cuDoubleComplex:
|
|
147
|
+
pass
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
ctypedef fused ResT:
|
|
151
|
+
int
|
|
152
|
+
int32_t
|
|
153
|
+
int64_t
|
|
154
|
+
float
|
|
155
|
+
double
|
|
156
|
+
size_t
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
ctypedef fused PtrT:
|
|
160
|
+
float
|
|
161
|
+
double
|
|
162
|
+
cuComplex
|
|
163
|
+
cuDoubleComplex
|
|
164
|
+
void
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
cdef cppclass nested_resource[T]:
|
|
168
|
+
nullable_unique_ptr[ vector[intptr_t] ] ptrs
|
|
169
|
+
nullable_unique_ptr[ vector[vector[T]] ] nested_resource_ptr
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
# accepts the output pointer as input to use the return value for exception propagation
|
|
173
|
+
cdef int get_resource_ptr(nullable_unique_ptr[vector[ResT]] &in_out_ptr, object obj, ResT* __unused) except 1
|
|
174
|
+
cdef int get_resource_ptrs(nullable_unique_ptr[ vector[PtrT*] ] &in_out_ptr, object obj, PtrT* __unused) except 1
|
|
175
|
+
cdef int get_nested_resource_ptr(nested_resource[ResT] &in_out_ptr, object obj, ResT* __unused) except 1
|
|
176
|
+
|
|
177
|
+
cdef bint is_nested_sequence(data)
|
|
178
|
+
cdef void* get_buffer_pointer(buf, Py_ssize_t size, readonly=*) except*
|
|
179
|
+
|
|
180
|
+
cdef tuple get_cublas_dso_version_suffix(int driver_ver)
|
|
181
|
+
cdef tuple get_cusolver_dso_version_suffix(int driver_ver)
|
|
182
|
+
cdef tuple get_cufft_dso_version_suffix(int driver_ver)
|
|
183
|
+
cdef tuple get_cusparse_dso_version_suffix(int driver_ver)
|
|
184
|
+
cdef tuple get_curand_dso_version_suffix(int driver_ver)
|
|
185
|
+
cdef tuple get_nvrtc_dso_version_suffix(int driver_ver)
|
|
186
|
+
cdef tuple get_mathdx_dso_version_suffix(int driver_ver)
|
|
Binary file
|