1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
|
<center><a href="https://gitlab.com/petsc/petsc/-/blob/01a2522431ef63feaceabbc11dd32b16a352f77d/include/petscdevice_cuda.h">Actual source code: petscdevice_cuda.h</a></center><br>
<html>
<head>
<title></title>
<meta name="generator" content="c2html 0.9.4">
<meta name="date" content="2023-02-27T22:24:48+00:00">
</head>
<body bgcolor="#FFFFFF">
<pre width="80">
<a name="line1"> 1: </a><font color="#A020F0">#ifndef PETSCDEVICE_CUDA_H</font>
<a name="line2"> 2: </a><strong><font color="#228B22">#define PETSCDEVICE_CUDA_H</font></strong>
<a name="line4"> 4: </a>#include <A href="petscdevice.h.html"><petscdevice.h></A>
<a name="line5"> 5: </a><font color="#A020F0">#include <petscpkg_version.h></font>
<a name="line7"> 7: </a><font color="#A020F0">#if defined(__NVCC__) || defined(__CUDACC__)</font>
<a name="line8"> 8: </a><strong><font color="#228B22"> #define PETSC_USING_NVCC 1</font></strong>
<a name="line9"> 9: </a><font color="#A020F0">#endif</font>
<a name="line11"> 11: </a><font color="#A020F0">#if <a href="../docs/manualpages/Sys/PetscDefined.html">PetscDefined</a>(HAVE_CUDA)</font>
<a name="line12"> 12: </a><font color="#A020F0"> #include <cuda.h></font>
<a name="line13"> 13: </a><font color="#A020F0"> #include <cuda_runtime.h></font>
<a name="line14"> 14: </a><font color="#A020F0"> #include <cublas_v2.h></font>
<a name="line15"> 15: </a><font color="#A020F0"> #include <cusolverDn.h></font>
<a name="line16"> 16: </a><font color="#A020F0"> #include <cusolverSp.h></font>
<a name="line17"> 17: </a><font color="#A020F0"> #include <cufft.h></font>
<a name="line19"> 19: </a><font color="#B22222">/* cuBLAS does not have cublasGetErrorName(). We create one on our own. */</font>
<a name="line20"> 20: </a><strong><font color="#4169E1">PETSC_EXTERN const char *PetscCUBLASGetErrorName(cublasStatus_t)</font></strong>; <font color="#B22222">/* PETSC_EXTERN since it is exposed by the CHKERRCUBLAS macro */</font>
<a name="line21"> 21: </a><strong><font color="#4169E1">PETSC_EXTERN const char *PetscCUSolverGetErrorName(cusolverStatus_t)</font></strong>;
<a name="line22"> 22: </a><strong><font color="#4169E1">PETSC_EXTERN const char *PetscCUFFTGetErrorName(cufftResult)</font></strong>;
<a name="line24"> 24: </a> <font color="#B22222">/* REMOVE ME */</font>
<a name="line25"> 25: </a><strong><font color="#228B22"> #define WaitForCUDA() cudaDeviceSynchronize()</font></strong>
<a name="line27"> 27: </a> <font color="#B22222">/* CUDART_VERSION = 1000 x major + 10 x minor version */</font>
<a name="line29"> 29: </a> <font color="#B22222">/* Could not find exactly which CUDART_VERSION introduced cudaGetErrorName. At least it was in CUDA 8.0 (Sep. 2016) */</font>
<a name="line30"> 30: </a><font color="#A020F0"> #if PETSC_PKG_CUDA_VERSION_GE(8, 0, 0)</font>
<a name="line31"> 31: </a><strong><font color="#228B22"> #define PetscCallCUDAVoid(...) \</font></strong>
<a name="line32"> 32: </a><strong><font color="#228B22"> do { \</font></strong>
<a name="line33"> 33: </a><strong><font color="#228B22"> const cudaError_t _p_cuda_err__ = __VA_ARGS__; \</font></strong>
<a name="line35"> 35: </a><strong><font color="#228B22"> } while (0)</font></strong>
<a name="line37"> 37: </a><strong><font color="#228B22"> #define PetscCallCUDA(...) \</font></strong>
<a name="line38"> 38: </a><strong><font color="#228B22"> do { \</font></strong>
<a name="line39"> 39: </a><strong><font color="#228B22"> const cudaError_t _p_cuda_err__ = __VA_ARGS__; \</font></strong>
<a name="line41"> 41: </a><strong><font color="#228B22"> } while (0)</font></strong>
<a name="line42"> 42: </a><font color="#A020F0"> #else </font><font color="#B22222">/* PETSC_PKG_CUDA_VERSION_GE(8,0,0) */</font><font color="#A020F0"></font>
<a name="line43"> 43: </a><strong><font color="#228B22"> #define PetscCallCUDA(...) \</font></strong>
<a name="line44"> 44: </a><strong><font color="#228B22"> do { \</font></strong>
<a name="line45"> 45: </a><strong><font color="#228B22"> const cudaError_t _p_cuda_err__ = __VA_ARGS__; \</font></strong>
<a name="line47"> 47: </a><strong><font color="#228B22"> } while (0)</font></strong>
<a name="line49"> 49: </a><strong><font color="#228B22"> #define PetscCallCUDAVoid(...) \</font></strong>
<a name="line50"> 50: </a><strong><font color="#228B22"> do { \</font></strong>
<a name="line51"> 51: </a><strong><font color="#228B22"> const cudaError_t _p_cuda_err__ = __VA_ARGS__; \</font></strong>
<a name="line53"> 53: </a><strong><font color="#228B22"> } while (0)</font></strong>
<a name="line54"> 54: </a><font color="#A020F0"> #endif </font><font color="#B22222">/* PETSC_PKG_CUDA_VERSION_GE(8,0,0) */</font><font color="#A020F0"></font>
<a name="line55"> 55: </a><strong><font color="#228B22"> #define CHKERRCUDA(...) PetscCallCUDA(__VA_ARGS__)</font></strong>
<a name="line57"> 57: </a><strong><font color="#228B22"> #define PetscCUDACheckLaunch \</font></strong>
<a name="line58"> 58: </a><strong><font color="#228B22"> do { \</font></strong>
<a name="line59"> 59: </a><strong><font color="#228B22"> </font><font color="#B22222">/* Check synchronous errors, i.e. pre-launch */</font><font color="#228B22"> \</font></strong>
<a name="line60"> 60: </a><strong><font color="#228B22"> cudaGetLastError(); \</font></strong>
<a name="line61"> 61: </a><strong><font color="#228B22"> </font><font color="#B22222">/* Check asynchronous errors, i.e. kernel failed (ULF) */</font><font color="#228B22"> \</font></strong>
<a name="line62"> 62: </a><strong><font color="#228B22"> cudaDeviceSynchronize(); \</font></strong>
<a name="line63"> 63: </a><strong><font color="#228B22"> } while (0)</font></strong>
<a name="line65"> 65: </a><strong><font color="#228B22"> #define PetscCallCUBLAS(...) \</font></strong>
<a name="line66"> 66: </a><strong><font color="#228B22"> do { \</font></strong>
<a name="line67"> 67: </a><strong><font color="#228B22"> const cublasStatus_t _p_cublas_stat__ = __VA_ARGS__; \</font></strong>
<a name="line68"> 68: </a><strong><font color="#228B22"> if (<a href="../docs/manualpages/Sys/PetscUnlikely.html">PetscUnlikely</a>(_p_cublas_stat__ != CUBLAS_STATUS_SUCCESS)) { \</font></strong>
<a name="line69"> 69: </a><strong><font color="#228B22"> const char *name = PetscCUBLASGetErrorName(_p_cublas_stat__); \</font></strong>
<a name="line70"> 70: </a><strong><font color="#228B22"> if (((_p_cublas_stat__ == CUBLAS_STATUS_NOT_INITIALIZED) || (_p_cublas_stat__ == CUBLAS_STATUS_ALLOC_FAILED)) && <a href="../docs/manualpages/Sys/PetscDeviceInitialized.html">PetscDeviceInitialized</a>(<a href="../docs/manualpages/Sys/PetscDeviceType.html">PETSC_DEVICE_CUDA</a>)) { \</font></strong>
<a name="line71"> 71: </a><strong><font color="#228B22"> <a href="../docs/manualpages/Sys/SETERRQ.html">SETERRQ</a>(<a href="../docs/manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, PETSC_ERR_GPU_RESOURCE, \</font></strong>
<a name="line72"> 72: </a><strong><font color="#228B22"> </font><font color="#666666">"cuBLAS error %d (%s). "</font><font color="#228B22"> \</font></strong>
<a name="line73"> 73: </a><strong><font color="#228B22"> </font><font color="#666666">"Reports not initialized or alloc failed; "</font><font color="#228B22"> \</font></strong>
<a name="line74"> 74: </a><strong><font color="#228B22"> </font><font color="#666666">"this indicates the GPU may have run out resources"</font><font color="#228B22">, \</font></strong>
<a name="line75"> 75: </a><strong><font color="#228B22"> (<a href="../docs/manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>)_p_cublas_stat__, name); \</font></strong>
<a name="line76"> 76: </a><strong><font color="#228B22"> } else { \</font></strong>
<a name="line77"> 77: </a><strong><font color="#228B22"> <a href="../docs/manualpages/Sys/SETERRQ.html">SETERRQ</a>(<a href="../docs/manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, PETSC_ERR_GPU, </font><font color="#666666">"cuBLAS error %d (%s)"</font><font color="#228B22">, (<a href="../docs/manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>)_p_cublas_stat__, name); \</font></strong>
<a name="line78"> 78: </a><strong><font color="#228B22"> } \</font></strong>
<a name="line79"> 79: </a><strong><font color="#228B22"> } \</font></strong>
<a name="line80"> 80: </a><strong><font color="#228B22"> } while (0)</font></strong>
<a name="line81"> 81: </a><strong><font color="#228B22"> #define CHKERRCUBLAS(...) PetscCallCUBLAS(__VA_ARGS__)</font></strong>
<a name="line83"> 83: </a><font color="#A020F0"> #if (CUSPARSE_VER_MAJOR > 10 || CUSPARSE_VER_MAJOR == 10 && CUSPARSE_VER_MINOR >= 2) </font><font color="#B22222">/* According to cuda/10.1.168 on OLCF Summit */</font><font color="#A020F0"></font>
<a name="line84"> 84: </a><strong><font color="#228B22"> #define PetscCallCUSPARSE(...) \</font></strong>
<a name="line85"> 85: </a><strong><font color="#228B22"> do { \</font></strong>
<a name="line86"> 86: </a><strong><font color="#228B22"> const cusparseStatus_t _p_cusparse_stat__ = __VA_ARGS__; \</font></strong>
<a name="line87"> 87: </a><strong><font color="#228B22"> if (<a href="../docs/manualpages/Sys/PetscUnlikely.html">PetscUnlikely</a>(_p_cusparse_stat__)) { \</font></strong>
<a name="line88"> 88: </a><strong><font color="#228B22"> const char *name = cusparseGetErrorName(_p_cusparse_stat__); \</font></strong>
<a name="line89"> 89: </a><strong><font color="#228B22"> const char *descr = cusparseGetErrorString(_p_cusparse_stat__); \</font></strong>
<a name="line91"> 91: </a><strong><font color="#228B22"> </font><font color="#666666">"cuSPARSE errorcode %d (%s) : %s.; "</font><font color="#228B22"> \</font></strong>
<a name="line92"> 92: </a><strong><font color="#228B22"> </font><font color="#666666">"this indicates the GPU has run out resources"</font><font color="#228B22">, \</font></strong>
<a name="line93"> 93: </a><strong><font color="#228B22"> (int)_p_cusparse_stat__, name, descr); \</font></strong>
<a name="line94"> 94: </a><strong><font color="#228B22"> <a href="../docs/manualpages/Sys/SETERRQ.html">SETERRQ</a>(<a href="../docs/manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, PETSC_ERR_GPU, </font><font color="#666666">"cuSPARSE errorcode %d (%s) : %s"</font><font color="#228B22">, (int)_p_cusparse_stat__, name, descr); \</font></strong>
<a name="line95"> 95: </a><strong><font color="#228B22"> } \</font></strong>
<a name="line96"> 96: </a><strong><font color="#228B22"> } while (0)</font></strong>
<a name="line97"> 97: </a><font color="#A020F0"> #else </font><font color="#B22222">/* (CUSPARSE_VER_MAJOR > 10 || CUSPARSE_VER_MAJOR == 10 && CUSPARSE_VER_MINOR >= 2) */</font><font color="#A020F0"></font>
<a name="line98"> 98: </a><strong><font color="#228B22"> #define PetscCallCUSPARSE(...) \</font></strong>
<a name="line99"> 99: </a><strong><font color="#228B22"> do { \</font></strong>
<a name="line100">100: </a><strong><font color="#228B22"> const cusparseStatus_t _p_cusparse_stat__ = __VA_ARGS__; \</font></strong>
<a name="line102">102: </a><strong><font color="#228B22"> } while (0)</font></strong>
<a name="line103">103: </a><font color="#A020F0"> #endif </font><font color="#B22222">/* (CUSPARSE_VER_MAJOR > 10 || CUSPARSE_VER_MAJOR == 10 && CUSPARSE_VER_MINOR >= 2) */</font><font color="#A020F0"></font>
<a name="line104">104: </a><strong><font color="#228B22"> #define CHKERRCUSPARSE(...) PetscCallCUSPARSE(__VA_ARGS__)</font></strong>
<a name="line106">106: </a><strong><font color="#228B22"> #define PetscCallCUSOLVER(...) \</font></strong>
<a name="line107">107: </a><strong><font color="#228B22"> do { \</font></strong>
<a name="line108">108: </a><strong><font color="#228B22"> const cusolverStatus_t _p_cusolver_stat__ = __VA_ARGS__; \</font></strong>
<a name="line109">109: </a><strong><font color="#228B22"> if (<a href="../docs/manualpages/Sys/PetscUnlikely.html">PetscUnlikely</a>(_p_cusolver_stat__ != CUSOLVER_STATUS_SUCCESS)) { \</font></strong>
<a name="line110">110: </a><strong><font color="#228B22"> const char *name = PetscCUSolverGetErrorName(_p_cusolver_stat__); \</font></strong>
<a name="line111">111: </a><strong><font color="#228B22"> if (((_p_cusolver_stat__ == CUSOLVER_STATUS_NOT_INITIALIZED) || (_p_cusolver_stat__ == CUSOLVER_STATUS_ALLOC_FAILED) || (_p_cusolver_stat__ == CUSOLVER_STATUS_INTERNAL_ERROR)) && <a href="../docs/manualpages/Sys/PetscDeviceInitialized.html">PetscDeviceInitialized</a>(<a href="../docs/manualpages/Sys/PetscDeviceType.html">PETSC_DEVICE_CUDA</a>)) { \</font></strong>
<a name="line112">112: </a><strong><font color="#228B22"> <a href="../docs/manualpages/Sys/SETERRQ.html">SETERRQ</a>(<a href="../docs/manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, PETSC_ERR_GPU_RESOURCE, \</font></strong>
<a name="line113">113: </a><strong><font color="#228B22"> </font><font color="#666666">"cuSolver error %d (%s). "</font><font color="#228B22"> \</font></strong>
<a name="line114">114: </a><strong><font color="#228B22"> </font><font color="#666666">"This indicates the GPU may have run out resources"</font><font color="#228B22">, \</font></strong>
<a name="line115">115: </a><strong><font color="#228B22"> (<a href="../docs/manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>)_p_cusolver_stat__, name); \</font></strong>
<a name="line116">116: </a><strong><font color="#228B22"> } else { \</font></strong>
<a name="line117">117: </a><strong><font color="#228B22"> <a href="../docs/manualpages/Sys/SETERRQ.html">SETERRQ</a>(<a href="../docs/manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, PETSC_ERR_GPU, </font><font color="#666666">"cuSolver error %d (%s)"</font><font color="#228B22">, (<a href="../docs/manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>)_p_cusolver_stat__, name); \</font></strong>
<a name="line118">118: </a><strong><font color="#228B22"> } \</font></strong>
<a name="line119">119: </a><strong><font color="#228B22"> } \</font></strong>
<a name="line120">120: </a><strong><font color="#228B22"> } while (0)</font></strong>
<a name="line121">121: </a><strong><font color="#228B22"> #define CHKERRCUSOLVER(...) PetscCallCUSOLVER(__VA_ARGS__)</font></strong>
<a name="line123">123: </a><strong><font color="#228B22"> #define PetscCallCUFFT(...) \</font></strong>
<a name="line124">124: </a><strong><font color="#228B22"> do { \</font></strong>
<a name="line125">125: </a><strong><font color="#228B22"> const cufftResult_t _p_cufft_stat__ = __VA_ARGS__; \</font></strong>
<a name="line126">126: </a><strong><font color="#228B22"> if (<a href="../docs/manualpages/Sys/PetscUnlikely.html">PetscUnlikely</a>(_p_cufft_stat__ != CUFFT_SUCCESS)) { \</font></strong>
<a name="line127">127: </a><strong><font color="#228B22"> const char *name = PetscCUFFTGetErrorName(_p_cufft_stat__); \</font></strong>
<a name="line128">128: </a><strong><font color="#228B22"> if (((_p_cufft_stat__ == CUFFT_SETUP_FAILED) || (_p_cufft_stat__ == CUFFT_ALLOC_FAILED)) && <a href="../docs/manualpages/Sys/PetscDeviceInitialized.html">PetscDeviceInitialized</a>(<a href="../docs/manualpages/Sys/PetscDeviceType.html">PETSC_DEVICE_CUDA</a>)) { \</font></strong>
<a name="line129">129: </a><strong><font color="#228B22"> <a href="../docs/manualpages/Sys/SETERRQ.html">SETERRQ</a>(<a href="../docs/manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, PETSC_ERR_GPU_RESOURCE, \</font></strong>
<a name="line130">130: </a><strong><font color="#228B22"> </font><font color="#666666">"cuFFT error %d (%s). "</font><font color="#228B22"> \</font></strong>
<a name="line131">131: </a><strong><font color="#228B22"> </font><font color="#666666">"Reports not initialized or alloc failed; "</font><font color="#228B22"> \</font></strong>
<a name="line132">132: </a><strong><font color="#228B22"> </font><font color="#666666">"this indicates the GPU has run out resources"</font><font color="#228B22">, \</font></strong>
<a name="line133">133: </a><strong><font color="#228B22"> (<a href="../docs/manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>)_p_cufft_stat__, name); \</font></strong>
<a name="line134">134: </a><strong><font color="#228B22"> } else { \</font></strong>
<a name="line135">135: </a><strong><font color="#228B22"> <a href="../docs/manualpages/Sys/SETERRQ.html">SETERRQ</a>(<a href="../docs/manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, PETSC_ERR_GPU, </font><font color="#666666">"cuFFT error %d (%s)"</font><font color="#228B22">, (<a href="../docs/manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>)_p_cufft_stat__, name); \</font></strong>
<a name="line136">136: </a><strong><font color="#228B22"> } \</font></strong>
<a name="line137">137: </a><strong><font color="#228B22"> } \</font></strong>
<a name="line138">138: </a><strong><font color="#228B22"> } while (0)</font></strong>
<a name="line139">139: </a><strong><font color="#228B22"> #define CHKERRCUFFT(...) PetscCallCUFFT(__VA_ARGS__)</font></strong>
<a name="line141">141: </a><strong><font color="#228B22"> #define PetscCallCURAND(...) \</font></strong>
<a name="line142">142: </a><strong><font color="#228B22"> do { \</font></strong>
<a name="line143">143: </a><strong><font color="#228B22"> const curandStatus_t _p_curand_stat__ = __VA_ARGS__; \</font></strong>
<a name="line144">144: </a><strong><font color="#228B22"> if (<a href="../docs/manualpages/Sys/PetscUnlikely.html">PetscUnlikely</a>(_p_curand_stat__ != CURAND_STATUS_SUCCESS)) { \</font></strong>
<a name="line145">145: </a><strong><font color="#228B22"> if (((_p_curand_stat__ == CURAND_STATUS_INITIALIZATION_FAILED) || (_p_curand_stat__ == CURAND_STATUS_ALLOCATION_FAILED)) && <a href="../docs/manualpages/Sys/PetscDeviceInitialized.html">PetscDeviceInitialized</a>(<a href="../docs/manualpages/Sys/PetscDeviceType.html">PETSC_DEVICE_CUDA</a>)) { \</font></strong>
<a name="line146">146: </a><strong><font color="#228B22"> <a href="../docs/manualpages/Sys/SETERRQ.html">SETERRQ</a>(<a href="../docs/manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, PETSC_ERR_GPU_RESOURCE, \</font></strong>
<a name="line147">147: </a><strong><font color="#228B22"> </font><font color="#666666">"cuRAND error %d. "</font><font color="#228B22"> \</font></strong>
<a name="line148">148: </a><strong><font color="#228B22"> </font><font color="#666666">"Reports not initialized or alloc failed; "</font><font color="#228B22"> \</font></strong>
<a name="line149">149: </a><strong><font color="#228B22"> </font><font color="#666666">"this indicates the GPU has run out resources"</font><font color="#228B22">, \</font></strong>
<a name="line150">150: </a><strong><font color="#228B22"> (<a href="../docs/manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>)_p_curand_stat__); \</font></strong>
<a name="line151">151: </a><strong><font color="#228B22"> } else { \</font></strong>
<a name="line152">152: </a><strong><font color="#228B22"> <a href="../docs/manualpages/Sys/SETERRQ.html">SETERRQ</a>(<a href="../docs/manualpages/Sys/PETSC_COMM_SELF.html">PETSC_COMM_SELF</a>, PETSC_ERR_GPU, </font><font color="#666666">"cuRand error %d"</font><font color="#228B22">, (<a href="../docs/manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a>)_p_curand_stat__); \</font></strong>
<a name="line153">153: </a><strong><font color="#228B22"> } \</font></strong>
<a name="line154">154: </a><strong><font color="#228B22"> } \</font></strong>
<a name="line155">155: </a><strong><font color="#228B22"> } while (0)</font></strong>
<a name="line156">156: </a><strong><font color="#228B22"> #define CHKERRCURAND(...) PetscCallCURAND(__VA_ARGS__)</font></strong>
<a name="line158">158: </a>PETSC_EXTERN cudaStream_t PetscDefaultCudaStream; // The <font color="#4169E1">default</font> stream used by PETSc
<a name="line159">159: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../docs/manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscCUBLASGetHandle(cublasHandle_t *)</font></strong>;
<a name="line160">160: </a><strong><font color="#4169E1">PETSC_EXTERN <a href="../docs/manualpages/Sys/PetscErrorCode.html">PetscErrorCode</a> PetscCUSOLVERDnGetHandle(cusolverDnHandle_t *)</font></strong>;
<a name="line162">162: </a><font color="#A020F0">#endif // PETSC_HAVE_CUDA</font>
<a name="line164">164: </a>// these can also be defined in petscdevice_hip.h
<a name="line165">165: </a><font color="#A020F0">#ifndef PETSC_DEVICE_DEFINED_DECLS_PRIVATE</font>
<a name="line166">166: </a><strong><font color="#228B22"> #define PETSC_DEVICE_DEFINED_DECLS_PRIVATE</font></strong>
<a name="line167">167: </a><font color="#A020F0"> #if <a href="../docs/manualpages/Sys/PetscDefined.html">PetscDefined</a>(USING_NVCC)</font>
<a name="line168">168: </a><strong><font color="#228B22"> #define PETSC_HOST_DECL __host__</font></strong>
<a name="line169">169: </a><strong><font color="#228B22"> #define PETSC_DEVICE_DECL __device__</font></strong>
<a name="line170">170: </a><strong><font color="#228B22"> #define PETSC_KERNEL_DECL __global__</font></strong>
<a name="line171">171: </a><strong><font color="#228B22"> #define PETSC_SHAREDMEM_DECL __shared__</font></strong>
<a name="line172">172: </a><strong><font color="#228B22"> #define PETSC_FORCEINLINE __forceinline__</font></strong>
<a name="line173">173: </a><strong><font color="#228B22"> #define PETSC_CONSTMEM_DECL __constant__</font></strong>
<a name="line174">174: </a><font color="#A020F0"> #else</font>
<a name="line175">175: </a><strong><font color="#228B22"> #define PETSC_HOST_DECL</font></strong>
<a name="line176">176: </a><strong><font color="#228B22"> #define PETSC_DEVICE_DECL</font></strong>
<a name="line177">177: </a><strong><font color="#228B22"> #define PETSC_KERNEL_DECL</font></strong>
<a name="line178">178: </a><strong><font color="#228B22"> #define PETSC_SHAREDMEM_DECL</font></strong>
<a name="line179">179: </a><strong><font color="#228B22"> #define PETSC_FORCEINLINE inline</font></strong>
<a name="line180">180: </a><strong><font color="#228B22"> #define PETSC_CONSTMEM_DECL</font></strong>
<a name="line181">181: </a><font color="#A020F0"> #endif // PETSC_USING_NVCC</font>
<a name="line183">183: </a><strong><font color="#228B22"> #define PETSC_HOSTDEVICE_DECL PETSC_HOST_DECL PETSC_DEVICE_DECL</font></strong>
<a name="line184">184: </a><strong><font color="#228B22"> #define PETSC_DEVICE_INLINE_DECL PETSC_DEVICE_DECL PETSC_FORCEINLINE</font></strong>
<a name="line185">185: </a><strong><font color="#228B22"> #define PETSC_HOSTDEVICE_INLINE_DECL PETSC_HOSTDEVICE_DECL PETSC_FORCEINLINE</font></strong>
<a name="line186">186: </a><font color="#A020F0">#endif // PETSC_DEVICE_DEFINED_DECLS_PRIVATE</font>
<a name="line188">188: </a><font color="#A020F0">#endif // PETSCDEVICE_CUDA_H</font>
</pre>
</body>
</html>
|