[Libclc-dev] [PATCH] Implement prefetch builtin

Aaron Watry awatry at gmail.com
Sat Aug 9 09:37:35 PDT 2014


Looks good to me as well.

--Aaron

On Thu, Aug 7, 2014 at 11:40 AM, Tom Stellard <thomas.stellard at amd.com> wrote:
> The default implementation is a no-op.  Targets should override this
> with their own implementations.
> ---
>  generic/include/clc/async/prefetch.h   | 3 +++
>  generic/include/clc/async/prefetch.inc | 1 +
>  generic/include/clc/clc.h              | 3 +++
>  generic/lib/SOURCES                    | 1 +
>  generic/lib/async/prefetch.cl          | 9 +++++++++
>  generic/lib/async/prefetch.inc         | 1 +
>  6 files changed, 18 insertions(+)
>  create mode 100644 generic/include/clc/async/prefetch.h
>  create mode 100644 generic/include/clc/async/prefetch.inc
>  create mode 100644 generic/lib/async/prefetch.cl
>  create mode 100644 generic/lib/async/prefetch.inc
>
> diff --git a/generic/include/clc/async/prefetch.h b/generic/include/clc/async/prefetch.h
> new file mode 100644
> index 0000000..f64bc20
> --- /dev/null
> +++ b/generic/include/clc/async/prefetch.h
> @@ -0,0 +1,3 @@
> +#define __CLC_BODY <clc/async/prefetch.inc>
> +#include <clc/async/gentype.inc>
> +#undef __CLC_BODY
> diff --git a/generic/include/clc/async/prefetch.inc b/generic/include/clc/async/prefetch.inc
> new file mode 100644
> index 0000000..f817a66
> --- /dev/null
> +++ b/generic/include/clc/async/prefetch.inc
> @@ -0,0 +1 @@
> +_CLC_OVERLOAD _CLC_DECL void prefetch(const global __CLC_GENTYPE *p, size_t num_gentypes);
> diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
> index 60b5a6c..b6adbba 100644
> --- a/generic/include/clc/clc.h
> +++ b/generic/include/clc/clc.h
> @@ -124,6 +124,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>
> diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES
> index 7efe08c..c8eed0c 100644
> --- a/generic/lib/SOURCES
> +++ b/generic/lib/SOURCES
> @@ -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
> diff --git a/generic/lib/async/prefetch.cl b/generic/lib/async/prefetch.cl
> new file mode 100644
> index 0000000..45af21b
> --- /dev/null
> +++ b/generic/lib/async/prefetch.cl
> @@ -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
> diff --git a/generic/lib/async/prefetch.inc b/generic/lib/async/prefetch.inc
> new file mode 100644
> index 0000000..6747e4c
> --- /dev/null
> +++ b/generic/lib/async/prefetch.inc
> @@ -0,0 +1 @@
> +_CLC_OVERLOAD _CLC_DEF void prefetch(const global __CLC_GENTYPE *p, size_t num_gentypes) { }
> --
> 1.8.1.5
>
>
> _______________________________________________
> 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