1/*========================== begin_copyright_notice ============================ 2 3Copyright (C) 2017-2021 Intel Corporation 4 5SPDX-License-Identifier: MIT 6 7============================= end_copyright_notice ===========================*/ 8 9#include "../include/BiF_Definitions.cl" 10 11INLINE int OVERLOADABLE isordered( float x, float y ) 12{ 13 return (x == x) & (y == y) ? 1: 0; 14} 15 16static INLINE int OVERLOADABLE __intel_vector_isordered_helper( float x, float y ) 17{ 18 return (x == x) & (y == y) ? -1 : 0; 19} 20 21GENERATE_VECTOR_FUNCTIONS_2ARGS_EXPLICIT( isordered, __intel_vector_isordered_helper, int, float ) 22 23#if defined(cl_khr_fp64) 24 25INLINE int OVERLOADABLE isordered( double x, double y ) 26{ 27 return (x == x) & (y == y) ? 1 : 0; 28} 29 30static INLINE long OVERLOADABLE __intel_vector_isordered_helper( double x, double y ) 31{ 32 return (x == x) & (y == y) ? -1 : 0; 33} 34 35GENERATE_VECTOR_FUNCTIONS_2ARGS_EXPLICIT( isordered, __intel_vector_isordered_helper, long, double ) 36 37#endif // defined(cl_khr_fp64) 38 39#if defined(cl_khr_fp16) 40 41INLINE int OVERLOADABLE isordered( half x, half y ) 42{ 43 return (x == x) & (y == y) ? 1 : 0; 44} 45 46static INLINE short OVERLOADABLE __intel_vector_isordered_helper( half x, half y ) 47{ 48 return (x == x) & (y == y) ? -1 : 0; 49} 50 51GENERATE_VECTOR_FUNCTIONS_2ARGS_EXPLICIT( isordered, __intel_vector_isordered_helper, short, half ) 52 53#endif // defined(cl_khr_fp16) 54