[Libclc-dev] [PATCH 1/1] r600: Use llvm intrinsic to read work dimension information
Jan Vesely
jan.vesely at rutgers.edu
Sat Oct 11 15:20:49 PDT 2014
v2: Fix function declration
Add range metadata to r600 implementation
Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---
generic/include/clc/workitem/get_work_dim.h | 1 +
r600/lib/SOURCES | 1 +
r600/lib/workitem/get_work_dim.ll | 8 ++++++++
3 files changed, 10 insertions(+)
create mode 100644 generic/include/clc/workitem/get_work_dim.h
create mode 100644 r600/lib/workitem/get_work_dim.ll
diff --git a/generic/include/clc/workitem/get_work_dim.h b/generic/include/clc/workitem/get_work_dim.h
new file mode 100644
index 0000000..6d19825
--- /dev/null
+++ b/generic/include/clc/workitem/get_work_dim.h
@@ -0,0 +1 @@
+_CLC_DECL uint get_work_dim();
diff --git a/r600/lib/SOURCES b/r600/lib/SOURCES
index ba56605..ef23d83 100644
--- a/r600/lib/SOURCES
+++ b/r600/lib/SOURCES
@@ -5,5 +5,6 @@ workitem/get_group_id.ll
workitem/get_local_size.ll
workitem/get_local_id.ll
workitem/get_global_size.ll
+workitem/get_work_dim.ll
synchronization/barrier.cl
synchronization/barrier_impl.ll
diff --git a/r600/lib/workitem/get_work_dim.ll b/r600/lib/workitem/get_work_dim.ll
new file mode 100644
index 0000000..8b47eb1
--- /dev/null
+++ b/r600/lib/workitem/get_work_dim.ll
@@ -0,0 +1,8 @@
+declare i32 @llvm.r600.read.workdim() nounwind readnone
+
+define i32 @get_work_dim() nounwind readnone alwaysinline {
+ %x = call i32 @llvm.r600.read.workdim() nounwind readnone , !range !0
+ ret i32 %x
+}
+
+!0 = metadata !{ i8 1, i8 2, i8 3 }
--
1.9.3
More information about the Libclc-dev
mailing list