Skip to content

[libclc] Move prefetch to clc library #141721

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
May 29, 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
18 changes: 18 additions & 0 deletions libclc/clc/include/clc/async/clc_prefetch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//===----------------------------------------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

#ifndef __CLC_ASYNC_CLC_PREFETCH_H__
#define __CLC_ASYNC_CLC_PREFETCH_H__

#define __CLC_BODY <clc/async/clc_prefetch.inc>
#include <clc/integer/gentype.inc>

#define __CLC_BODY <clc/async/clc_prefetch.inc>
#include <clc/math/gentype.inc>

#endif // __CLC_ASYNC_CLC_PREFETCH_H__
10 changes: 10 additions & 0 deletions libclc/clc/include/clc/async/clc_prefetch.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//===----------------------------------------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

_CLC_OVERLOAD _CLC_DECL void __clc_prefetch(const global __CLC_GENTYPE *p,
size_t num_gentypes);
1 change: 1 addition & 0 deletions libclc/clc/lib/generic/SOURCES
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
async/clc_prefetch.cl
common/clc_degrees.cl
common/clc_radians.cl
common/clc_sign.cl
Expand Down
16 changes: 16 additions & 0 deletions libclc/clc/lib/generic/async/clc_prefetch.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//===----------------------------------------------------------------------===//
//
// 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 <clc/async/clc_prefetch.h>
#include <clc/internal/clc.h>

#define __CLC_BODY <clc_prefetch.inc>
#include <clc/integer/gentype.inc>

#define __CLC_BODY <clc_prefetch.inc>
#include <clc/math/gentype.inc>
10 changes: 10 additions & 0 deletions libclc/clc/lib/generic/async/clc_prefetch.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//===----------------------------------------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

_CLC_OVERLOAD _CLC_DEF void __clc_prefetch(const global __CLC_GENTYPE *p,
size_t num_gentypes) {}
1 change: 1 addition & 0 deletions libclc/opencl/lib/generic/async/prefetch.cl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//

#include <clc/async/clc_prefetch.h>
#include <clc/opencl/clc.h>

#define __CLC_BODY <prefetch.inc>
Expand Down
4 changes: 3 additions & 1 deletion libclc/opencl/lib/generic/async/prefetch.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
//===----------------------------------------------------------------------===//

_CLC_OVERLOAD _CLC_DEF void prefetch(const global __CLC_GENTYPE *p,
size_t num_gentypes) {}
size_t num_gentypes) {
__clc_prefetch(p, num_gentypes);
}
Loading