From 3fdfbfed1ed0062b9f3848a100093b340183c6a3 Mon Sep 17 00:00:00 2001 From: Pietro Ghiglio Date: Wed, 15 May 2024 15:01:41 +0200 Subject: [PATCH] [SYCL][NATIVECPU] Support reqd_work_group_size on Native CPU (#13175) Adds support for the `reqd_work_group_size` attribute on Native CPU. The change in the driver is required in order to have the metadata node available in the runtime. UR PR: https://github.com/oneapi-src/unified-runtime/pull/1477 --- clang/lib/Driver/ToolChains/Clang.cpp | 2 +- clang/test/Driver/sycl-native-cpu-fsycl.cpp | 1 + sycl/plugins/unified_runtime/CMakeLists.txt | 8 +++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 841c9b70c78c3..ade6191fd2190 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -10595,7 +10595,7 @@ getTripleBasedSYCLPostLinkOpts(const ToolChain &TC, const JobAction &JA, if (!(Triple.isAMDGCN())) addArgs(PostLinkArgs, TCArgs, {"-emit-param-info"}); // Enable PI program metadata - if (Triple.isNVPTX() || Triple.isAMDGCN()) + if (Triple.isNVPTX() || Triple.isAMDGCN() || isSYCLNativeCPU(TC)) addArgs(PostLinkArgs, TCArgs, {"-emit-program-metadata"}); if (OutputType != types::TY_LLVM_BC) { assert(OutputType == types::TY_Tempfiletable); diff --git a/clang/test/Driver/sycl-native-cpu-fsycl.cpp b/clang/test/Driver/sycl-native-cpu-fsycl.cpp index c9fee691e35cd..9750f6cb09507 100644 --- a/clang/test/Driver/sycl-native-cpu-fsycl.cpp +++ b/clang/test/Driver/sycl-native-cpu-fsycl.cpp @@ -44,6 +44,7 @@ //CHECK_INVO:{{.*}}clang{{.*}}-fsycl-is-device{{.*}}"-fsycl-is-native-cpu" "-D" "__SYCL_NATIVE_CPU__" //CHECK_INVO:{{.*}}clang{{.*}}"-fsycl-is-host"{{.*}} //CHECK_INVO:{{.*}}clang{{.*}}"-x" "ir" +//CHECK_INVO:{{.*}}sycl-post-link{{.*}}"-emit-program-metadata" //CHECK_INVO-NOT:{{.*}}sycl-post-link{{.*}}-emit-only-kernels-as-entry-points // checks that the device and host triple is correct in the generated actions when it is set explicitly diff --git a/sycl/plugins/unified_runtime/CMakeLists.txt b/sycl/plugins/unified_runtime/CMakeLists.txt index bba0086973b43..43e061dbb46ad 100644 --- a/sycl/plugins/unified_runtime/CMakeLists.txt +++ b/sycl/plugins/unified_runtime/CMakeLists.txt @@ -125,7 +125,13 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT) fetch_adapter_source(native_cpu ${UNIFIED_RUNTIME_REPO} - ${UNIFIED_RUNTIME_TAG} + # commit 50452b75f0d1d7434f5beb4febd642af59a994ff + # Merge: 78b8e3e3 fa084d0a + # Author: Kenneth Benzie (Benie) + # Date: Wed May 15 10:37:42 2024 +0100 + # Merge pull request #1477 from PietroGhg/pietro/reqd_work_group_size + # [NATIVECPU] Support reqd_work_group_size on Native CPU + 50452b75f0d1d7434f5beb4febd642af59a994ff ) if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO)