DFT-EFE
Loading...
Searching...
No Matches
DeviceExceptions.cu.h
Go to the documentation of this file.
1
// ---------------------------------------------------------------------
2
//
3
// Copyright (c) 2017-2025 The Regents of the University of Michigan and DFT-FE
4
// authors.
5
//
6
// This file is part of the DFT-FE code.
7
//
8
// The DFT-FE code is free software; you can use it, redistribute
9
// it, and/or modify it under the terms of the GNU Lesser General
10
// Public License as published by the Free Software Foundation; either
11
// version 2.1 of the License, or (at your option) any later version.
12
// The full text of the license can be found in the file LICENSE at
13
// the top level of the DFT-FE distribution.
14
//
15
// ---------------------------------------------------------------------
16
//
17
#ifndef dftefeDeviceExceptions_cuh
18
#define dftefeDeviceExceptions_cuh
19
20
21
#define DEVICE_API_CHECK(cmd) \
22
do \
23
{ \
24
cudaError_t e = cmd; \
25
if (e != cudaSuccess) \
26
{ \
27
printf("Failed: Cuda error in %s at %s:%d '%s'\n"
, \
28
__func__, \
29
__FILE__, \
30
__LINE__, \
31
cudaGetErrorString(e)); \
32
exit(EXIT_FAILURE); \
33
} \
34
} \
35
while (0)
36
37
#define DEVICEBLAS_API_CHECK(expr) \
38
{ \
39
cublasStatus_t __cublas_error = expr; \
40
if ((__cublas_error) != CUBLAS_STATUS_SUCCESS) \
41
{ \
42
printf( \
43
"cuBLAS error on or before line number %d in file: %s. Error code: %d.\n"
, \
44
__LINE__, \
45
__FILE__, \
46
__cublas_error); \
47
} \
48
}
49
50
51
#endif
// dftefeDeviceExceptions_cuh
src
utils
DeviceExceptions.cu.h
Generated by
1.9.5