Proteus
Programmable JIT compilation and optimization for C/C++ using LLVM
Loading...
Searching...
No Matches
UtilsHIP.h
Go to the documentation of this file.
1//===-- UtilsHIP.h -- Utilities header for HIP --===//
2//
3// Part of the Proteus Project, under the Apache License v2.0 with LLVM
4// Exceptions. See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9//===----------------------------------------------------------------------===//
10
11#ifndef PROTEUS_UTILS_HIP_H
12#define PROTEUS_UTILS_HIP_H
13
15
16#include <hip/hip_runtime.h>
17#include <hip/hip_runtime_api.h>
18#include <hip/hiprtc.h>
19
20#define proteusHipErrCheck(CALL) \
21 { \
22 hipError_t err = CALL; \
23 if (err != hipSuccess) { \
24 printf("ERROR @ %s:%d -> %s\n", __FILE__, __LINE__, \
25 proteus::hipdyn::getErrorString(err)); \
26 abort(); \
27 } \
28 }
29
30#define proteusHiprtcErrCheck(CALL) \
31 { \
32 hiprtcResult err = CALL; \
33 if (err != HIPRTC_SUCCESS) { \
34 printf("ERROR @ %s:%d -> %s\n", __FILE__, __LINE__, \
35 proteus::hipdyn::getRTCErrorString(err)); \
36 abort(); \
37 } \
38 }
39
40#endif