Skip to content

[libclc] Build for OpenCL 3.0 #135733

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 7 commits into from
Apr 23, 2025
Merged

Conversation

wenju-he
Copy link
Contributor

@wenju-he wenju-he commented Apr 15, 2025

This PR is modified cherry-pick of intel/llvm@cba338e5fb1c
This PR sets OpenCL language version to be the same, which is 3.0,
for every target and device, in order to unify the build process.
Target should define supported extensions and features via setSupportedOpenCLOpts API.

llvm-diff shows one change to amdgcn--amdhsa.bc:

  • ctz symbols are added since they are now enabled for amdgcn.

This PR is cherry-pick of intel/llvm@cba338e5fb1c
This allows adding OpenCL 2.0 built-ins, e.g. ctz, and OpenCL 3.0
extension built-ins, including generic address space variants.

llvm-diff shows this PR has no change in amdgcn--amdhsa.bc.
@wenju-he
Copy link
Contributor Author

@frasercrmck please help to review. thanks.

@frasercrmck frasercrmck added the libclc libclc OpenCL library label Apr 15, 2025
@frasercrmck
Copy link
Contributor

I don't think we want to unconditionally do this - we probably want a mechanism whereby targets can opt for a specific version. We should definitely add this capability, though.

Targets may even want to compile libclc for multiple different versions? That might introduce extra complexity (we'd need "an extra loop", more compilation time, new naming/versioning schemes for the build artifacts).

"+__opencl_c_3d_image_writes,"
"+__opencl_c_images,"
"+cl_khr_3d_image_writes")
list( APPEND build_flags -cl-std=CL3.0 "-Xclang" ${CL_3_0_EXTENSIONS} )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would need a more target-configurable way of enabling OpenCL extensions. Not all targets do fp16/fp64, not all do 3D image writes, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reverted OpenCL extensions change in this PR in 4facfec
I find that target should define its supported extension via setSupportedOpenCLOpts API.

@wenju-he
Copy link
Contributor Author

I don't think we want to unconditionally do this - we probably want a mechanism whereby targets can opt for a specific version. We should definitely add this capability, though.

You're right. We can't set 3.0 for all targets. I've refine this PR to set the supported OpenCL C version for each target. Default version is 1.2 which is Clang's default OpenCL C version defined at

return LangStandard::lang_opencl12;

@wenju-he wenju-he changed the title [libclc] Set OpenCL version to 3.0 [libclc] Set OpenCL C version for each target Apr 16, 2025
@wenju-he
Copy link
Contributor Author

