Skip to content

Commit 9d11bd0

Browse files
authored
[libclc] Remove catch-all opencl/clc.h (#147490)
This commit finishes the work started in #146840 and #147276. It makes each OpenCL header self-contained and each implementation file include only the headers it needs. It removes the need for a catch-all include file of all OpenCL builtin declarations.
1 parent a449df2 commit 9d11bd0

File tree

126 files changed

+420
-325
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+420
-325
lines changed

libclc/opencl/include/clc/opencl/as_type.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#ifndef __CLC_OPENCL_AS_TYPE_H__
10+
#define __CLC_OPENCL_AS_TYPE_H__
11+
12+
#include <clc/opencl/opencl-base.h>
13+
914
#define as_char(x) __builtin_astype(x, char)
1015
#define as_uchar(x) __builtin_astype(x, uchar)
1116
#define as_short(x) __builtin_astype(x, short)
@@ -83,3 +88,5 @@
8388
#define as_half8(x) __builtin_astype(x, half8)
8489
#define as_half16(x) __builtin_astype(x, half16)
8590
#endif
91+
92+
#endif // __CLC_OPENCL_AS_TYPE_H__

libclc/opencl/include/clc/opencl/async/async_work_group_copy.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#ifndef __CLC_OPENCL_ASYNC_ASYNC_WORK_GROUP_COPY_H__
10+
#define __CLC_OPENCL_ASYNC_ASYNC_WORK_GROUP_COPY_H__
11+
912
#define __CLC_DST_ADDR_SPACE local
1013
#define __CLC_SRC_ADDR_SPACE global
1114
#define __CLC_BODY <clc/opencl/async/async_work_group_copy.inc>
@@ -23,3 +26,5 @@
2326
#include <clc/math/gentype.inc>
2427
#undef __CLC_DST_ADDR_SPACE
2528
#undef __CLC_SRC_ADDR_SPACE
29+
30+
#endif // __CLC_OPENCL_ASYNC_ASYNC_WORK_GROUP_COPY_H__

libclc/opencl/include/clc/opencl/async/async_work_group_strided_copy.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#ifndef __CLC_OPENCL_ASYNC_ASYNC_WORK_GROUP_STRIDED_COPY_H__
10+
#define __CLC_OPENCL_ASYNC_ASYNC_WORK_GROUP_STRIDED_COPY_H__
11+
912
#define __CLC_DST_ADDR_SPACE local
1013
#define __CLC_SRC_ADDR_SPACE global
1114
#define __CLC_BODY <clc/opencl/async/async_work_group_strided_copy.inc>
@@ -23,3 +26,5 @@
2326
#include <clc/math/gentype.inc>
2427
#undef __CLC_DST_ADDR_SPACE
2528
#undef __CLC_SRC_ADDR_SPACE
29+
30+
#endif // __CLC_OPENCL_ASYNC_ASYNC_WORK_GROUP_STRIDED_COPY_H__

libclc/opencl/include/clc/opencl/async/prefetch.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#ifndef __CLC_OPENCL_ASYNC_PREFETCH_H__
10+
#define __CLC_OPENCL_ASYNC_PREFETCH_H__
11+
912
#define __CLC_BODY <clc/opencl/async/prefetch.inc>
1013
#include <clc/integer/gentype.inc>
1114

1215
#define __CLC_BODY <clc/opencl/async/prefetch.inc>
1316
#include <clc/math/gentype.inc>
17+
18+
#endif // __CLC_OPENCL_ASYNC_PREFETCH_H__

libclc/opencl/include/clc/opencl/async/wait_group_events.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,12 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#ifndef __CLC_OPENCL_ASYNC_WAIT_GROUP_EVENTS_H__
10+
#define __CLC_OPENCL_ASYNC_WAIT_GROUP_EVENTS_H__
11+
12+
#include <clc/opencl/opencl-base.h>
13+
914
_CLC_DECL _CLC_OVERLOAD void wait_group_events(int num_events,
1015
event_t *event_list);
16+
17+
#endif // __CLC_OPENCL_ASYNC_WAIT_GROUP_EVENTS_H__

libclc/opencl/include/clc/opencl/atomic/atom_add.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#ifndef __CLC_OPENCL_ATOMIC_ATOM_ADD_H__
10+
#define __CLC_OPENCL_ATOMIC_ATOM_ADD_H__
11+
12+
#include <clc/opencl/opencl-base.h>
13+
914
#ifdef cl_khr_global_int32_base_atomics
1015
#define FUNCTION atom_add
1116
#define __CLC_ADDRESS_SPACE global
@@ -22,3 +27,5 @@
2227
#define FUNCTION atom_add
2328
#include <clc/opencl/atomic/atom_decl_int64.inc>
2429
#endif // cl_khr_int64_base_atomics
30+
31+
#endif // __CLC_OPENCL_ATOMIC_ATOM_ADD_H__

libclc/opencl/include/clc/opencl/atomic/atom_and.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#ifndef __CLC_OPENCL_ATOMIC_ATOM_AND_H__
10+
#define __CLC_OPENCL_ATOMIC_ATOM_AND_H__
11+
12+
#include <clc/opencl/opencl-base.h>
13+
914
#ifdef cl_khr_global_int32_extended_atomics
1015
#define FUNCTION atom_and
1116
#define __CLC_ADDRESS_SPACE global
@@ -22,3 +27,5 @@
2227
#define FUNCTION atom_and
2328
#include <clc/opencl/atomic/atom_decl_int64.inc>
2429
#endif // cl_khr_int64_extended_atomics
30+
31+
#endif // __CLC_OPENCL_ATOMIC_ATOM_AND_H__

libclc/opencl/include/clc/opencl/atomic/atom_cmpxchg.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#ifndef __CLC_OPENCL_ATOMIC_ATOM_CMPXCHG_H__
10+
#define __CLC_OPENCL_ATOMIC_ATOM_CMPXCHG_H__
11+
12+
#include <clc/opencl/opencl-base.h>
13+
914
#include <clc/clcfunc.h>
1015
#include <clc/clctypes.h>
1116

@@ -37,3 +42,5 @@ _CLC_OVERLOAD _CLC_DECL unsigned long
3742
atom_cmpxchg(volatile local unsigned long *p, unsigned long cmp,
3843
unsigned long val);
3944
#endif // cl_khr_int64_base_atomics
45+
46+
#endif // __CLC_OPENCL_ATOMIC_ATOM_CMPXCHG_H__

libclc/opencl/include/clc/opencl/atomic/atom_dec.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#ifndef __CLC_OPENCL_ATOMIC_ATOM_DEC_H__
10+
#define __CLC_OPENCL_ATOMIC_ATOM_DEC_H__
11+
12+
#include <clc/opencl/opencl-base.h>
13+
914
#include <clc/clcfunc.h>
1015
#include <clc/clctypes.h>
1116

@@ -26,3 +31,5 @@ atom_dec(volatile global unsigned long *p);
2631
_CLC_OVERLOAD _CLC_DECL long atom_dec(volatile local long *p);
2732
_CLC_OVERLOAD _CLC_DECL unsigned long atom_dec(volatile local unsigned long *p);
2833
#endif // cl_khr_int64_base_atomics
34+
35+
#endif // __CLC_OPENCL_ATOMIC_ATOM_DEC_H__

libclc/opencl/include/clc/opencl/atomic/atom_inc.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#ifndef __CLC_OPENCL_ATOMIC_ATOM_INC_H__
10+
#define __CLC_OPENCL_ATOMIC_ATOM_INC_H__
11+
12+
#include <clc/opencl/opencl-base.h>
13+
914
#include <clc/clcfunc.h>
1015
#include <clc/clctypes.h>
1116

@@ -26,3 +31,5 @@ atom_inc(volatile global unsigned long *p);
2631
_CLC_OVERLOAD _CLC_DECL long atom_inc(volatile local long *p);
2732
_CLC_OVERLOAD _CLC_DECL unsigned long atom_inc(volatile local unsigned long *p);
2833
#endif // cl_khr_int64_base_atomics
34+
35+
#endif // __CLC_OPENCL_ATOMIC_ATOM_INC_H__

0 commit comments

Comments
 (0)