22 #ifndef RAJA_hiperrchk_HPP
23 #define RAJA_hiperrchk_HPP
25 #include "RAJA/config.hpp"
27 #if defined(RAJA_ENABLE_HIP)
34 #include <string_view>
39 #include <hip/hip_runtime.h>
41 #include "camp/defines.hpp"
42 #include "camp/helpers.hpp"
46 #if defined(__HIPCC__)
48 #define ROCPRIM_HIP_API 1
49 #include "rocprim/types.hpp"
55 namespace experimental
59 struct StreamInsertHelper<RAJA_HIP_DIM_T&>
61 RAJA_HIP_DIM_T& m_val;
63 std::ostream& operator()(std::ostream& str)
const
65 return str <<
"{" << m_val.x <<
"," << m_val.y <<
"," << m_val.z <<
"}";
71 struct StreamInsertHelper<RAJA_HIP_DIM_T const&>
73 RAJA_HIP_DIM_T
const& m_val;
75 std::ostream& operator()(std::ostream& str)
const
77 return str <<
"{" << m_val.x <<
"," << m_val.y <<
"," << m_val.z <<
"}";
81 #if defined(__HIPCC__)
83 struct StreamInsertHelper<::rocprim::double_buffer<R>&>
85 ::rocprim::double_buffer<R>& m_val;
87 std::ostream& operator()(std::ostream& str)
const
89 return str <<
"{" << m_val.current() <<
"," << m_val.alternate() <<
"}";
95 struct StreamInsertHelper<::rocprim::double_buffer<R> const&>
97 ::rocprim::double_buffer<R>
const& m_val;
99 std::ostream& operator()(std::ostream& str)
const
101 return str <<
"{" << m_val.current() <<
"," << m_val.alternate() <<
"}";
122 #define hipErrchk(ans) \
124 ::RAJA::hipAssert((ans), __FILE__, __LINE__); \
127 [[deprecated]]
inline void hipAssert(hipError_t code,
132 if (code != hipSuccess)
137 msg +=
"HIPassert: ";
138 msg += hipGetErrorString(code);
142 msg += std::to_string(line);
143 throw std::runtime_error(msg);
147 fprintf(stderr,
"HIPassert: %s %s %d\n", hipGetErrorString(code), file,
Header file for common RAJA internal macro definitions.
Definition: AlignedRangeIndexSetBuilders.cpp:35