diff options
Diffstat (limited to 'intern/cycles/device/hip/util.h')
-rw-r--r-- | intern/cycles/device/hip/util.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/intern/cycles/device/hip/util.h b/intern/cycles/device/hip/util.h index 0db5174a3db..f3194ecaa77 100644 --- a/intern/cycles/device/hip/util.h +++ b/intern/cycles/device/hip/util.h @@ -58,6 +58,15 @@ const char *hipewCompilerPath(); int hipewCompilerVersion(); # endif /* WITH_HIP_DYNLOAD */ +static inline bool hipSupportsDevice(const int hipDevId) +{ + int major, minor; + hipDeviceGetAttribute(&major, hipDeviceAttributeComputeCapabilityMajor, hipDevId); + hipDeviceGetAttribute(&minor, hipDeviceAttributeComputeCapabilityMinor, hipDevId); + + return (major > 10) || (major == 10 && minor >= 3); +} + CCL_NAMESPACE_END #endif /* WITH_HIP */ |