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

Tom Stellard tom at stellard.net
Wed Oct 15 06:46:14 PDT 2014


On Tue, Oct 14, 2014 at 01:47:08PM -0400, Jan Vesely wrote:
> v2: Fix function declaration
>     Add range metadata to r600 implementation
> v3: change prefix to AMDGPU
> 
> Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>

LGTM.

> ---
>  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..b02ef74
> --- /dev/null
> +++ b/r600/lib/workitem/get_work_dim.ll
> @@ -0,0 +1,8 @@
> +declare i32 @llvm.AMDGPU.read.workdim() nounwind readnone
> +
> +define i32 @get_work_dim() nounwind readnone alwaysinline {
> +  %x = call i32 @llvm.AMDGPU.read.workdim() nounwind readnone , !range !0
> +  ret i32 %x
> +}
> +
> +!0 = metadata !{ i8 1, i8 2, i8 3 }
> -- 
> 1.9.3
> 
> 
> _______________________________________________
> Libclc-dev mailing list
> Libclc-dev at pcc.me.uk
> http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev




More information about the Libclc-dev mailing list