-
Notifications
You must be signed in to change notification settings - Fork 747
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libclc] Add new function implementations in math. (#4864)
In the math package, there are only atan.cl, cbrt.cl, cos.cl, sin.cl, and sqrt.cl files initially. The other files in the math package I submitted this time are all newly implemented. We are using the SYCL-CTS test set for testing, one of which is the math_builtin_api test. Only when these files are newly added can it be compiled and passed.
- Loading branch information
Showing
45 changed files
with
1,063 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <clcmacro.h> | ||
#include <spirv/spirv.h> | ||
|
||
double __ocml_acos_f64(double); | ||
float __ocml_acos_f32(float); | ||
|
||
#define __CLC_FUNCTION __spirv_ocl_acos | ||
#define __CLC_BUILTIN __ocml_acos | ||
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) | ||
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) | ||
#include <math/unary_builtin.inc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <clcmacro.h> | ||
#include <spirv/spirv.h> | ||
|
||
double __ocml_acosh_f64(double); | ||
float __ocml_acosh_f32(float); | ||
|
||
#define __CLC_FUNCTION __spirv_ocl_acosh | ||
#define __CLC_BUILTIN __ocml_acosh | ||
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) | ||
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) | ||
#include <math/unary_builtin.inc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <clcmacro.h> | ||
#include <spirv/spirv.h> | ||
|
||
double __ocml_asin_f64(double); | ||
float __ocml_asin_f32(float); | ||
|
||
|
||
#define __CLC_FUNCTION __spirv_ocl_asin | ||
#define __CLC_BUILTIN __ocml_asin | ||
|
||
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) | ||
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) | ||
#include <math/unary_builtin.inc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <clcmacro.h> | ||
#include <spirv/spirv.h> | ||
|
||
double __ocml_asinh_f64(double); | ||
float __ocml_asinh_f32(float); | ||
|
||
#define __CLC_FUNCTION __spirv_ocl_asinh | ||
#define __CLC_BUILTIN __ocml_asinh | ||
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) | ||
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) | ||
#include <math/unary_builtin.inc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <clcmacro.h> | ||
#include <spirv/spirv.h> | ||
|
||
double __ocml_atan2_f64(double,double); | ||
float __ocml_atan2_f32(float,float); | ||
|
||
#define __CLC_FUNCTION __spirv_ocl_atan2 | ||
#define __CLC_BUILTIN __ocml_atan2 | ||
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) | ||
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) | ||
#include <math/binary_builtin.inc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <clcmacro.h> | ||
#include <spirv/spirv.h> | ||
|
||
double __ocml_atanh_f64(double); | ||
float __ocml_atanh_f32(float); | ||
|
||
#define __CLC_FUNCTION __spirv_ocl_atanh | ||
#define __CLC_BUILTIN __ocml_atanh | ||
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) | ||
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) | ||
#include <math/unary_builtin.inc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <clcmacro.h> | ||
#include <spirv/spirv.h> | ||
|
||
double __ocml_ceil_f64(double); | ||
float __ocml_ceil_f32(float); | ||
|
||
#define __CLC_FUNCTION __spirv_ocl_ceil | ||
#define __CLC_BUILTIN __ocml_ceil | ||
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) | ||
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) | ||
#include <math/unary_builtin.inc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <clcmacro.h> | ||
#include <spirv/spirv.h> | ||
|
||
double __ocml_copysign_f64(double, double); | ||
float __ocml_copysign_f32(float, float); | ||
|
||
#define __CLC_FUNCTION __spirv_ocl_copysign | ||
#define __CLC_BUILTIN __ocml_copysign | ||
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) | ||
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) | ||
#include <math/binary_builtin.inc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <clcmacro.h> | ||
#include <spirv/spirv.h> | ||
|
||
double __ocml_cosh_f64(double); | ||
float __ocml_cosh_f32(float); | ||
|
||
#define __CLC_FUNCTION __spirv_ocl_cosh | ||
#define __CLC_BUILTIN __ocml_cosh | ||
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) | ||
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) | ||
#include <math/unary_builtin.inc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <clcmacro.h> | ||
#include <spirv/spirv.h> | ||
|
||
double __ocml_cospi_f64(double); | ||
float __ocml_cospi_f32(float); | ||
|
||
#define __CLC_FUNCTION __spirv_ocl_cospi | ||
#define __CLC_BUILTIN __ocml_cospi | ||
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) | ||
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) | ||
#include <math/unary_builtin.inc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <clcmacro.h> | ||
#include <spirv/spirv.h> | ||
|
||
double __ocml_erf_f64(double); | ||
float __ocml_erf_f32(float); | ||
|
||
#define __CLC_FUNCTION __spirv_ocl_erf | ||
#define __CLC_BUILTIN __ocml_erf | ||
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) | ||
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) | ||
#include <math/unary_builtin.inc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <clcmacro.h> | ||
#include <spirv/spirv.h> | ||
|
||
double __ocml_erfc_f64(double); | ||
float __ocml_erfc_f32(float); | ||
|
||
#define __CLC_FUNCTION __spirv_ocl_erfc | ||
#define __CLC_BUILTIN __ocml_erfc | ||
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) | ||
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) | ||
#include <math/unary_builtin.inc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <clcmacro.h> | ||
#include <spirv/spirv.h> | ||
|
||
double __ocml_exp_f64(double); | ||
float __ocml_exp_f32(float); | ||
|
||
#define __CLC_FUNCTION __spirv_ocl_exp | ||
#define __CLC_BUILTIN __ocml_exp | ||
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) | ||
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) | ||
#include <math/unary_builtin.inc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <clcmacro.h> | ||
#include <spirv/spirv.h> | ||
|
||
double __ocml_exp10_f64(double); | ||
float __ocml_exp10_f32(float); | ||
|
||
#define __CLC_FUNCTION __spirv_ocl_exp10 | ||
#define __CLC_BUILTIN __ocml_exp10 | ||
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) | ||
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) | ||
#include <math/unary_builtin.inc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <clcmacro.h> | ||
#include <spirv/spirv.h> | ||
|
||
double __ocml_exp2_f64(double); | ||
float __ocml_exp2_f32(float); | ||
|
||
#define __CLC_FUNCTION __spirv_ocl_exp2 | ||
#define __CLC_BUILTIN __ocml_exp2 | ||
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) | ||
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) | ||
#include <math/unary_builtin.inc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <clcmacro.h> | ||
#include <spirv/spirv.h> | ||
|
||
double __ocml_expm1_f64(double); | ||
float __ocml_expm1_f32(float); | ||
|
||
#define __CLC_FUNCTION __spirv_ocl_expm1 | ||
#define __CLC_BUILTIN __ocml_expm1 | ||
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) | ||
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) | ||
#include <math/unary_builtin.inc> |
Oops, something went wrong.