Skip to content

Commit fe4d0ca

Browse files
frasercrmckgithub-actions[bot]
authored andcommitted
Automerge: [libclc] Mov erf & erfc to CLC library (#140524)
This completes the set of maths builtins. No attempt to vectorize or optimize this code. The implementation is licensed to SunPro so will probably need to be replaced at some point in the future anyway. Calls to other builtins have been replaced with the CLC equivalents, and some bit-hacking was replaced with the fabs builtin.
2 parents adc9624 + c27e10f commit fe4d0ca

File tree

7 files changed

+1087
-791
lines changed

7 files changed

+1087
-791
lines changed

libclc/clc/include/clc/math/clc_erf.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef __CLC_MATH_CLC_ERF_H__
10+
#define __CLC_MATH_CLC_ERF_H__
11+
12+
#define __CLC_BODY <clc/math/unary_decl.inc>
13+
#define __CLC_FUNCTION __clc_erf
14+
15+
#include <clc/math/gentype.inc>
16+
17+
#undef __CLC_FUNCTION
18+
19+
#endif // __CLC_MATH_CLC_ERF_H__
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef __CLC_MATH_CLC_ERFC_H__
10+
#define __CLC_MATH_CLC_ERFC_H__
11+
12+
#define __CLC_BODY <clc/math/unary_decl.inc>
13+
#define __CLC_FUNCTION __clc_erfc
14+
15+
#include <clc/math/gentype.inc>
16+
17+
#undef __CLC_FUNCTION
18+
19+
#endif // __CLC_MATH_CLC_ERFC_H__

libclc/clc/lib/generic/SOURCES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ math/clc_cos.cl
4141
math/clc_cosh.cl
4242
math/clc_cospi.cl
4343
math/clc_ep_log.cl
44+
math/clc_erf.cl
45+
math/clc_erfc.cl
4446
math/clc_exp.cl
4547
math/clc_exp10.cl
4648
math/clc_exp2.cl

0 commit comments

Comments
 (0)