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.
Files changed (174) hide show
  1. nvmath/__init__.pxd +0 -0
  2. nvmath/__init__.py +37 -0
  3. nvmath/_internal/__init__.py +0 -0
  4. nvmath/_internal/layout.py +58 -0
  5. nvmath/_utils.py +363 -0
  6. nvmath/bindings/__init__.pxd +0 -0
  7. nvmath/bindings/__init__.py +44 -0
  8. nvmath/bindings/_internal/__init__.pxd +0 -0
  9. nvmath/bindings/_internal/__init__.py +0 -0
  10. nvmath/bindings/_internal/cublas.cp313-win_amd64.pyd +0 -0
  11. nvmath/bindings/_internal/cublas.pxd +518 -0
  12. nvmath/bindings/_internal/cublasLt.cp313-win_amd64.pyd +0 -0
  13. nvmath/bindings/_internal/cublasLt.pxd +54 -0
  14. nvmath/bindings/_internal/cudss.cp313-win_amd64.pyd +0 -0
  15. nvmath/bindings/_internal/cudss.pxd +44 -0
  16. nvmath/bindings/_internal/cufft.cp313-win_amd64.pyd +0 -0
  17. nvmath/bindings/_internal/cufft.pxd +69 -0
  18. nvmath/bindings/_internal/cufftMp.pxd +77 -0
  19. nvmath/bindings/_internal/curand.cp313-win_amd64.pyd +0 -0
  20. nvmath/bindings/_internal/curand.pxd +42 -0
  21. nvmath/bindings/_internal/cusolver.cp313-win_amd64.pyd +0 -0
  22. nvmath/bindings/_internal/cusolver.pxd +15 -0
  23. nvmath/bindings/_internal/cusolverDn.cp313-win_amd64.pyd +0 -0
  24. nvmath/bindings/_internal/cusolverDn.pxd +386 -0
  25. nvmath/bindings/_internal/cusparse.cp313-win_amd64.pyd +0 -0
  26. nvmath/bindings/_internal/cusparse.pxd +270 -0
  27. nvmath/bindings/_internal/mathdx.cp313-win_amd64.pyd +0 -0
  28. nvmath/bindings/_internal/mathdx.pxd +79 -0
  29. nvmath/bindings/_internal/nvshmem.pxd +29 -0
  30. nvmath/bindings/_internal/utils.cp313-win_amd64.pyd +0 -0
  31. nvmath/bindings/_internal/utils.pxd +186 -0
  32. nvmath/bindings/cublas.cp313-win_amd64.pyd +0 -0
  33. nvmath/bindings/cublas.pxd +545 -0
  34. nvmath/bindings/cublas.pyi +18 -0
  35. nvmath/bindings/cublasLt.cp313-win_amd64.pyd +0 -0
  36. nvmath/bindings/cublasLt.pxd +99 -0
  37. nvmath/bindings/cudss.cp313-win_amd64.pyd +0 -0
  38. nvmath/bindings/cudss.pxd +83 -0
  39. nvmath/bindings/cudss.pyi +249 -0
  40. nvmath/bindings/cufft.cp313-win_amd64.pyd +0 -0
  41. nvmath/bindings/cufft.pxd +114 -0
  42. nvmath/bindings/cufftMp.pxd +124 -0
  43. nvmath/bindings/curand.cp313-win_amd64.pyd +0 -0
  44. nvmath/bindings/curand.pxd +71 -0
  45. nvmath/bindings/cusolver.cp313-win_amd64.pyd +0 -0
  46. nvmath/bindings/cusolver.pxd +60 -0
  47. nvmath/bindings/cusolverDn.cp313-win_amd64.pyd +0 -0
  48. nvmath/bindings/cusolverDn.pxd +410 -0
  49. nvmath/bindings/cusparse.cp313-win_amd64.pyd +0 -0
  50. nvmath/bindings/cusparse.pxd +329 -0
  51. nvmath/bindings/cycublas.cp313-win_amd64.pyd +0 -0
  52. nvmath/bindings/cycublas.pxd +657 -0
  53. nvmath/bindings/cycublasLt.cp313-win_amd64.pyd +0 -0
  54. nvmath/bindings/cycublasLt.pxd +1010 -0
  55. nvmath/bindings/cycudss.cp313-win_amd64.pyd +0 -0
  56. nvmath/bindings/cycudss.pxd +191 -0
  57. nvmath/bindings/cycufft.cp313-win_amd64.pyd +0 -0
  58. nvmath/bindings/cycufft.pxd +320 -0
  59. nvmath/bindings/cycufftMp.pxd +333 -0
  60. nvmath/bindings/cycurand.cp313-win_amd64.pyd +0 -0
  61. nvmath/bindings/cycurand.pxd +146 -0
  62. nvmath/bindings/cycusolver.cp313-win_amd64.pyd +0 -0
  63. nvmath/bindings/cycusolver.pxd +143 -0
  64. nvmath/bindings/cycusolverDn.cp313-win_amd64.pyd +0 -0
  65. nvmath/bindings/cycusolverDn.pxd +414 -0
  66. nvmath/bindings/cycusparse.cp313-win_amd64.pyd +0 -0
  67. nvmath/bindings/cycusparse.pxd +476 -0
  68. nvmath/bindings/cymathdx.cp313-win_amd64.pyd +0 -0
  69. nvmath/bindings/cymathdx.pxd +363 -0
  70. nvmath/bindings/cynvshmem.pxd +126 -0
  71. nvmath/bindings/mathdx.cp313-win_amd64.pyd +0 -0
  72. nvmath/bindings/mathdx.pxd +131 -0
  73. nvmath/bindings/mathdx.pyi +686 -0
  74. nvmath/bindings/nvpl/__init__.pxd +0 -0
  75. nvmath/bindings/nvpl/__init__.py +11 -0
  76. nvmath/bindings/nvpl/_internal/__init__.pxd +0 -0
  77. nvmath/bindings/nvpl/_internal/__init__.py +0 -0
  78. nvmath/bindings/nvpl/_internal/fft.pxd +36 -0
  79. nvmath/bindings/nvpl/cyfft.pxd +87 -0
  80. nvmath/bindings/nvpl/fft.pxd +100 -0
  81. nvmath/bindings/nvshmem.pxd +54 -0
  82. nvmath/device/__init__.py +23 -0
  83. nvmath/device/_deprecated.py +33 -0
  84. nvmath/device/caching.py +51 -0
  85. nvmath/device/common.py +131 -0
  86. nvmath/device/common_backend.py +125 -0
  87. nvmath/device/common_cuda.py +156 -0
  88. nvmath/device/common_mathdx.py +97 -0
  89. nvmath/device/common_numba.py +159 -0
  90. nvmath/device/common_opaque_tensor.py +128 -0
  91. nvmath/device/cublasdx.py +1085 -0
  92. nvmath/device/cublasdx_backend.py +552 -0
  93. nvmath/device/cublasdx_numba.py +528 -0
  94. nvmath/device/cufftdx.py +551 -0
  95. nvmath/device/cufftdx_backend.py +194 -0
  96. nvmath/device/cufftdx_numba.py +123 -0
  97. nvmath/device/curand_kernel.py +9147 -0
  98. nvmath/device/nvrtc.py +95 -0
  99. nvmath/device/patch.py +35 -0
  100. nvmath/device/random.py +417 -0
  101. nvmath/device/random_helpers.py +23 -0
  102. nvmath/device/random_states.py +189 -0
  103. nvmath/device/types.py +11 -0
  104. nvmath/device/vector_types_numba.py +203 -0
  105. nvmath/distributed/__init__.py +117 -0
  106. nvmath/distributed/_internal/__init__.py +0 -0
  107. nvmath/distributed/_internal/nvshmem.py +243 -0
  108. nvmath/distributed/_internal/tensor_ifc_cupy.py +111 -0
  109. nvmath/distributed/_internal/tensor_ifc_numpy.py +53 -0
  110. nvmath/distributed/_internal/tensor_ifc_torch.py +108 -0
  111. nvmath/distributed/_internal/tensor_wrapper.py +59 -0
  112. nvmath/distributed/_utils.py +152 -0
  113. nvmath/distributed/fft/__init__.py +6 -0
  114. nvmath/distributed/fft/_configuration.py +86 -0
  115. nvmath/distributed/fft/fft.py +1737 -0
  116. nvmath/distributed/reshape/__init__.py +6 -0
  117. nvmath/distributed/reshape/_configuration.py +39 -0
  118. nvmath/distributed/reshape/reshape.py +1249 -0
  119. nvmath/fft/__init__.py +7 -0
  120. nvmath/fft/_configuration.py +208 -0
  121. nvmath/fft/_exec_utils.py +116 -0
  122. nvmath/fft/_helpers.py +260 -0
  123. nvmath/fft/fft.py +2346 -0
  124. nvmath/internal/__init__.py +5 -0
  125. nvmath/internal/enum_utils.py +142 -0
  126. nvmath/internal/formatters.py +87 -0
  127. nvmath/internal/mem_limit.py +51 -0
  128. nvmath/internal/package_ifc.py +119 -0
  129. nvmath/internal/package_ifc_cuda.py +43 -0
  130. nvmath/internal/package_ifc_cupy.py +49 -0
  131. nvmath/internal/package_ifc_torch.py +31 -0
  132. nvmath/internal/package_wrapper.py +14 -0
  133. nvmath/internal/tensor_ifc.py +143 -0
  134. nvmath/internal/tensor_ifc_cupy.py +185 -0
  135. nvmath/internal/tensor_ifc_numpy.py +157 -0
  136. nvmath/internal/tensor_ifc_torch.py +115 -0
  137. nvmath/internal/tensor_wrapper.py +160 -0
  138. nvmath/internal/typemaps.py +154 -0
  139. nvmath/internal/utils.py +634 -0
  140. nvmath/linalg/__init__.py +11 -0
  141. nvmath/linalg/_internal/__init__.py +3 -0
  142. nvmath/linalg/_internal/algo_cap_ifc.py +86 -0
  143. nvmath/linalg/_internal/algo_config_ifc.py +87 -0
  144. nvmath/linalg/_internal/enum_to_tuples.py +64 -0
  145. nvmath/linalg/_internal/epilog_protocol.py +738 -0
  146. nvmath/linalg/_internal/matmul_desc_ifc.py +72 -0
  147. nvmath/linalg/_internal/matmul_pref_ifc.py +65 -0
  148. nvmath/linalg/_internal/matrix_layout_ifc.py +59 -0
  149. nvmath/linalg/_internal/typemaps.py +135 -0
  150. nvmath/linalg/_internal/utils.py +96 -0
  151. nvmath/linalg/advanced/__init__.py +8 -0
  152. nvmath/linalg/advanced/_algorithmmod.py +142 -0
  153. nvmath/linalg/advanced/_configuration.py +320 -0
  154. nvmath/linalg/advanced/helpers/__init__.py +5 -0
  155. nvmath/linalg/advanced/helpers/matmul.py +173 -0
  156. nvmath/linalg/advanced/matmulmod.py +2855 -0
  157. nvmath/memory.py +266 -0
  158. nvmath/sparse/__init__.py +18 -0
  159. nvmath/sparse/_internal/__init__.py +21 -0
  160. nvmath/sparse/_internal/common_utils.py +81 -0
  161. nvmath/sparse/_internal/cudss_config_ifc.py +584 -0
  162. nvmath/sparse/_internal/cudss_data_ifc.py +291 -0
  163. nvmath/sparse/_internal/cudss_utils.py +398 -0
  164. nvmath/sparse/_internal/sparse_csr_ifc.py +154 -0
  165. nvmath/sparse/_internal/sparse_format_helpers.py +88 -0
  166. nvmath/sparse/_internal/sparse_tensor_ifc.py +80 -0
  167. nvmath/sparse/advanced/__init__.py +7 -0
  168. nvmath/sparse/advanced/_configuration.py +150 -0
  169. nvmath/sparse/advanced/direct_solver.py +1705 -0
  170. nvmath_python-0.5.0.dist-info/METADATA +122 -0
  171. nvmath_python-0.5.0.dist-info/RECORD +174 -0
  172. nvmath_python-0.5.0.dist-info/WHEEL +5 -0
  173. nvmath_python-0.5.0.dist-info/licenses/LICENSE +177 -0
  174. 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)