32 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/internal/clc.h>10 11_CLC_DEF _CLC_OVERLOAD float __clc_fmax(float x, float y) {12 return __builtin_fmaxf(x, y);13}14 15#ifdef cl_khr_fp6416#pragma OPENCL EXTENSION cl_khr_fp64 : enable17_CLC_DEF _CLC_OVERLOAD double __clc_fmax(double x, double y) {18 return __builtin_fmax(x, y);19}20#endif21 22#ifdef cl_khr_fp1623#pragma OPENCL EXTENSION cl_khr_fp16 : enable24_CLC_DEF _CLC_OVERLOAD half __clc_fmax(half x, half y) {25 return __builtin_fmaxf16(x, y);26}27#endif28 29#define __CLC_FUNCTION __clc_fmax30#define __CLC_BODY <clc/shared/binary_def_scalarize.inc>31#include <clc/math/gentype.inc>32