forked from OSchip/llvm-project
parent
d84c7f5d0f
commit
509b3b2104
|
@ -38,6 +38,8 @@
|
|||
#include <clc/math/fabs.h>
|
||||
#include <clc/math/floor.h>
|
||||
#include <clc/math/fma.h>
|
||||
#include <clc/math/fmax.h>
|
||||
#include <clc/math/fmin.h>
|
||||
#include <clc/math/hypot.h>
|
||||
#include <clc/math/log.h>
|
||||
#include <clc/math/log2.h>
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
_CLC_OVERLOAD _CLC_DECL GENTYPE FUNCTION(GENTYPE a, GENTYPE b);
|
||||
_CLC_OVERLOAD _CLC_DECL GENTYPE FUNCTION(GENTYPE a, float b);
|
||||
|
||||
#ifdef cl_khr_fp64
|
||||
_CLC_OVERLOAD _CLC_DECL GENTYPE FUNCTION(GENTYPE a, double b);
|
||||
#endif
|
|
@ -0,0 +1,11 @@
|
|||
#undef fmax
|
||||
#define fmax __clc_fmax
|
||||
|
||||
#define BODY <clc/math/binary_decl.inc>
|
||||
#define FUNCTION __clc_fmax
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef BODY
|
||||
#undef FUNCTION
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#undef fmin
|
||||
#define fmin __clc_fmin
|
||||
|
||||
#define BODY <clc/math/binary_decl.inc>
|
||||
#define FUNCTION __clc_fmin
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef BODY
|
||||
#undef FUNCTION
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
#define GENTYPE float
|
||||
#define SCALAR
|
||||
#include BODY
|
||||
#undef GENTYPE
|
||||
#undef SCALAR
|
||||
|
||||
#define GENTYPE float2
|
||||
#include BODY
|
||||
|
@ -23,9 +25,11 @@
|
|||
#undef GENTYPE
|
||||
|
||||
#ifdef cl_khr_fp64
|
||||
#define SCALAR
|
||||
#define GENTYPE double
|
||||
#include BODY
|
||||
#undef GENTYPE
|
||||
#undef SCALAR
|
||||
|
||||
#define GENTYPE double2
|
||||
#include BODY
|
||||
|
|
|
@ -10,6 +10,8 @@ integer/add_sat_impl.ll
|
|||
integer/sub_sat.cl
|
||||
integer/sub_sat.ll
|
||||
integer/sub_sat_impl.ll
|
||||
math/fmax.cl
|
||||
math/fmin.cl
|
||||
math/hypot.cl
|
||||
math/mad.cl
|
||||
relational/any.cl
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
#ifndef SCALAR
|
||||
|
||||
_CLC_OVERLOAD _CLC_DEF GENTYPE FUNCTION(GENTYPE x, GENTYPE y) {
|
||||
return FUNCTION_IMPL(x, y);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
_CLC_OVERLOAD _CLC_DEF GENTYPE FUNCTION(GENTYPE x, double y) {
|
||||
GENTYPE vec_y = (GENTYPE) (y);
|
||||
return FUNCTION_IMPL(x, vec_y);
|
||||
}
|
||||
|
||||
_CLC_OVERLOAD _CLC_DEF GENTYPE FUNCTION(GENTYPE x, float y) {
|
||||
GENTYPE vec_y = (GENTYPE) (y);
|
||||
return FUNCTION_IMPL(x, vec_y);
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
#include <clc/clc.h>
|
||||
|
||||
#ifdef cl_khr_fp64
|
||||
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
|
||||
#endif
|
||||
|
||||
#define FUNCTION __clc_fmax
|
||||
#define FUNCTION_IMPL(x, y) ((x) < (y) ? (y) : (x))
|
||||
|
||||
#define BODY <binary_impl.inc>
|
||||
#include <clc/math/gentype.inc>
|
|
@ -0,0 +1,11 @@
|
|||
#include <clc/clc.h>
|
||||
|
||||
#ifdef cl_khr_fp64
|
||||
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
|
||||
#endif
|
||||
|
||||
#define FUNCTION __clc_fmin
|
||||
#define FUNCTION_IMPL(x, y) ((y) < (x) ? (y) : (x))
|
||||
|
||||
#define BODY <binary_impl.inc>
|
||||
#include <clc/math/gentype.inc>
|
Loading…
Reference in New Issue