Targets may even want to compile libclc for multiple different versions? That might introduce extra complexity (we'd need "an extra loop", more compilation time, new naming/versioning schemes for the build artifacts).

An application may compile using different -cl-std version, but IIUC such usage is incompatible with a target which supports a specific OpenCL version. So compiling for the target's supported OpenCL version might be enough.

@wenju-he wenju-he requested a review from frasercrmck April 16, 2025 04:50
Copy link
Contributor

@frasercrmck frasercrmck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think on reflection it's probably okay to compile for the highest supported OpenCL C version. I believe they're supersets of one another, so a 3.0 builtins library would still contain all of the 1.2 builtins? I might be missing some of the nitty gritty here though.

Another question would be whether or not we should be advertising a 2.X or 3.X library if we don't have all the builtins? Is this a degradation? That might depend on downstream toolchains and if/how they react to versioning info in the LLVM IR.

set( opencl_lang_std "CL1.2" )

if ( ${DARCH} STREQUAL spirv )
set( opencl_lang_std "CL3.0" )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this look okay to you, @airlied?

elseif( ARCH STREQUAL clspv OR ARCH STREQUAL clspv64 )
elseif( ${DARCH} STREQUAL clspv )
# Refer to https://github.com/google/clspv for OpenCL version.
set( opencl_lang_std "CL3.0" )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this look okay, @rjodinchr?

set( build_flags "-Wno-unknown-assumption" -DCLC_CLSPV )
set( opt_flags -O3 )
set( MACRO_ARCH CLSPV32 )
if( ARCH STREQUAL clspv64 )
set( MACRO_ARCH CLSPV64 )
endif()
elseif( ${DARCH} STREQUAL nvptx )
# Refer to https://www.khronos.org/opencl/ for OpenCL version in NV implementation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure who could verify this, or who even uses libclc built for nvptx.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set( MACRO_ARCH ${ARCH} )
elseif( ${DARCH} STREQUAL amdgcn OR ${DARCH} STREQUAL amdgcn-amdhsa )
# Refer to https://github.com/ROCm/clr/tree/develop/opencl for OpenCL version.
set( opencl_lang_std "CL2.0" )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC @arsenm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we already picked out device compatible default versions in clang?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we already picked out device compatible default versions in clang?

OpenCL C version is 1.2 for all targets by default in clang if the version isn't specified in command line:

return LangStandard::lang_opencl12;

There is TargetInfo api setSupportedOpenCLOpts for target to define its supported extensions and features.

# 1.2 is Clang's default OpenCL C language standard to compile for.
set( opencl_lang_std "CL1.2" )

if ( ${DARCH} STREQUAL spirv )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if( DARCH STREQUAL spirv ) which better fits the current style.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@wenju-he
Copy link
Contributor Author

Yes I think on reflection it's probably okay to compile for the highest supported OpenCL C version.

Yeah I think libclc should compile for the version that target claims supporting.

I believe they're supersets of one another, so a 3.0 builtins library would still contain all of the 1.2 builtins? I might be missing some of the nitty gritty here though.

3.0 is backward compatible with 1.2,1.1,1.0.
For other versions, it depends on whether target include the versions in CL_DEVICE_OPENCL_C_ALL_VERSIONS query.

@wenju-he
Copy link
Contributor Author

Another question would be whether or not we should be advertising a 2.X or 3.X library if we don't have all the builtins? Is this a degradation? That might depend on downstream toolchains and if/how they react to versioning info in the LLVM IR.

We can incrementally add missing builtins. If we don't set the version, the newer builtins in libclc are not built at all and effectively dead code.

Copy link
Contributor

@arsenm arsenm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd expect the libclc build (or any other runtime support library) to consistently use the same language version independent of the target. If the target doesn't support that version (which IIRC isn't actually a hard error anywhere) and fails to compile on some feature, those should be carved out into separate version dependent build (as in, this isn't a compile target property but a specific build target property)

@wenju-he
Copy link
Contributor Author

wenju-he commented Apr 18, 2025

I'd expect the libclc build (or any other runtime support library) to consistently use the same language version independent of the target. If the target doesn't support that version (which IIRC isn't actually a hard error anywhere) and fails to compile on some feature, those should be carved out into separate version dependent build (as in, this isn't a compile target property but a specific build target property)

LGTM. That means we compile for the last OpenCL version, which is 3.0, and enable all OpenCL extensions/features, right?
libclc is implemented using functions supported by clang, so it is unlikely a target has libclc build error in generic libclc files that are shared for all targets.
When libclc is linked to application module, libclc built-ins implementation of unsupported extensions/features won't be linked in because these built-ins won't exist in the user module. If the application code uses an unsupported extension, frontend would report error already.
There could be problem if application modules links in a supported libclc built-in function which calls another libclc built-in that belongs to unsupported special extension/feature, but I think this scenario is unlikely and the supported built-in should be fixed to not using unsupported feature.
@frasercrmck What do you think?

@arsenm
Copy link
Contributor

arsenm commented Apr 18, 2025

LGTM. That means we compile for the last OpenCL version, which is 3.0, and enable all OpenCL extensions/features, right?

Yes. Otherwise you have to still write the code to work with the lowest common denominator.

@frasercrmck
Copy link
Contributor

LGTM. That means we compile for the last OpenCL version, which is 3.0, and enable all OpenCL extensions/features, right? libclc is implemented using functions supported by clang, so it is unlikely a target has libclc build error in generic libclc files that are shared for all targets. When libclc is linked to application module, libclc built-ins implementation of unsupported extensions/features won't be linked in because these built-ins won't exist in the user module. If the application code uses an unsupported extension, frontend would report error already. There could be problem if application modules links in a supported libclc built-in function which calls another libclc built-in that belongs to unsupported special extension/feature, but I think this scenario is unlikely and the supported built-in should be fixed to not using unsupported feature. @frasercrmck What do you think?

Sounds good to me. I hope that by having the internal CLC library we can largely avoid the last scenario, as CLC should be less dependent on the OpenCL C version. An OpenCL 1.2 module could still call a builtin that makes internal use of CLC ctz, for example.

Anyway, sorry for complicating the PR with my suggestion. I was being unnecessarily conservative.

@wenju-he
Copy link
Contributor Author

An OpenCL 1.2 module could still call a builtin that makes internal use of CLC ctz, for example.

Yes, you're right.

@wenju-he
Copy link
Contributor Author

LGTM. That means we compile for the last OpenCL version, which is 3.0, and enable all OpenCL extensions/features, right?

Yes. Otherwise you have to still write the code to work with the lowest common denominator.

done in commit b3653cd

@wenju-he wenju-he changed the title [libclc] Set OpenCL C version for each target [libclc] Build for OpenCL 3.0 and enable all extensions and features Apr 22, 2025
@wenju-he wenju-he requested review from arsenm and frasercrmck April 22, 2025 05:15
@wenju-he wenju-he changed the title [libclc] Build for OpenCL 3.0 and enable all extensions and features [libclc] Build for OpenCL 3.0 Apr 23, 2025
@frasercrmck frasercrmck merged commit 8292e05 into llvm:main Apr 23, 2025
9 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 23, 2025

LLVM Buildbot has detected a new failure on builder premerge-monolithic-linux running on premerge-linux-1 while building libclc at step 6 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/29653

Here is the relevant piece of the build log for the reference
Step 6 (build-unified-tree) failure: build (failure)
...
45.920 [4012/58/9620] Generating obj.libclc.dir/amdgcn--amdhsa/clc/lib/generic/math/clc_floor.cl.bc
45.925 [4011/58/9621] Generating obj.libclc.dir/amdgcn--amdhsa/clc/lib/generic/math/clc_native_cos.cl.bc
45.926 [4010/58/9622] Generating obj.libclc.dir/amdgcn--amdhsa/clc/lib/generic/math/clc_nan.cl.bc
45.927 [4009/58/9623] Generating obj.libclc.dir/tahiti-amdgcn--/clc/lib/generic/math/clc_trunc.cl.bc
45.931 [4008/58/9624] Linking CXX static library lib/libHLFIRDialect.a
45.998 [4007/58/9625] Linking CXX shared library lib/libclang-cpp.so.21.0git
46.004 [4006/58/9626] Linking CXX executable bin/lld
46.089 [4005/58/9627] Generating obj.libclc.dir/tahiti-amdgcn--/clc/lib/generic/math/clc_tables.cl.bc
46.143 [4004/58/9628] Generating obj.libclc.dir/amdgcn--amdhsa/clc/lib/generic/math/clc_ep_log.cl.bc
46.165 [4003/58/9629] Generating obj.libclc.dir/cypress-r600--/generic/lib/math/atanpi.cl.bc
FAILED: tools/libclc/obj.libclc.dir/cypress-r600--/generic/lib/math/atanpi.cl.bc /build/buildbot/premerge-monolithic-linux/build/tools/libclc/obj.libclc.dir/cypress-r600--/generic/lib/math/atanpi.cl.bc 
cd /build/buildbot/premerge-monolithic-linux/build/tools/libclc && /build/buildbot/premerge-monolithic-linux/build/bin/clang-21 -target r600-- -c -fno-builtin -nostdlib -cl-std=CL3.0 -DCLC_R600 -I/build/buildbot/premerge-monolithic-linux/llvm-project/libclc/clc/include -mcpu=cypress -I/build/buildbot/premerge-monolithic-linux/llvm-project/libclc/generic/include -Wno-bitwise-conditional-parentheses -I/build/buildbot/premerge-monolithic-linux/llvm-project/libclc/./generic/lib/math -MD -MF /build/buildbot/premerge-monolithic-linux/build/tools/libclc/obj.libclc.dir/cypress-r600--/generic/lib/math/atanpi.cl.bc.d -MT /build/buildbot/premerge-monolithic-linux/build/tools/libclc/obj.libclc.dir/cypress-r600--/generic/lib/math/atanpi.cl.bc -cl-no-stdinc -emit-llvm -o /build/buildbot/premerge-monolithic-linux/build/tools/libclc/obj.libclc.dir/cypress-r600--/generic/lib/math/atanpi.cl.bc -x cl /build/buildbot/premerge-monolithic-linux/llvm-project/libclc/./generic/lib/math/atanpi.cl && /etc/cmake/bin/cmake -E cmake_transform_depfile Ninja gccdepfile /build/buildbot/premerge-monolithic-linux/llvm-project/llvm /build/buildbot/premerge-monolithic-linux/llvm-project/libclc /build/buildbot/premerge-monolithic-linux/build /build/buildbot/premerge-monolithic-linux/build/tools/libclc /build/buildbot/premerge-monolithic-linux/build/tools/libclc/obj.libclc.dir/cypress-r600--/generic/lib/math/atanpi.cl.bc.d /build/buildbot/premerge-monolithic-linux/build/CMakeFiles/d/6de5517f8db0e3fcbfd6a2657a37f1fa80a870a1d4f7a3d14a5fe078860d1a3a.d
In file included from /build/buildbot/premerge-monolithic-linux/llvm-project/libclc/./generic/lib/math/atanpi.cl:9:
In file included from /build/buildbot/premerge-monolithic-linux/llvm-project/libclc/generic/include/clc/clc.h:266:
/build/buildbot/premerge-monolithic-linux/llvm-project/libclc/generic/include/clc/image/image.h:9:46: error: use of type '__read_only image2d_t' requires __opencl_c_images support
    9 | _CLC_OVERLOAD _CLC_DECL int get_image_width (image2d_t image);
      |                                              ^
/build/buildbot/premerge-monolithic-linux/llvm-project/libclc/generic/include/clc/image/image.h:10:46: error: use of type '__read_only image3d_t' requires __opencl_c_images support
   10 | _CLC_OVERLOAD _CLC_DECL int get_image_width (image3d_t image);
      |                                              ^
/build/buildbot/premerge-monolithic-linux/llvm-project/libclc/generic/include/clc/image/image.h:12:47: error: use of type '__read_only image2d_t' requires __opencl_c_images support
   12 | _CLC_OVERLOAD _CLC_DECL int get_image_height (image2d_t image);
      |                                               ^
/build/buildbot/premerge-monolithic-linux/llvm-project/libclc/generic/include/clc/image/image.h:13:47: error: use of type '__read_only image3d_t' requires __opencl_c_images support
   13 | _CLC_OVERLOAD _CLC_DECL int get_image_height (image3d_t image);
      |                                               ^
/build/buildbot/premerge-monolithic-linux/llvm-project/libclc/generic/include/clc/image/image.h:15:46: error: use of type '__read_only image3d_t' requires __opencl_c_images support
   15 | _CLC_OVERLOAD _CLC_DECL int get_image_depth (image3d_t image);
      |                                              ^
/build/buildbot/premerge-monolithic-linux/llvm-project/libclc/generic/include/clc/image/image.h:17:58: error: use of type '__read_only image2d_t' requires __opencl_c_images support
   17 | _CLC_OVERLOAD _CLC_DECL int get_image_channel_data_type (image2d_t image);
      |                                                          ^
/build/buildbot/premerge-monolithic-linux/llvm-project/libclc/generic/include/clc/image/image.h:18:58: error: use of type '__read_only image3d_t' requires __opencl_c_images support
   18 | _CLC_OVERLOAD _CLC_DECL int get_image_channel_data_type (image3d_t image);
      |                                                          ^
/build/buildbot/premerge-monolithic-linux/llvm-project/libclc/generic/include/clc/image/image.h:20:54: error: use of type '__read_only image2d_t' requires __opencl_c_images support
   20 | _CLC_OVERLOAD _CLC_DECL int get_image_channel_order (image2d_t image);
      |                                                      ^
/build/buildbot/premerge-monolithic-linux/llvm-project/libclc/generic/include/clc/image/image.h:21:54: error: use of type '__read_only image3d_t' requires __opencl_c_images support
   21 | _CLC_OVERLOAD _CLC_DECL int get_image_channel_order (image3d_t image);
      |                                                      ^
/build/buildbot/premerge-monolithic-linux/llvm-project/libclc/generic/include/clc/image/image.h:23:45: error: use of type '__read_only image2d_t' requires __opencl_c_images support
   23 | _CLC_OVERLOAD _CLC_DECL int2 get_image_dim (image2d_t image);
      |                                             ^
/build/buildbot/premerge-monolithic-linux/llvm-project/libclc/generic/include/clc/image/image.h:24:45: error: use of type '__read_only image3d_t' requires __opencl_c_images support
   24 | _CLC_OVERLOAD _CLC_DECL int4 get_image_dim (image3d_t image);
      |                                             ^
/build/buildbot/premerge-monolithic-linux/llvm-project/libclc/generic/include/clc/image/image.h:27:14: error: use of type '__read_only image2d_t' requires __opencl_c_images support
   27 | write_imagef(image2d_t image, int2 coord, float4 color);

@frasercrmck
Copy link
Contributor

See #136871 for a fix for the CI issues.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 23, 2025

LLVM Buildbot has detected a new failure on builder premerge-monolithic-windows running on premerge-windows-1 while building libclc at step 5 "clean-build-dir".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/35/builds/9454

Here is the relevant piece of the build log for the reference
Step 5 (clean-build-dir) failure: Delete failed. (failure)
Step 7 (build-unified-tree) failure: build (failure)
...
[9342/13306] Generating obj.libclc.dir/amdgcn--amdhsa/clc/lib/generic/relational/clc_isless.cl.bc
[9343/13306] Generating obj.libclc.dir/tahiti-amdgcn-mesa-mesa3d/clc/lib/generic/shared/clc_max.cl.bc
[9344/13306] Generating obj.libclc.dir/amdgcn--amdhsa/clc/lib/generic/common/clc_smoothstep.cl.bc
[9345/13306] Generating obj.libclc.dir/tahiti-amdgcn--/clc/lib/amdgcn/math/clc_ldexp_override.cl.bc
[9346/13306] Generating obj.libclc.dir/nvptx--/clc/lib/generic/math/clc_acos.cl.bc
[9347/13306] Generating obj.libclc.dir/clspv64--/clc/lib/generic/math/clc_lgamma.cl.bc
[9348/13306] Generating obj.libclc.dir/nvptx--/clc/lib/generic/relational/clc_signbit.cl.bc
[9349/13306] Generating obj.libclc.dir/clspv--/clc/lib/generic/math/clc_cosh.cl.bc
[9350/13306] Generating obj.libclc.dir/tahiti-amdgcn--/clc/lib/generic/math/clc_atan2.cl.bc
[9351/13306] Generating obj.libclc.dir/cedar-r600--/generic/lib/relational/bitselect.cl.bc
FAILED: tools/libclc/obj.libclc.dir/cedar-r600--/generic/lib/relational/bitselect.cl.bc 
cmd.exe /C "cd /D C:\ws\buildbot\premerge-monolithic-windows\build\tools\libclc && C:\ws\buildbot\premerge-monolithic-windows\build\bin\clang.exe -target r600-- -c -fno-builtin -nostdlib -cl-std=CL3.0 -DCLC_R600 -IC:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/clc/include -mcpu=cedar -IC:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/generic/include -Wno-bitwise-conditional-parentheses -IC:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/./generic/lib/relational -MD -MF C:/ws/buildbot/premerge-monolithic-windows/build/tools/libclc/obj.libclc.dir/cedar-r600--/generic/lib/relational/bitselect.cl.bc.d -MT C:/ws/buildbot/premerge-monolithic-windows/build/tools/libclc/obj.libclc.dir/cedar-r600--/generic/lib/relational/bitselect.cl.bc -cl-no-stdinc -emit-llvm -o C:/ws/buildbot/premerge-monolithic-windows/build/tools/libclc/obj.libclc.dir/cedar-r600--/generic/lib/relational/bitselect.cl.bc -x cl C:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/./generic/lib/relational/bitselect.cl && C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe -E cmake_transform_depfile Ninja gccdepfile C:/ws/buildbot/premerge-monolithic-windows/llvm-project/llvm C:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc C:/ws/buildbot/premerge-monolithic-windows/build C:/ws/buildbot/premerge-monolithic-windows/build/tools/libclc C:/ws/buildbot/premerge-monolithic-windows/build/tools/libclc/obj.libclc.dir/cedar-r600--/generic/lib/relational/bitselect.cl.bc.d C:/ws/buildbot/premerge-monolithic-windows/build/CMakeFiles/d/c93fc1d69f9ba6f8cac058e2033839c0a31ca822b5f1c4e527f60cd960a28aba.d"
In file included from C:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/./generic/lib/relational/bitselect.cl:9:
In file included from C:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/generic/include\clc/clc.h:266:
C:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/generic/include\clc/image/image.h:9:46: error: use of type '__read_only image2d_t' requires __opencl_c_images support
    9 | _CLC_OVERLOAD _CLC_DECL int get_image_width (image2d_t image);
      |                                              ^
C:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/generic/include\clc/image/image.h:10:46: error: use of type '__read_only image3d_t' requires __opencl_c_images support
   10 | _CLC_OVERLOAD _CLC_DECL int get_image_width (image3d_t image);
      |                                              ^
C:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/generic/include\clc/image/image.h:12:47: error: use of type '__read_only image2d_t' requires __opencl_c_images support
   12 | _CLC_OVERLOAD _CLC_DECL int get_image_height (image2d_t image);
      |                                               ^
C:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/generic/include\clc/image/image.h:13:47: error: use of type '__read_only image3d_t' requires __opencl_c_images support
   13 | _CLC_OVERLOAD _CLC_DECL int get_image_height (image3d_t image);
      |                                               ^
C:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/generic/include\clc/image/image.h:15:46: error: use of type '__read_only image3d_t' requires __opencl_c_images support
   15 | _CLC_OVERLOAD _CLC_DECL int get_image_depth (image3d_t image);
      |                                              ^
C:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/generic/include\clc/image/image.h:17:58: error: use of type '__read_only image2d_t' requires __opencl_c_images support
   17 | _CLC_OVERLOAD _CLC_DECL int get_image_channel_data_type (image2d_t image);
      |                                                          ^
C:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/generic/include\clc/image/image.h:18:58: error: use of type '__read_only image3d_t' requires __opencl_c_images support
   18 | _CLC_OVERLOAD _CLC_DECL int get_image_channel_data_type (image3d_t image);
      |                                                          ^
C:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/generic/include\clc/image/image.h:20:54: error: use of type '__read_only image2d_t' requires __opencl_c_images support
   20 | _CLC_OVERLOAD _CLC_DECL int get_image_channel_order (image2d_t image);
      |                                                      ^
C:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/generic/include\clc/image/image.h:21:54: error: use of type '__read_only image3d_t' requires __opencl_c_images support
   21 | _CLC_OVERLOAD _CLC_DECL int get_image_channel_order (image3d_t image);
      |                                                      ^
C:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/generic/include\clc/image/image.h:23:45: error: use of type '__read_only image2d_t' requires __opencl_c_images support
   23 | _CLC_OVERLOAD _CLC_DECL int2 get_image_dim (image2d_t image);
      |                                             ^
C:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/generic/include\clc/image/image.h:24:45: error: use of type '__read_only image3d_t' requires __opencl_c_images support
   24 | _CLC_OVERLOAD _CLC_DECL int4 get_image_dim (image3d_t image);
      |                                             ^
C:/ws/buildbot/premerge-monolithic-windows/llvm-project/libclc/generic/include\clc/image/image.h:27:14: error: use of type '__read_only image2d_t' requires __opencl_c_images support
   27 | write_imagef(image2d_t image, int2 coord, float4 color);

IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
This PR is modified cherry-pick of
intel/llvm@cba338e5fb1c
This PR sets OpenCL language version to be the same, which is 3.0,
for every target and device, in order to unify the build process.
Target should define supported extensions and features via
setSupportedOpenCLOpts API.

llvm-diff shows one change to amdgcn--amdhsa.bc:
* ctz symbols are added since they are now enabled for amdgcn.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
This PR is modified cherry-pick of
intel/llvm@cba338e5fb1c
This PR sets OpenCL language version to be the same, which is 3.0,
for every target and device, in order to unify the build process.
Target should define supported extensions and features via
setSupportedOpenCLOpts API.

llvm-diff shows one change to amdgcn--amdhsa.bc:
* ctz symbols are added since they are now enabled for amdgcn.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
This PR is modified cherry-pick of
intel/llvm@cba338e5fb1c
This PR sets OpenCL language version to be the same, which is 3.0,
for every target and device, in order to unify the build process.
Target should define supported extensions and features via
setSupportedOpenCLOpts API.

llvm-diff shows one change to amdgcn--amdhsa.bc:
* ctz symbols are added since they are now enabled for amdgcn.
@wenju-he wenju-he deleted the libclc-opencl-3.0 branch June 5, 2025 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libclc libclc OpenCL library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants