summaryrefslogtreecommitdiffstats
path: root/libclc/generic/lib/async
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2014-10-03 19:49:39 +0000
committerTom Stellard <thomas.stellard@amd.com>2014-10-03 19:49:39 +0000
commit081e778d2224c6f281168c1336cf9503e65dccb7 (patch)
treed45b5d6a10f318bcbf4b0c6264a05fb2b532bb42 /libclc/generic/lib/async
parented5bbfdb1b5d3b7d76352c37e187663c1b06b06f (diff)
downloadbcm5719-llvm-081e778d2224c6f281168c1336cf9503e65dccb7.tar.gz
bcm5719-llvm-081e778d2224c6f281168c1336cf9503e65dccb7.zip
Implement async_work_group_copy builtin v3
This is a simple implementation which just copies data synchronously. v2: - Use size_t. v3: - Fix possible race condition by splitting the copy among multiple work items. llvm-svn: 219008
Diffstat (limited to 'libclc/generic/lib/async')
-rw-r--r--libclc/generic/lib/async/async_work_group_copy.cl9
-rw-r--r--libclc/generic/lib/async/async_work_group_copy.inc17
2 files changed, 26 insertions, 0 deletions
diff --git a/libclc/generic/lib/async/async_work_group_copy.cl b/libclc/generic/lib/async/async_work_group_copy.cl
new file mode 100644
index 00000000000..fe20ecfd9bb
--- /dev/null
+++ b/libclc/generic/lib/async/async_work_group_copy.cl
@@ -0,0 +1,9 @@
+#include <clc/clc.h>
+
+#ifdef cl_khr_fp64
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+#endif
+
+#define __CLC_BODY <async_work_group_copy.inc>
+#include <clc/async/gentype.inc>
+#undef __CLC_BODY
diff --git a/libclc/generic/lib/async/async_work_group_copy.inc b/libclc/generic/lib/async/async_work_group_copy.inc
new file mode 100644
index 00000000000..a143ddfb9f6
--- /dev/null
+++ b/libclc/generic/lib/async/async_work_group_copy.inc
@@ -0,0 +1,17 @@
+_CLC_OVERLOAD _CLC_DEF event_t async_work_group_copy(
+ local __CLC_GENTYPE *dst,
+ const global __CLC_GENTYPE *src,
+ size_t num_gentypes,
+ event_t event) {
+
+ return async_work_group_strided_copy(dst, src, num_gentypes, 1, event);
+}
+
+_CLC_OVERLOAD _CLC_DEF event_t async_work_group_copy(
+ global __CLC_GENTYPE *dst,
+ const local __CLC_GENTYPE *src,
+ size_t num_gentypes,
+ event_t event) {
+
+ return async_work_group_strided_copy(dst, src, num_gentypes, 1, event);
+}
OpenPOWER on IntegriCloud