-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[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
[libclc] Build for OpenCL 3.0 #135733
Changes from 5 commits
64d7bfd
b2419f2
4facfec
31604df
35cfd64
b3653cd
b24e439
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -387,21 +387,39 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) | |||
|
|
||||
| message( STATUS " device: ${d} ( ${${d}_aliases} )" ) | ||||
|
|
||||
| if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) | ||||
| # 1.2 is Clang's default OpenCL C language standard to compile for. | ||||
| set( opencl_lang_std "CL1.2" ) | ||||
|
|
||||
| if ( DARCH STREQUAL spirv ) | ||||
| set( opencl_lang_std "CL3.0" ) | ||||
| set( build_flags -O0 -finline-hint-functions -DCLC_SPIRV ) | ||||
| set( opt_flags ) | ||||
| set( spvflags --spirv-max-version=1.1 ) | ||||
| set( MACRO_ARCH SPIRV32 ) | ||||
| if( ARCH STREQUAL spirv64 ) | ||||
| set( MACRO_ARCH SPIRV64 ) | ||||
| endif() | ||||
| 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" ) | ||||
|
||||
| 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://developer.nvidia.com/opencl for OpenCL version. | ||||
| set( opencl_lang_std "CL3.0" ) | ||||
| set( build_flags ) | ||||
| set( opt_flags -O3 ) | ||||
| 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" ) | ||||
|
||||
| return LangStandard::lang_opencl12; |
There is TargetInfo api setSupportedOpenCLOpts for target to define its supported extensions and features.
There was a problem hiding this comment.
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?