DFT-FE
1.1.0-pre
Density Functional Theory With Finite-Elements
Loading...
Searching...
No Matches
workspace
include
DeviceExceptions.hip.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 dftfeDeviceExceptions_hiph
18
#define dftfeDeviceExceptions_hiph
19
20
21
#define DEVICE_API_CHECK(cmd) \
22
do \
23
{ \
24
hipError_t e = cmd; \
25
if (e != hipSuccess) \
26
{ \
27
printf("Failed: HIP error %s:%d '%s'\n", \
28
__FILE__, \
29
__LINE__, \
30
hipGetErrorString(e)); \
31
exit(EXIT_FAILURE); \
32
} \
33
} \
34
while (0)
35
36
#define DEVICEBLAS_API_CHECK(expr) \
37
{ \
38
hipblasStatus_t __hipblas_error = expr; \
39
if ((__hipblas_error) != HIPBLAS_STATUS_SUCCESS) \
40
{ \
41
printf( \
42
"hipBLAS error on or before line number %d in file: %s. Error code: %d.\n", \
43
__LINE__, \
44
__FILE__, \
45
__hipblas_error); \
46
} \
47
}
48
49
50
#endif
// dftfeDeviceExceptions_hiph
Generated by
1.13.2