Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/device/hip/util.h')
-rw-r--r--intern/cycles/device/hip/util.h9
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..e9420becb2d 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 >= 1);
+}
+
CCL_NAMESPACE_END
#endif /* WITH_HIP */