[Libclc-dev] [PATCH 04/14] amdgpu: Add workaround for unimplemented llvm.exp intrinsic

Jeroen Ketema via Libclc-dev libclc-dev at lists.llvm.org
Fri Nov 10 14:01:13 PST 2017


LGTM.

Jeroen

> On 4 Nov 2017, at 00:07, Jan Vesely via Libclc-dev <libclc-dev at lists.llvm.org> wrote:
> 
> Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
> ---
> amdgpu/lib/SOURCES             | 1 +
> amdgpu/lib/math/native_exp.cl  | 5 +++++
> amdgpu/lib/math/native_exp.inc | 3 +++
> 3 files changed, 9 insertions(+)
> create mode 100644 amdgpu/lib/math/native_exp.cl
> create mode 100644 amdgpu/lib/math/native_exp.inc
> 
> diff --git a/amdgpu/lib/SOURCES b/amdgpu/lib/SOURCES
> index 59d8b22..20322ec 100644
> --- a/amdgpu/lib/SOURCES
> +++ b/amdgpu/lib/SOURCES
> @@ -1,3 +1,4 @@
> +math/native_exp.cl
> math/native_log.cl
> math/native_log10.cl
> math/nextafter.cl
> diff --git a/amdgpu/lib/math/native_exp.cl b/amdgpu/lib/math/native_exp.cl
> new file mode 100644
> index 0000000..71c9a2e
> --- /dev/null
> +++ b/amdgpu/lib/math/native_exp.cl
> @@ -0,0 +1,5 @@
> +#include <clc/clc.h>
> +
> +#define __CLC_BODY <native_exp.inc>
> +#define __FLOAT_ONLY
> +#include <clc/math/gentype.inc>
> diff --git a/amdgpu/lib/math/native_exp.inc b/amdgpu/lib/math/native_exp.inc
> new file mode 100644
> index 0000000..c61ec01
> --- /dev/null
> +++ b/amdgpu/lib/math/native_exp.inc
> @@ -0,0 +1,3 @@
> +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_exp(__CLC_GENTYPE val) {
> +  return native_exp2(val * M_LOG2E_F);
> +}
> -- 
> 2.13.6
> 
> _______________________________________________
> Libclc-dev mailing list
> Libclc-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/libclc-dev



More information about the Libclc-dev mailing list