35 lines · plain
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-exception6//7//===----------------------------------------------------------------------===//8 9#include <clc/math/clc_sqrt.h>10 11float __nv_sqrtf(float);12double __nv_sqrt(double);13 14_CLC_OVERLOAD _CLC_DEF float __clc_sqrt(float x) { return __nv_sqrtf(x); }15 16#ifdef cl_khr_fp6417#pragma OPENCL EXTENSION cl_khr_fp64 : enable18 19_CLC_OVERLOAD _CLC_DEF double __clc_sqrt(double x) { return __nv_sqrt(x); }20 21#endif22 23#ifdef cl_khr_fp1624#pragma OPENCL EXTENSION cl_khr_fp16 : enable25 26_CLC_OVERLOAD _CLC_DEF half __clc_sqrt(half x) {27 return (half)__clc_sqrt((float)x);28}29 30#endif31 32#define __CLC_FUNCTION __clc_sqrt33#define __CLC_BODY <clc/shared/unary_def_scalarize.inc>34#include <clc/math/gentype.inc>35