From f0747747ba26286472e8b7d513c2e2541ab19f66 Mon Sep 17 00:00:00 2001 From: GYDmedwin Date: Sat, 20 Nov 2021 02:40:12 +0800 Subject: [PATCH] [libclc] Delete the wrong file name in the SOURCE file, and add a new implementation file. (#4997) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the unimplemented file name in the SOURCE file: ‘ilogb’ and 'fma'. At the same time, I added the sinh.cl file to ensure correct compilation.In addition, I deleted the redundant code in ‘ldexp’. --- libclc/amdgcn-amdhsa/libspirv/SOURCES | 2 -- libclc/amdgcn-amdhsa/libspirv/math/ldexp.cl | 5 ----- libclc/amdgcn-amdhsa/libspirv/math/sinh.cl | 20 ++++++++++++++++++++ 3 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 libclc/amdgcn-amdhsa/libspirv/math/sinh.cl diff --git a/libclc/amdgcn-amdhsa/libspirv/SOURCES b/libclc/amdgcn-amdhsa/libspirv/SOURCES index 2a0650facae28..3e3a14f221a01 100644 --- a/libclc/amdgcn-amdhsa/libspirv/SOURCES +++ b/libclc/amdgcn-amdhsa/libspirv/SOURCES @@ -23,13 +23,11 @@ math/expm1.cl math/fabs.cl math/fdim.cl math/floor.cl -math/fma.cl math/fmax.cl math/fmin.cl math/fmod.cl math/frexp.cl math/hypot.cl -math/ilogb.cl math/ldexp.cl math/lgamma.cl math/log.cl diff --git a/libclc/amdgcn-amdhsa/libspirv/math/ldexp.cl b/libclc/amdgcn-amdhsa/libspirv/math/ldexp.cl index 2365ac6cf600b..de5942b17666d 100644 --- a/libclc/amdgcn-amdhsa/libspirv/math/ldexp.cl +++ b/libclc/amdgcn-amdhsa/libspirv/math/ldexp.cl @@ -14,11 +14,6 @@ double __ocml_ldexp_f64(double, int); float __ocml_ldexp_f32(float, int); -#define __CLC_FUNCTION __spirv_ocl_ldexp -#define __CLC_BUILTIN __ocml_ldexp -#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) -#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) - _CLC_DEFINE_BINARY_BUILTIN(float, __spirv_ocl_ldexp, __ocml_ldexp_f32, float, int) _CLC_DEFINE_BINARY_BUILTIN(float, __spirv_ocl_ldexp, __ocml_ldexp_f32, float, uint) diff --git a/libclc/amdgcn-amdhsa/libspirv/math/sinh.cl b/libclc/amdgcn-amdhsa/libspirv/math/sinh.cl new file mode 100644 index 0000000000000..590afe60a8dc7 --- /dev/null +++ b/libclc/amdgcn-amdhsa/libspirv/math/sinh.cl @@ -0,0 +1,20 @@ +//===----------------------------------------------------------------------===// +// +// 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_sinh_f64(double); +float __ocml_sinh_f32(float); + +#define __CLC_FUNCTION __spirv_ocl_sinh +#define __CLC_BUILTIN __ocml_sinh +#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) +#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) +#include +