From a43f7c6ab5ee2ef519560d89aeab20d6fc51c60a Mon Sep 17 00:00:00 2001 From: Jakub Chlanda Date: Wed, 21 Jul 2021 14:42:51 +0100 Subject: [PATCH] [SYCL][LIBCLC] Add atan and cbrt for amdgcn-amdhsa --- libclc/amdgcn-amdhsa/libspirv/SOURCES | 2 ++ libclc/amdgcn-amdhsa/libspirv/math/atan.cl | 19 +++++++++++++++++++ libclc/amdgcn-amdhsa/libspirv/math/cbrt.cl | 19 +++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 libclc/amdgcn-amdhsa/libspirv/math/atan.cl create mode 100644 libclc/amdgcn-amdhsa/libspirv/math/cbrt.cl diff --git a/libclc/amdgcn-amdhsa/libspirv/SOURCES b/libclc/amdgcn-amdhsa/libspirv/SOURCES index b48c765c795b5..e291cd7d16538 100644 --- a/libclc/amdgcn-amdhsa/libspirv/SOURCES +++ b/libclc/amdgcn-amdhsa/libspirv/SOURCES @@ -5,3 +5,5 @@ synchronization/barrier.cl math/cos.cl math/sin.cl math/sqrt.cl +math/atan.cl +math/cbrt.cl diff --git a/libclc/amdgcn-amdhsa/libspirv/math/atan.cl b/libclc/amdgcn-amdhsa/libspirv/math/atan.cl new file mode 100644 index 0000000000000..a6581f3fbb2b5 --- /dev/null +++ b/libclc/amdgcn-amdhsa/libspirv/math/atan.cl @@ -0,0 +1,19 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include +#include + +double __ocml_atan_f64(double); +float __ocml_atan_f32(float); + +#define __CLC_FUNCTION __spirv_ocl_atan +#define __CLC_BUILTIN __ocml_atan +#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) +#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) +#include diff --git a/libclc/amdgcn-amdhsa/libspirv/math/cbrt.cl b/libclc/amdgcn-amdhsa/libspirv/math/cbrt.cl new file mode 100644 index 0000000000000..c358450bfc9aa --- /dev/null +++ b/libclc/amdgcn-amdhsa/libspirv/math/cbrt.cl @@ -0,0 +1,19 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include +#include + +double __ocml_cbrt_f64(double); +float __ocml_cbrt_f32(float); + +#define __CLC_FUNCTION __spirv_ocl_cbrt +#define __CLC_BUILTIN __ocml_cbrt +#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) +#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) +#include