12# ifdef WITH_HIP_DYNLOAD
21class HIPContextScope {
23 HIPContextScope(HIPDevice *device);
31# define hip_device_assert(hip_device, stmt) \
33 hipError_t result = stmt; \
34 if (result != hipSuccess) { \
35 const char *name = hipewErrorString(result); \
36 hip_device->set_error( \
37 string_printf("%s in %s (%s:%d)", name, #stmt, __FILE__, __LINE__)); \
42# define hip_assert(stmt) hip_device_assert(this, stmt)
44# ifndef WITH_HIP_DYNLOAD
47const char *hipewErrorString(hipError_t result);
48const char *hipewCompilerPath();
49int hipewCompilerVersion();
52static std::string hipDeviceArch(
const int hipDevId)
54 hipDeviceProp_t props;
55 hipGetDeviceProperties(&props, hipDevId);
56 const char *arch = strtok(props.gcnArchName,
":");
57 return (arch ==
nullptr) ? props.gcnArchName : arch;
60static inline bool hipSupportsDevice(
const int hipDevId)
63 hipDeviceGetAttribute(&major, hipDeviceAttributeComputeCapabilityMajor, hipDevId);
64 hipDeviceGetAttribute(&minor, hipDeviceAttributeComputeCapabilityMinor, hipDevId);
69static inline bool hipSupportsDeviceOIDN(
const int hipDevId)
72 const std::string arch = hipDeviceArch(hipDevId);
73 return (arch ==
"gfx1030" || arch ==
"gfx1100" || arch ==
"gfx1101" || arch ==
"gfx1102");
#define CCL_NAMESPACE_END