diff options
author | Brecht Van Lommel <brecht> | 2021-11-04 22:29:07 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-11-04 22:34:21 +0300 |
commit | 4960ad420bcfd79db2884ec7a42c2bf01c1c2b85 (patch) | |
tree | 0d89983b58c5aca4c7fa254fc5e69ccb932160a6 /intern/cycles/device/hip/util.h | |
parent | 36f5198282d3e91b11d9db488705a852377edd31 (diff) |
Cycles: add code to check for supported HIP device architectures
RDNA2 only for now to be conservative, but testing more hardware is underway.
Ref T92393
Differential Revision: https://developer.blender.org/D12958
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 */ |