mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-12-06 07:51:24 +00:00
This ensures correct handling of NaN. This has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 233712
19 lines
425 B
C++
19 lines
425 B
C++
|
|
#if !defined(__CLC_SCALAR)
|
|
|
|
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE fmin(__CLC_GENTYPE x, float y) {
|
|
return fmin(x, (__CLC_GENTYPE)((__CLC_SCALAR_GENTYPE)y));
|
|
}
|
|
|
|
#ifdef cl_khr_fp64
|
|
|
|
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
|
|
|
|
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE fmin(__CLC_GENTYPE x, double y) {
|
|
return fmin(x, (__CLC_GENTYPE)((__CLC_SCALAR_GENTYPE)y));
|
|
}
|
|
|
|
#endif // ifdef cl_khr_fp64
|
|
|
|
#endif // !defined(__CLC_SCALAR)
|