Debian Codegraph @

libclc/clc/lib/ptx-nvidiacl/math/clc_rsqrt.cl

raw
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include <clc/math/clc_rsqrt.h>
10
11 float __nv_rsqrtf(float);
12 double __nv_rsqrt(double);
13
14 _CLC_OVERLOAD _CLC_DEF float __clc_rsqrt(float x) { return __nv_rsqrtf(x); }
15
16 #ifdef cl_khr_fp64
17 #pragma OPENCL EXTENSION cl_khr_fp64 : enable
18
19 _CLC_OVERLOAD _CLC_DEF double __clc_rsqrt(double x) { return __nv_rsqrt(x); }
20
21 #endif
22
23 #ifdef cl_khr_fp16
24 #pragma OPENCL EXTENSION cl_khr_fp16 : enable
25
26 _CLC_OVERLOAD _CLC_DEF half __clc_rsqrt(half x) {
27 return (half)__clc_rsqrt((float)x);
28 }
29
30 #endif
31
32 #define __CLC_FUNCTION __clc_rsqrt
33 #define __CLC_BODY <clc/shared/unary_def_scalarize.inc>
34 #include <clc/math/gentype.inc>