Skip to content

[libspirv] Reuse clc functions in generic implementation of math native built-ins #19492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 4 additions & 3 deletions libclc/libspirv/lib/generic/math/native_cos.cl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
//
//===----------------------------------------------------------------------===//

#include <clc/math/clc_native_cos.h>
#include <libspirv/spirv.h>

#define __CLC_NATIVE_INTRINSIC cos

#define __CLC_BODY <native_unary_intrinsic.inc>
#define __FLOAT_ONLY
#define FUNCTION __spirv_ocl_native_cos
#define __CLC_FUNCTION(x) __clc_native_cos
#define __CLC_BODY <clc/shared/unary_def.inc>
#include <clc/math/gentype.inc>
7 changes: 4 additions & 3 deletions libclc/libspirv/lib/generic/math/native_exp.cl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
//
//===----------------------------------------------------------------------===//

#include <clc/math/clc_native_exp.h>
#include <libspirv/spirv.h>

#define __CLC_NATIVE_INTRINSIC exp

#define __CLC_BODY <native_unary_intrinsic.inc>
#define __FLOAT_ONLY
#define FUNCTION __spirv_ocl_native_exp
#define __CLC_FUNCTION(x) __clc_native_exp
#define __CLC_BODY <clc/shared/unary_def.inc>
#include <clc/math/gentype.inc>
7 changes: 4 additions & 3 deletions libclc/libspirv/lib/generic/math/native_exp2.cl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
//
//===----------------------------------------------------------------------===//

#include <clc/math/clc_native_exp2.h>
#include <libspirv/spirv.h>

#define __CLC_NATIVE_INTRINSIC exp2

#define __CLC_BODY <native_unary_intrinsic.inc>
#define __FLOAT_ONLY
#define FUNCTION __spirv_ocl_native_exp2
#define __CLC_FUNCTION(x) __clc_native_exp2
#define __CLC_BODY <clc/shared/unary_def.inc>
#include <clc/math/gentype.inc>
7 changes: 4 additions & 3 deletions libclc/libspirv/lib/generic/math/native_log.cl
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
* THE SOFTWARE.
*/

#include <clc/math/clc_native_log.h>
#include <libspirv/spirv.h>

#define __CLC_NATIVE_INTRINSIC log

#define __CLC_BODY <native_unary_intrinsic.inc>
#define __FLOAT_ONLY
#define FUNCTION __spirv_ocl_native_log
#define __CLC_FUNCTION(x) __clc_native_log
#define __CLC_BODY <clc/shared/unary_def.inc>
#include <clc/math/gentype.inc>
7 changes: 4 additions & 3 deletions libclc/libspirv/lib/generic/math/native_log10.cl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
//
//===----------------------------------------------------------------------===//

#include <clc/math/clc_native_log10.h>
#include <libspirv/spirv.h>

#define __CLC_NATIVE_INTRINSIC log10

#define __CLC_BODY <native_unary_intrinsic.inc>
#define __FLOAT_ONLY
#define FUNCTION __spirv_ocl_native_log10
#define __CLC_FUNCTION(x) __clc_native_log10
#define __CLC_BODY <clc/shared/unary_def.inc>
#include <clc/math/gentype.inc>
7 changes: 4 additions & 3 deletions libclc/libspirv/lib/generic/math/native_log2.cl
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
* THE SOFTWARE.
*/

#include <clc/math/clc_native_log2.h>
#include <libspirv/spirv.h>

#define __CLC_NATIVE_INTRINSIC log2

#define __CLC_BODY <native_unary_intrinsic.inc>
#define __FLOAT_ONLY
#define FUNCTION __spirv_ocl_native_log2
#define __CLC_FUNCTION(x) __clc_native_log2
#define __CLC_BODY <clc/shared/unary_def.inc>
#include <clc/math/gentype.inc>
7 changes: 4 additions & 3 deletions libclc/libspirv/lib/generic/math/native_sin.cl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
//
//===----------------------------------------------------------------------===//

#include <clc/math/clc_native_sin.h>
#include <libspirv/spirv.h>

#define __CLC_NATIVE_INTRINSIC sin

#define __CLC_BODY <native_unary_intrinsic.inc>
#define __FLOAT_ONLY
#define FUNCTION __spirv_ocl_native_sin
#define __CLC_FUNCTION(x) __clc_native_sin
#define __CLC_BODY <clc/shared/unary_def.inc>
#include <clc/math/gentype.inc>
7 changes: 4 additions & 3 deletions libclc/libspirv/lib/generic/math/native_sqrt.cl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
//
//===----------------------------------------------------------------------===//

#include <clc/math/clc_native_sqrt.h>
#include <libspirv/spirv.h>

#define __CLC_NATIVE_INTRINSIC sqrt

#define __CLC_BODY <native_unary_intrinsic.inc>
#define __FLOAT_ONLY
#define FUNCTION __spirv_ocl_native_sqrt
#define __CLC_FUNCTION(x) __clc_native_sqrt
#define __CLC_BODY <clc/shared/unary_def.inc>
#include <clc/math/gentype.inc>
27 changes: 0 additions & 27 deletions libclc/libspirv/lib/generic/math/native_unary_intrinsic.inc

This file was deleted.

42 changes: 0 additions & 42 deletions libclc/libspirv/lib/generic/math/unary_intrin.inc

This file was deleted.