[libclc] 56/92: amdgpu/math: Don't use llvm instrinsic for native_log

Andreas Boll aboll-guest at moszumanska.debian.org
Mon Nov 6 15:12:01 UTC 2017


This is an automated email from the git hooks/post-receive script.

aboll-guest pushed a commit to branch master
in repository libclc.

commit 93364d62d82323b66ab38d8e1527ad9d9944816d
Author: Jan Vesely <jan.vesely at rutgers.edu>
Date:   Wed Oct 25 16:49:17 2017 +0000

    amdgpu/math: Don't use llvm instrinsic for native_log
    
    AMDGPU targets don't have insturction for it,
    so it'll be expanded to C * log2 anyway.
    
    v2: use native_log2 instead of the more precise sw implementation
    v3: move to amdgpu
    v4: drop old AMD copyright
    
    Reviewer: Aaron Watry
    Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
    
    git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@316587 91177308-0d34-0410-b5e6-96231b3b80d8
---
 amdgpu/lib/SOURCES             | 1 +
 amdgpu/lib/math/native_log.cl  | 5 +++++
 amdgpu/lib/math/native_log.inc | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/amdgpu/lib/SOURCES b/amdgpu/lib/SOURCES
index ce5fe66..8cbe1d4 100644
--- a/amdgpu/lib/SOURCES
+++ b/amdgpu/lib/SOURCES
@@ -1,2 +1,3 @@
+math/native_log.cl
 math/nextafter.cl
 math/sqrt.cl
diff --git a/amdgpu/lib/math/native_log.cl b/amdgpu/lib/math/native_log.cl
new file mode 100644
index 0000000..3c5592f
--- /dev/null
+++ b/amdgpu/lib/math/native_log.cl
@@ -0,0 +1,5 @@
+#include <clc/clc.h>
+
+#define __CLC_BODY <native_log.inc>
+#define __FLOAT_ONLY
+#include <clc/math/gentype.inc>
diff --git a/amdgpu/lib/math/native_log.inc b/amdgpu/lib/math/native_log.inc
new file mode 100644
index 0000000..e6818dc
--- /dev/null
+++ b/amdgpu/lib/math/native_log.inc
@@ -0,0 +1,3 @@
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_log(__CLC_GENTYPE val) {
+  return native_log2(val) * (1.0f / M_LOG2E_F);
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/libclc.git



More information about the Pkg-opencl-commits mailing list