aboutsummaryrefslogtreecommitdiff
path: root/Eigen/src/Core/arch/HIP/hcc/math_constants.h
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-11 05:06:52 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-11 05:06:52 +0000
commit19fd8cac02d060b4cf3f4b4e5125c8479aa59906 (patch)
treefb979fb4cf4f8052c8cc66b1ec9516d91fcd859b /Eigen/src/Core/arch/HIP/hcc/math_constants.h
parent2a5db74dcb99835414a0d2b00f0196fbe617087d (diff)
parentedb0ad5bb04b48aab7dd0978f0475edd3550de7c (diff)
downloadeigen-android13-mainline-networking-release.tar.gz
Change-Id: Ib5d79dcffd4079e8d0f72f2b49a2715306c8ffe2
Diffstat (limited to 'Eigen/src/Core/arch/HIP/hcc/math_constants.h')
-rw-r--r--Eigen/src/Core/arch/HIP/hcc/math_constants.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/Eigen/src/Core/arch/HIP/hcc/math_constants.h b/Eigen/src/Core/arch/HIP/hcc/math_constants.h
new file mode 100644
index 000000000..25375a0a4
--- /dev/null
+++ b/Eigen/src/Core/arch/HIP/hcc/math_constants.h
@@ -0,0 +1,23 @@
+/*
+ * math_constants.h -
+ * HIP equivalent of the CUDA header of the same name
+ */
+
+#ifndef __MATH_CONSTANTS_H__
+#define __MATH_CONSTANTS_H__
+
+/* single precision constants */
+
+#define HIPRT_INF_F __int_as_float(0x7f800000)
+#define HIPRT_NAN_F __int_as_float(0x7fffffff)
+#define HIPRT_MIN_DENORM_F __int_as_float(0x00000001)
+#define HIPRT_MAX_NORMAL_F __int_as_float(0x7f7fffff)
+#define HIPRT_NEG_ZERO_F __int_as_float(0x80000000)
+#define HIPRT_ZERO_F 0.0f
+#define HIPRT_ONE_F 1.0f
+
+/* double precision constants */
+#define HIPRT_INF __hiloint2double(0x7ff00000, 0x00000000)
+#define HIPRT_NAN __hiloint2double(0xfff80000, 0x00000000)
+
+#endif