Skip to content

Commit a821ae2

Browse files
authored
[libclc] Move round to CLC library (llvm#128721)
1 parent cf3b036 commit a821ae2

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#ifndef __CLC_MATH_CLC_ROUND_H__
2+
#define __CLC_MATH_CLC_ROUND_H__
3+
4+
#define __CLC_BODY <clc/math/unary_decl.inc>
5+
#define __CLC_FUNCTION __clc_round
6+
7+
#include <clc/math/gentype.inc>
8+
9+
#undef __CLC_BODY
10+
#undef __CLC_FUNCTION
11+
12+
#endif // __CLC_MATH_CLC_ROUND_H__

libclc/clc/lib/generic/SOURCES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ math/clc_modf.cl
3131
math/clc_nan.cl
3232
math/clc_nextafter.cl
3333
math/clc_rint.cl
34+
math/clc_round.cl
3435
math/clc_sw_fma.cl
3536
math/clc_trunc.cl
3637
relational/clc_all.cl
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <clc/internal/clc.h>
2+
3+
#undef __CLC_FUNCTION
4+
#define __CLC_FUNCTION __clc_round
5+
#define __CLC_BUILTIN __builtin_elementwise_round
6+
#include <clc/math/unary_builtin.inc>

libclc/generic/lib/math/round.cl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#include <clc/clc.h>
2-
3-
// Map the llvm intrinsic to an OpenCL function.
4-
#define __CLC_FUNCTION __clc_round
5-
#define __CLC_INTRINSIC "llvm.round"
6-
#include <clc/math/unary_intrin.inc>
2+
#include <clc/clcmacro.h>
3+
#include <clc/math/clc_round.h>
74

85
#undef __CLC_FUNCTION
96
#define __CLC_FUNCTION round

0 commit comments

Comments
 (0)