Skip to content

release/21.x: opencl: Ensure printf symbol is not mangled. (#150210) #150960

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 29, 2025
Merged
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
11 changes: 10 additions & 1 deletion clang/lib/Headers/opencl-c-base.h
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,16 @@ template <typename _Tp> struct __remove_address_space<__constant _Tp> {
#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_1_2)
// OpenCL v1.2 s6.12.13, v2.0 s6.13.13 - printf

int printf(__constant const char* st, ...) __attribute__((format(printf, 1, 2)));
#ifdef __OPENCL_CPP_VERSION__
#define CLINKAGE extern "C"
#else
#define CLINKAGE
#endif

CLINKAGE int printf(__constant const char *st, ...)
__attribute__((format(printf, 1, 2)));

#undef CLINKAGE
#endif

#ifdef cl_intel_device_side_avc_motion_estimation
Expand Down
Loading