[Libclc-dev] [PATCH 1/2] Implement generic rint()

Tom Stellard tom at stellard.net
Thu Aug 1 19:22:39 PDT 2013


From: Tom Stellard <thomas.stellard at amd.com>

---
 generic/include/clc/clc.h       | 1 +
 generic/include/clc/math/rint.h | 6 ++++++
 2 files changed, 7 insertions(+)
 create mode 100644 generic/include/clc/math/rint.h

diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index 9a2f443..c3d3f31 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -46,6 +46,7 @@
 #include <clc/math/log2.h>
 #include <clc/math/mad.h>
 #include <clc/math/pow.h>
+#include <clc/math/rint.h>
 #include <clc/math/sin.h>
 #include <clc/math/sqrt.h>
 #include <clc/math/native_cos.h>
diff --git a/generic/include/clc/math/rint.h b/generic/include/clc/math/rint.h
new file mode 100644
index 0000000..d257634
--- /dev/null
+++ b/generic/include/clc/math/rint.h
@@ -0,0 +1,6 @@
+#undef rint
+#define rint __clc_rint
+
+#define __CLC_FUNCTION __clc_rint
+#define __CLC_INTRINSIC "llvm.rint"
+#include <clc/math/unary_intrin.inc>
-- 
1.7.11.4





More information about the Libclc-dev mailing list