Skip to content

Commit a5b88cb

Browse files
authored
[libclc] Add missing includes to CLC headers (#118654)
There's no automatic way of checking these headers are self-contained. Instead of including these common files many times across the whole codebase, we can include them in the generic `gentype.inc` and `floatn.inc` files which are included by most CLC headers.
1 parent 85fdf50 commit a5b88cb

File tree

11 files changed

+19
-3
lines changed

11 files changed

+19
-3
lines changed

libclc/generic/include/clc/geometric/floatn.inc renamed to libclc/clc/include/clc/geometric/floatn.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#include <clc/clcfunc.h>
2+
#include <clc/clctypes.h>
3+
14
#define __CLC_FLOAT float
25
#define __CLC_FPSIZE 32
36

libclc/clc/include/clc/integer/gentype.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#include <clc/clcfunc.h>
2+
#include <clc/clctypes.h>
3+
14
// These 2 defines only change when switching between data sizes or base types
25
// to keep this file manageable.
36
#define __CLC_GENSIZE 8

libclc/clc/include/clc/math/gentype.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#include <clc/clcfunc.h>
2+
#include <clc/clctypes.h>
3+
14
#define __CLC_SCALAR_GENTYPE float
25
#define __CLC_FPSIZE 32
36

libclc/clc/include/clc/math/unary_intrin.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#include <clc/clcfunc.h>
2+
#include <clc/clctypes.h>
3+
14
_CLC_OVERLOAD float __CLC_FUNCTION(float f) __asm(__CLC_INTRINSIC ".f32");
25
_CLC_OVERLOAD float2 __CLC_FUNCTION(float2 f) __asm(__CLC_INTRINSIC ".v2f32");
36
_CLC_OVERLOAD float3 __CLC_FUNCTION(float3 f) __asm(__CLC_INTRINSIC ".v3f32");

libclc/clc/include/clc/relational/clc_all.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#else
88

99
#include <clc/clcfunc.h>
10+
#include <clc/clctypes.h>
1011

1112
#define _CLC_ALL_DECL(TYPE) _CLC_OVERLOAD _CLC_DECL int __clc_all(TYPE v);
1213

libclc/clc/include/clc/relational/clc_any.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#else
88

99
#include <clc/clcfunc.h>
10+
#include <clc/clctypes.h>
1011

1112
#define _CLC_ANY_DECL(TYPE) _CLC_OVERLOAD _CLC_DECL int __clc_any(TYPE v);
1213

libclc/clc/include/clc/relational/clc_isequal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#else
88

99
#include <clc/clcfunc.h>
10+
#include <clc/clctypes.h>
1011

1112
#define _CLC_ISEQUAL_DECL(TYPE, RETTYPE) \
1213
_CLC_OVERLOAD _CLC_DECL RETTYPE __clc_isequal(TYPE x, TYPE y);

libclc/clc/include/clc/relational/clc_isinf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#else
88

99
#include <clc/clcfunc.h>
10+
#include <clc/clctypes.h>
1011

1112
#define _CLC_ISINF_DECL(RET_TYPE, ARG_TYPE) \
1213
_CLC_OVERLOAD _CLC_DECL RET_TYPE __clc_isinf(ARG_TYPE);

libclc/clc/include/clc/relational/clc_isnan.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#else
88

99
#include <clc/clcfunc.h>
10+
#include <clc/clctypes.h>
1011

1112
#define _CLC_ISNAN_DECL(RET_TYPE, ARG_TYPE) \
1213
_CLC_OVERLOAD _CLC_DECL RET_TYPE __clc_isnan(ARG_TYPE);

libclc/clc/include/clc/relational/floatn.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include <clc/clcfunc.h>
2+
#include <clc/clctypes.h>
13

24
#define __CLC_FLOATN float
35
#define __CLC_INTN int

0 commit comments

Comments
 (0)