[Mesa-dev] [PATCH 1/1] r600: Use llvm intrinsic to read work dimension information

Jan Vesely jan.vesely at rutgers.edu
Wed Jul 30 16:11:37 PDT 2014


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           | 6 ++++++
 3 files changed, 8 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..b4251e4
--- /dev/null
+++ b/generic/include/clc/workitem/get_work_dim.h
@@ -0,0 +1 @@
+_CLC_DECL uint get_num_groups();
diff --git a/r600/lib/SOURCES b/r600/lib/SOURCES
index d9fc897..1677102 100644
--- a/r600/lib/SOURCES
+++ b/r600/lib/SOURCES
@@ -5,6 +5,7 @@ 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
 shared/vload.cl
diff --git a/r600/lib/workitem/get_work_dim.ll b/r600/lib/workitem/get_work_dim.ll
new file mode 100644
index 0000000..aefdabd
--- /dev/null
+++ b/r600/lib/workitem/get_work_dim.ll
@@ -0,0 +1,6 @@
+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
+  ret i32 %x
+}
-- 
1.9.3



More information about the mesa-dev mailing list