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();
52bool hipSupportsDriver();
54static std::string hipDeviceArch(
const int hipDevId)
56 hipDeviceProp_t props;
57 hipGetDeviceProperties(&props, hipDevId);
58 const char *arch = strtok(props.gcnArchName,
":");
59 return (arch ==
nullptr) ? props.gcnArchName : arch;
62static inline bool hipSupportsDevice(
const int hipDevId)
65 hipDeviceGetAttribute(&major, hipDeviceAttributeComputeCapabilityMajor, hipDevId);
66 hipDeviceGetAttribute(&minor, hipDeviceAttributeComputeCapabilityMinor, hipDevId);
71static inline bool hipIsRDNA2OrNewer(
const int hipDevId)
74 hipDeviceGetAttribute(&major, hipDeviceAttributeComputeCapabilityMajor, hipDevId);
75 hipDeviceGetAttribute(&minor, hipDeviceAttributeComputeCapabilityMinor, hipDevId);
77 return (major > 10 || (major == 10 && minor >= 3));
80static inline bool hipSupportsDeviceOIDN(
const int hipDevId)
83 const std::string arch = hipDeviceArch(hipDevId);
84 return (arch ==
"gfx1030" || arch ==
"gfx1100" || arch ==
"gfx1101" || arch ==
"gfx1102" ||
85 arch ==
"gfx1200" || arch ==
"gfx1201");
#define CCL_NAMESPACE_END