Skip to content

Commit d601e2e

Browse files
wenju-hegoogle-yfyang
authored andcommitted
[libclc] Move prefetch to clc library (llvm#141721)
llvm-diff shows no change to amdgcn--amdhsa.bc
1 parent 3b30696 commit d601e2e

File tree

7 files changed

+59
-1
lines changed

7 files changed

+59
-1
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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_ASYNC_CLC_PREFETCH_H__
10+
#define __CLC_ASYNC_CLC_PREFETCH_H__
11+
12+
#define __CLC_BODY <clc/async/clc_prefetch.inc>
13+
#include <clc/integer/gentype.inc>
14+
15+
#define __CLC_BODY <clc/async/clc_prefetch.inc>
16+
#include <clc/math/gentype.inc>
17+
18+
#endif // __CLC_ASYNC_CLC_PREFETCH_H__
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
_CLC_OVERLOAD _CLC_DECL void __clc_prefetch(const global __CLC_GENTYPE *p,
10+
size_t num_gentypes);

libclc/clc/lib/generic/SOURCES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
async/clc_prefetch.cl
12
common/clc_degrees.cl
23
common/clc_radians.cl
34
common/clc_sign.cl
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
#include <clc/async/clc_prefetch.h>
10+
#include <clc/internal/clc.h>
11+
12+
#define __CLC_BODY <clc_prefetch.inc>
13+
#include <clc/integer/gentype.inc>
14+
15+
#define __CLC_BODY <clc_prefetch.inc>
16+
#include <clc/math/gentype.inc>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
_CLC_OVERLOAD _CLC_DEF void __clc_prefetch(const global __CLC_GENTYPE *p,
10+
size_t num_gentypes) {}

libclc/opencl/lib/generic/async/prefetch.cl

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

9+
#include <clc/async/clc_prefetch.h>
910
#include <clc/opencl/clc.h>
1011

1112
#define __CLC_BODY <prefetch.inc>

libclc/opencl/lib/generic/async/prefetch.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
_CLC_OVERLOAD _CLC_DEF void prefetch(const global __CLC_GENTYPE *p,
10-
size_t num_gentypes) {}
10+
size_t num_gentypes) {
11+
__clc_prefetch(p, num_gentypes);
12+
}

0 commit comments

Comments
 (0)