|
5 | 5 | // LICENSE file in the root directory of this source tree.
|
6 | 6 | #pragma once
|
7 | 7 | #include <unistd.h>
|
8 |
| -#include <cublas_v2.h> |
| 8 | +// #include <cublas_v2.h> |
9 | 9 | #include <cuda_runtime.h>
|
10 | 10 |
|
11 | 11 | #include <thrust/copy.h>
|
@@ -39,29 +39,29 @@ inline void checkCuda(cudaError_t code, const char *file, int line) {
|
39 | 39 | }
|
40 | 40 | }
|
41 | 41 |
|
42 |
| -inline const char* cublasGetErrorString(cublasStatus_t status) { |
43 |
| - switch (status) { |
44 |
| - case CUBLAS_STATUS_SUCCESS: return "CUBLAS_STATUS_SUCCESS"; |
45 |
| - case CUBLAS_STATUS_NOT_INITIALIZED: return "CUBLAS_STATUS_NOT_INITIALIZED"; |
46 |
| - case CUBLAS_STATUS_ALLOC_FAILED: return "CUBLAS_STATUS_ALLOC_FAILED"; |
47 |
| - case CUBLAS_STATUS_INVALID_VALUE: return "CUBLAS_STATUS_INVALID_VALUE"; |
48 |
| - case CUBLAS_STATUS_ARCH_MISMATCH: return "CUBLAS_STATUS_ARCH_MISMATCH"; |
49 |
| - case CUBLAS_STATUS_MAPPING_ERROR: return "CUBLAS_STATUS_MAPPING_ERROR"; |
50 |
| - case CUBLAS_STATUS_EXECUTION_FAILED: return "CUBLAS_STATUS_EXECUTION_FAILED"; |
51 |
| - case CUBLAS_STATUS_INTERNAL_ERROR: return "CUBLAS_STATUS_INTERNAL_ERROR"; |
52 |
| - } |
53 |
| - return "Unknown"; |
54 |
| -} |
55 |
| - |
56 |
| -#define CHECK_CUBLAS(code) { checkCublas((code), __FILE__, __LINE__); } |
57 |
| -inline void checkCublas(cublasStatus_t code, const char * file, int line) { |
58 |
| - if (code != CUBLAS_STATUS_SUCCESS) { |
59 |
| - std::stringstream err; |
60 |
| - err << "cublas error: " << cublasGetErrorString(code) |
61 |
| - << " (" << file << ":" << line << ")"; |
62 |
| - throw std::runtime_error(err.str()); |
63 |
| - } |
64 |
| -} |
| 42 | +// inline const char* cublasGetErrorString(cublasStatus_t status) { |
| 43 | +// switch (status) { |
| 44 | +// case CUBLAS_STATUS_SUCCESS: return "CUBLAS_STATUS_SUCCESS"; |
| 45 | +// case CUBLAS_STATUS_NOT_INITIALIZED: return "CUBLAS_STATUS_NOT_INITIALIZED"; |
| 46 | +// case CUBLAS_STATUS_ALLOC_FAILED: return "CUBLAS_STATUS_ALLOC_FAILED"; |
| 47 | +// case CUBLAS_STATUS_INVALID_VALUE: return "CUBLAS_STATUS_INVALID_VALUE"; |
| 48 | +// case CUBLAS_STATUS_ARCH_MISMATCH: return "CUBLAS_STATUS_ARCH_MISMATCH"; |
| 49 | +// case CUBLAS_STATUS_MAPPING_ERROR: return "CUBLAS_STATUS_MAPPING_ERROR"; |
| 50 | +// case CUBLAS_STATUS_EXECUTION_FAILED: return "CUBLAS_STATUS_EXECUTION_FAILED"; |
| 51 | +// case CUBLAS_STATUS_INTERNAL_ERROR: return "CUBLAS_STATUS_INTERNAL_ERROR"; |
| 52 | +// } |
| 53 | +// return "Unknown"; |
| 54 | +// } |
| 55 | +// |
| 56 | +// #define CHECK_CUBLAS(code) { checkCublas((code), __FILE__, __LINE__); } |
| 57 | +// inline void checkCublas(cublasStatus_t code, const char * file, int line) { |
| 58 | +// if (code != CUBLAS_STATUS_SUCCESS) { |
| 59 | +// std::stringstream err; |
| 60 | +// err << "cublas error: " << cublasGetErrorString(code) |
| 61 | +// << " (" << file << ":" << line << ")"; |
| 62 | +// throw std::runtime_error(err.str()); |
| 63 | +// } |
| 64 | +// } |
65 | 65 |
|
66 | 66 | inline DeviceInfo GetDeviceInfo() {
|
67 | 67 | DeviceInfo ret;
|
|
0 commit comments