[libclc] r216127 - Implement prefetch builtin
Tom Stellard
thomas.stellard at amd.com
Wed Aug 20 14:23:04 PDT 2014
Author: tstellar
Date: Wed Aug 20 16:23:03 2014
New Revision: 216127
URL: http://llvm.org/viewvc/llvm-project?rev=216127&view=rev
Log:
Implement prefetch builtin
The default implementation is a no-op. Targets should override this
with their own implementations.
Added:
libclc/trunk/generic/include/clc/async/
libclc/trunk/generic/include/clc/async/prefetch.h
libclc/trunk/generic/include/clc/async/prefetch.inc
libclc/trunk/generic/lib/async/
libclc/trunk/generic/lib/async/prefetch.cl
libclc/trunk/generic/lib/async/prefetch.inc
Modified:
libclc/trunk/generic/include/clc/clc.h
libclc/trunk/generic/lib/SOURCES
Added: libclc/trunk/generic/include/clc/async/prefetch.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/async/prefetch.h?rev=216127&view=auto
==============================================================================
--- libclc/trunk/generic/include/clc/async/prefetch.h (added)
+++ libclc/trunk/generic/include/clc/async/prefetch.h Wed Aug 20 16:23:03 2014
@@ -0,0 +1,3 @@
+#define __CLC_BODY <clc/async/prefetch.inc>
+#include <clc/async/gentype.inc>
+#undef __CLC_BODY
Added: libclc/trunk/generic/include/clc/async/prefetch.inc
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/async/prefetch.inc?rev=216127&view=auto
==============================================================================
--- libclc/trunk/generic/include/clc/async/prefetch.inc (added)
+++ libclc/trunk/generic/include/clc/async/prefetch.inc Wed Aug 20 16:23:03 2014
@@ -0,0 +1 @@
+_CLC_OVERLOAD _CLC_DECL void prefetch(const global __CLC_GENTYPE *p, size_t num_gentypes);
Modified: libclc/trunk/generic/include/clc/clc.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/clc.h?rev=216127&r1=216126&r2=216127&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/clc.h (original)
+++ libclc/trunk/generic/include/clc/clc.h Wed Aug 20 16:23:03 2014
@@ -126,6 +126,9 @@
#include <clc/synchronization/cl_mem_fence_flags.h>
#include <clc/synchronization/barrier.h>
+/* 6.11.10 Async Copy and Prefetch Functions */
+#include <clc/async/prefetch.h>
+
/* 6.11.11 Atomic Functions */
#include <clc/atomic/atomic_add.h>
#include <clc/atomic/atomic_dec.h>
Modified: libclc/trunk/generic/lib/SOURCES
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=216127&r1=216126&r2=216127&view=diff
==============================================================================
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Wed Aug 20 16:23:03 2014
@@ -1,3 +1,4 @@
+async/prefetch.cl
atomic/atomic_impl.ll
cl_khr_global_int32_base_atomics/atom_add.cl
cl_khr_global_int32_base_atomics/atom_dec.cl
Added: libclc/trunk/generic/lib/async/prefetch.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/async/prefetch.cl?rev=216127&view=auto
==============================================================================
--- libclc/trunk/generic/lib/async/prefetch.cl (added)
+++ libclc/trunk/generic/lib/async/prefetch.cl Wed Aug 20 16:23:03 2014
@@ -0,0 +1,9 @@
+#include <clc/clc.h>
+
+#ifdef cl_khr_fp64
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+#endif
+
+#define __CLC_BODY <prefetch.inc>
+#include <clc/async/gentype.inc>
+#undef __CLC_BODY
Added: libclc/trunk/generic/lib/async/prefetch.inc
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/async/prefetch.inc?rev=216127&view=auto
==============================================================================
--- libclc/trunk/generic/lib/async/prefetch.inc (added)
+++ libclc/trunk/generic/lib/async/prefetch.inc Wed Aug 20 16:23:03 2014
@@ -0,0 +1 @@
+_CLC_OVERLOAD _CLC_DEF void prefetch(const global __CLC_GENTYPE *p, size_t num_gentypes) { }
More information about the cfe-commits
mailing list