[libclc] r315191 - ptx: Use __clc_nextafter to implement nextafter

Jan Vesely via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 8 12:34:00 PDT 2017


Author: jvesely
Date: Sun Oct  8 12:34:00 2017
New Revision: 315191

URL: http://llvm.org/viewvc/llvm-project?rev=315191&view=rev
Log:
ptx: Use __clc_nextafter to implement nextafter

using clang builtin results in external library call

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>

Added:
    libclc/trunk/ptx/lib/SOURCES
    libclc/trunk/ptx/lib/math/
    libclc/trunk/ptx/lib/math/nextafter.cl

Added: libclc/trunk/ptx/lib/SOURCES
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/ptx/lib/SOURCES?rev=315191&view=auto
==============================================================================
--- libclc/trunk/ptx/lib/SOURCES (added)
+++ libclc/trunk/ptx/lib/SOURCES Sun Oct  8 12:34:00 2017
@@ -0,0 +1 @@
+math/nextafter.cl

Added: libclc/trunk/ptx/lib/math/nextafter.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/ptx/lib/math/nextafter.cl?rev=315191&view=auto
==============================================================================
--- libclc/trunk/ptx/lib/math/nextafter.cl (added)
+++ libclc/trunk/ptx/lib/math/nextafter.cl Sun Oct  8 12:34:00 2017
@@ -0,0 +1,10 @@
+#include <clc/clc.h>
+#include "../lib/clcmacro.h"
+#include <math/clc_nextafter.h>
+
+_CLC_DEFINE_BINARY_BUILTIN(float, nextafter, __clc_nextafter, float, float)
+
+#ifdef cl_khr_fp64
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+_CLC_DEFINE_BINARY_BUILTIN(double, nextafter, __clc_nextafter, double, double)
+#endif




More information about the cfe-commits mailing list