Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
cusolver_common.h262 linesDownload Raw Back to include
1/*
2 * Copyright 2014 NVIDIA Corporation.  All rights reserved.
3 *
4 * NOTICE TO LICENSEE:
5 *
6 * This source code and/or documentation ("Licensed Deliverables") are
7 * subject to NVIDIA intellectual property rights under U.S. and
8 * international Copyright laws.
9 *
10 * These Licensed Deliverables contained herein is PROPRIETARY and
11 * CONFIDENTIAL to NVIDIA and is being provided under the terms and
12 * conditions of a form of NVIDIA software license agreement by and
13 * between NVIDIA and Licensee ("License Agreement") or electronically
14 * accepted by Licensee.  Notwithstanding any terms or conditions to
15 * the contrary in the License Agreement, reproduction or disclosure
16 * of the Licensed Deliverables to any third party without the express
17 * written consent of NVIDIA is prohibited.
18 *
19 * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
20 * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
21 * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE.  IT IS
22 * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
23 * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
24 * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
25 * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
26 * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
27 * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
28 * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
29 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
30 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
31 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
32 * OF THESE LICENSED DELIVERABLES.
33 *
34 * U.S. Government End Users.  These Licensed Deliverables are a
35 * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
36 * 1995), consisting of "commercial computer software" and "commercial
37 * computer software documentation" as such terms are used in 48
38 * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
39 * only as a commercial end item.  Consistent with 48 C.F.R.12.212 and
40 * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
41 * U.S. Government End Users acquire the Licensed Deliverables with
42 * only those rights set forth herein.
43 *
44 * Any use of the Licensed Deliverables in individual and commercial
45 * software must include, in the user documentation and internal
46 * comments to the code, the above Disclaimer and U.S. Government End
47 * Users Notice.
48 */
49
50#if !defined(CUSOLVER_COMMON_H_)
51  #define CUSOLVER_COMMON_H_
52
53  #include "library_types.h"
54
55  #ifndef CUSOLVERAPI
56    #ifdef _WIN32
57      #define CUSOLVERAPI __stdcall
58    #else
59      #define CUSOLVERAPI
60    #endif
61  #endif
62
63  #if defined(_MSC_VER)
64typedef __int64 int64_t;
65  #else
66    #include <inttypes.h>
67  #endif
68
69typedef int cusolver_int_t;
70
71  #define CUSOLVER_VER_MAJOR 11
72  #define CUSOLVER_VER_MINOR 6
73  #define CUSOLVER_VER_PATCH 1
74  #define CUSOLVER_VER_BUILD 9
75  #define CUSOLVER_VERSION                                                     \
76    (CUSOLVER_VER_MAJOR * 1000 + CUSOLVER_VER_MINOR * 100 + CUSOLVER_VER_PATCH)
77
78//------------------------------------------------------------------------------
79
80  #if !defined(_MSC_VER)
81    #define CUSOLVER_CPP_VERSION __cplusplus
82  #elif _MSC_FULL_VER >= 190024210 // Visual Studio 2015 Update 3
83    #define CUSOLVER_CPP_VERSION _MSVC_LANG
84  #else
85    #define CUSOLVER_CPP_VERSION 0
86  #endif
87
88//------------------------------------------------------------------------------
89
90  #if !defined(DISABLE_CUSOLVER_DEPRECATED)
91
92    #if CUSOLVER_CPP_VERSION >= 201402L
93
94      #define CUSOLVER_DEPRECATED(new_func)                                    \
95        [[deprecated("please use " #new_func " instead")]]
96
97    #elif defined(_MSC_VER)
98
99      #define CUSOLVER_DEPRECATED(new_func)                                    \
100        __declspec(deprecated("please use " #new_func " instead"))
101
102    #elif defined(__INTEL_COMPILER) || defined(__clang__) ||                   \
103      (defined(__GNUC__) &&                                                    \
104       (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
105
106      #define CUSOLVER_DEPRECATED(new_func)                                    \
107        __attribute__((deprecated("please use " #new_func " instead")))
108
109    #elif defined(__GNUC__) || defined(__xlc__)
110
111      #define CUSOLVER_DEPRECATED(new_func) __attribute__((deprecated))
112
113    #else
114
115      #define CUSOLVER_DEPRECATED(new_func)
116
117    #endif // defined(__cplusplus) && __cplusplus >= 201402L
118  //------------------------------------------------------------------------------
119
120    #if CUSOLVER_CPP_VERSION >= 201703L
121
122      #define CUSOLVER_DEPRECATED_ENUM(new_enum)                               \
123        [[deprecated("please use " #new_enum " instead")]]
124
125    #elif defined(__clang__) ||                                                \
126      (defined(__GNUC__) && __GNUC__ >= 6 && !defined(__PGI))
127
128      #define CUSOLVER_DEPRECATED_ENUM(new_enum)                               \
129        __attribute__((deprecated("please use " #new_enum " instead")))
130
131    #else
132
133      #define CUSOLVER_DEPRECATED_ENUM(new_enum)
134
135    #endif // defined(__cplusplus) && __cplusplus >= 201402L
136
137  #else // defined(DISABLE_CUSOLVER_DEPRECATED)
138
139    #define CUSOLVER_DEPRECATED(new_func)
140    #define CUSOLVER_DEPRECATED_ENUM(new_enum)
141
142  #endif // !defined(DISABLE_CUSOLVER_DEPRECATED)
143
144  #undef CUSOLVER_CPP_VERSION
145
146  #if defined(__cplusplus)
147extern "C" {
148  #endif /* __cplusplus */
149
150  typedef enum {
151    CUSOLVER_STATUS_SUCCESS = 0,
152    CUSOLVER_STATUS_NOT_INITIALIZED = 1,
153    CUSOLVER_STATUS_ALLOC_FAILED = 2,
154    CUSOLVER_STATUS_INVALID_VALUE = 3,
155    CUSOLVER_STATUS_ARCH_MISMATCH = 4,
156    CUSOLVER_STATUS_MAPPING_ERROR = 5,
157    CUSOLVER_STATUS_EXECUTION_FAILED = 6,
158    CUSOLVER_STATUS_INTERNAL_ERROR = 7,
159    CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED = 8,
160    CUSOLVER_STATUS_NOT_SUPPORTED = 9,
161    CUSOLVER_STATUS_ZERO_PIVOT = 10,
162    CUSOLVER_STATUS_INVALID_LICENSE = 11,
163    CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED = 12,
164    CUSOLVER_STATUS_IRS_PARAMS_INVALID = 13,
165    CUSOLVER_STATUS_IRS_PARAMS_INVALID_PREC = 14,
166    CUSOLVER_STATUS_IRS_PARAMS_INVALID_REFINE = 15,
167    CUSOLVER_STATUS_IRS_PARAMS_INVALID_MAXITER = 16,
168    CUSOLVER_STATUS_IRS_INTERNAL_ERROR = 20,
169    CUSOLVER_STATUS_IRS_NOT_SUPPORTED = 21,
170    CUSOLVER_STATUS_IRS_OUT_OF_RANGE = 22,
171    CUSOLVER_STATUS_IRS_NRHS_NOT_SUPPORTED_FOR_REFINE_GMRES = 23,
172    CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED = 25,
173    CUSOLVER_STATUS_IRS_INFOS_NOT_DESTROYED = 26,
174    CUSOLVER_STATUS_IRS_MATRIX_SINGULAR = 30,
175    CUSOLVER_STATUS_INVALID_WORKSPACE = 31
176  } cusolverStatus_t;
177
178  typedef enum {
179    CUSOLVER_EIG_TYPE_1 = 1,
180    CUSOLVER_EIG_TYPE_2 = 2,
181    CUSOLVER_EIG_TYPE_3 = 3
182  } cusolverEigType_t;
183
184  typedef enum {
185    CUSOLVER_EIG_MODE_NOVECTOR = 0,
186    CUSOLVER_EIG_MODE_VECTOR = 1
187  } cusolverEigMode_t;
188
189  typedef enum {
190    CUSOLVER_EIG_RANGE_ALL = 1001,
191    CUSOLVER_EIG_RANGE_I = 1002,
192    CUSOLVER_EIG_RANGE_V = 1003,
193  } cusolverEigRange_t;
194
195  typedef enum {
196    CUSOLVER_INF_NORM = 104,
197    CUSOLVER_MAX_NORM = 105,
198    CUSOLVER_ONE_NORM = 106,
199    CUSOLVER_FRO_NORM = 107,
200  } cusolverNorm_t;
201
202  typedef enum {
203    CUSOLVER_IRS_REFINE_NOT_SET = 1100,
204    CUSOLVER_IRS_REFINE_NONE = 1101,
205    CUSOLVER_IRS_REFINE_CLASSICAL = 1102,
206    CUSOLVER_IRS_REFINE_CLASSICAL_GMRES = 1103,
207    CUSOLVER_IRS_REFINE_GMRES = 1104,
208    CUSOLVER_IRS_REFINE_GMRES_GMRES = 1105,
209    CUSOLVER_IRS_REFINE_GMRES_NOPCOND = 1106,
210
211    CUSOLVER_PREC_DD = 1150,
212    CUSOLVER_PREC_SS = 1151,
213    CUSOLVER_PREC_SHT = 1152,
214
215  } cusolverIRSRefinement_t;
216
217  typedef enum {
218    CUSOLVER_R_8I = 1201,
219    CUSOLVER_R_8U = 1202,
220    CUSOLVER_R_64F = 1203,
221    CUSOLVER_R_32F = 1204,
222    CUSOLVER_R_16F = 1205,
223    CUSOLVER_R_16BF = 1206,
224    CUSOLVER_R_TF32 = 1207,
225    CUSOLVER_R_AP = 1208,
226    CUSOLVER_C_8I = 1211,
227    CUSOLVER_C_8U = 1212,
228    CUSOLVER_C_64F = 1213,
229    CUSOLVER_C_32F = 1214,
230    CUSOLVER_C_16F = 1215,
231    CUSOLVER_C_16BF = 1216,
232    CUSOLVER_C_TF32 = 1217,
233    CUSOLVER_C_AP = 1218,
234  } cusolverPrecType_t;
235
236  typedef enum {
237    CUSOLVER_ALG_0 = 0, /* default algorithm */
238    CUSOLVER_ALG_1 = 1,
239    CUSOLVER_ALG_2 = 2
240  } cusolverAlgMode_t;
241
242  typedef enum {
243    CUBLAS_STOREV_COLUMNWISE = 0,
244    CUBLAS_STOREV_ROWWISE = 1
245  } cusolverStorevMode_t;
246
247  typedef enum {
248    CUBLAS_DIRECT_FORWARD = 0,
249    CUBLAS_DIRECT_BACKWARD = 1
250  } cusolverDirectMode_t;
251
252  cusolverStatus_t CUSOLVERAPI
253    cusolverGetProperty(libraryPropertyType type, int *value);
254
255  cusolverStatus_t CUSOLVERAPI cusolverGetVersion(int *version);
256
257  #if defined(__cplusplus)
258}
259  #endif /* __cplusplus */
260
261#endif // CUSOLVER_COMMON_H_
262 
codekingpro/portable-devtools · Team Ai