Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion libclc/clc/include/clc/clcmacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,21 @@

#define _CLC_DEFINE_UNARY_BUILTIN(RET_TYPE, FUNCTION, BUILTIN, ARG1_TYPE) \
_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG1_TYPE x) { return BUILTIN(x); } \
_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, RET_TYPE, FUNCTION, ARG1_TYPE)
_CLC_DEF _CLC_OVERLOAD RET_TYPE##2 FUNCTION(ARG1_TYPE##2 x) { \
return BUILTIN(x); \
} \
_CLC_DEF _CLC_OVERLOAD RET_TYPE##3 FUNCTION(ARG1_TYPE##3 x) { \
return BUILTIN(x); \
} \
_CLC_DEF _CLC_OVERLOAD RET_TYPE##4 FUNCTION(ARG1_TYPE##4 x) { \
return BUILTIN(x); \
} \
_CLC_DEF _CLC_OVERLOAD RET_TYPE##8 FUNCTION(ARG1_TYPE##8 x) { \
return BUILTIN(x); \
} \
_CLC_DEF _CLC_OVERLOAD RET_TYPE##16 FUNCTION(ARG1_TYPE##16 x) { \
return BUILTIN(x); \
}

#ifdef cl_khr_fp16

Expand Down
7 changes: 0 additions & 7 deletions libclc/clc/include/clc/math/clc_ceil.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#ifndef __CLC_MATH_CLC_CEIL_H__
#define __CLC_MATH_CLC_CEIL_H__

#if defined(CLC_CLSPV) || defined(CLC_SPIRV)
// clspv and spir-v targets provide their own OpenCL-compatible ceil
#define __clc_ceil ceil
#else

// Map the function to an LLVM intrinsic
#define __CLC_FUNCTION __clc_ceil
#define __CLC_INTRINSIC "llvm.ceil"
Expand All @@ -14,6 +9,4 @@
#undef __CLC_INTRINSIC
#undef __CLC_FUNCTION

#endif

#endif // __CLC_MATH_CLC_CEIL_H__
7 changes: 0 additions & 7 deletions libclc/clc/include/clc/math/clc_fabs.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#ifndef __CLC_MATH_CLC_FABS_H__
#define __CLC_MATH_CLC_FABS_H__

#if defined(CLC_CLSPV) || defined(CLC_SPIRV)
// clspv and spir-v targets provide their own OpenCL-compatible fabs
#define __clc_fabs fabs
#else

// Map the function to an LLVM intrinsic
#define __CLC_FUNCTION __clc_fabs
#define __CLC_INTRINSIC "llvm.fabs"
Expand All @@ -14,6 +9,4 @@
#undef __CLC_INTRINSIC
#undef __CLC_FUNCTION

#endif

#endif // __CLC_MATH_CLC_FABS_H__
7 changes: 0 additions & 7 deletions libclc/clc/include/clc/math/clc_floor.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#ifndef __CLC_MATH_CLC_FLOOR_H__
#define __CLC_MATH_CLC_FLOOR_H__

#if defined(CLC_CLSPV) || defined(CLC_SPIRV)
// clspv and spir-v targets provide their own OpenCL-compatible floor
#define __clc_floor floor
#else

// Map the function to an LLVM intrinsic
#define __CLC_FUNCTION __clc_floor
#define __CLC_INTRINSIC "llvm.floor"
Expand All @@ -14,6 +9,4 @@
#undef __CLC_INTRINSIC
#undef __CLC_FUNCTION

#endif

#endif // __CLC_MATH_CLC_FLOOR_H__
7 changes: 0 additions & 7 deletions libclc/clc/include/clc/math/clc_rint.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#ifndef __CLC_MATH_CLC_RINT_H__
#define __CLC_MATH_CLC_RINT_H__

#if defined(CLC_CLSPV) || defined(CLC_SPIRV)
// clspv and spir-v targets provide their own OpenCL-compatible rint
#define __clc_rint rint
#else

// Map the function to an LLVM intrinsic
#define __CLC_FUNCTION __clc_rint
#define __CLC_INTRINSIC "llvm.rint"
Expand All @@ -14,6 +9,4 @@
#undef __CLC_INTRINSIC
#undef __CLC_FUNCTION

#endif

#endif // __CLC_MATH_CLC_RINT_H__
7 changes: 0 additions & 7 deletions libclc/clc/include/clc/math/clc_trunc.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#ifndef __CLC_MATH_CLC_TRUNC_H__
#define __CLC_MATH_CLC_TRUNC_H__

#if defined(CLC_CLSPV) || defined(CLC_SPIRV)
// clspv and spir-v targets provide their own OpenCL-compatible trunc
#define __clc_trunc trunc
#else

// Map the function to an LLVM intrinsic
#define __CLC_FUNCTION __clc_trunc
#define __CLC_INTRINSIC "llvm.trunc"
Expand All @@ -14,6 +9,4 @@
#undef __CLC_INTRINSIC
#undef __CLC_FUNCTION

#endif

#endif // __CLC_MATH_CLC_TRUNC_H__
Loading