diff --git a/libclc/clc/lib/amdgcn/SOURCES b/libclc/clc/lib/amdgcn/SOURCES index 76c3266e3af7b..357027b7facd9 100644 --- a/libclc/clc/lib/amdgcn/SOURCES +++ b/libclc/clc/lib/amdgcn/SOURCES @@ -1,4 +1,5 @@ math/clc_ldexp_override.cl +math/clc_rsqrt.cl mem_fence/clc_mem_fence.cl synchronization/clc_work_group_barrier.cl workitem/clc_get_global_offset.cl diff --git a/libclc/clc/lib/amdgcn/math/clc_rsqrt.cl b/libclc/clc/lib/amdgcn/math/clc_rsqrt.cl new file mode 100644 index 0000000000000..4a9ae94b744af --- /dev/null +++ b/libclc/clc/lib/amdgcn/math/clc_rsqrt.cl @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// 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 + +float __ocml_rsqrt_f32(float); + +_CLC_OVERLOAD _CLC_DEF float __clc_rsqrt(float x) { return __ocml_rsqrt_f32(x); } + +#ifdef cl_khr_fp64 +#pragma OPENCL EXTENSION cl_khr_fp64 : enable +double __ocml_rsqrt_f64(double); + +_CLC_OVERLOAD _CLC_DEF double __clc_rsqrt(double x) { return __ocml_rsqrt_f64(x); } + +#endif + +#ifdef cl_khr_fp16 +#pragma OPENCL EXTENSION cl_khr_fp16 : enable +half __ocml_rsqrt_f16(half); + +_CLC_OVERLOAD _CLC_DEF half __clc_rsqrt(half x) { + return __ocml_rsqrt_f16(x); +} + +#endif + +#define FUNCTION __clc_rsqrt +#define __CLC_BODY +#include