From ad3177883195602582078652c121c7cc70c3d6ec Mon Sep 17 00:00:00 2001 From: Jun Liu Date: Tue, 8 Aug 2023 15:04:02 -0700 Subject: [PATCH] Fix hipRTC build options for hip kernels --- src/comgr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/comgr.cpp b/src/comgr.cpp index a4a98c8ed4..ff43d85ac4 100644 --- a/src/comgr.cpp +++ b/src/comgr.cpp @@ -1043,6 +1043,9 @@ void BuildAsm(const std::string& name, #define WORKAROUND_ISSUE_HIPRTC_HIPRTC_HEADER_H 1 // See SWDEV-307838, issue #1648. #define WORKAROUND_ISSUE_1674 (HIP_PACKAGE_VERSION_FLAT >= 5003022305ULL) +/// No assumption that HIP kernels are launched with uniform block size for backward compatibility +/// SWDEV-413293 and https://reviews.llvm.org/D155213 +#define WORKAROUND_SWDEV -413293(HIP_PACKAGE_VERSION_FLAT >= 5007000000ULL) namespace hiprtc { @@ -1314,6 +1317,9 @@ void BuildHip(const std::string& name, opts.push_back("-Wno-cuda-compat"); opts.push_back("-fno-gpu-rdc"); opts.push_back("-O3"); +#if WORKAROUND_SWDEV - 413293 + opts.push_back("-fno-offload-uniform-block"); +#endif if(std::none_of(opts.begin(), opts.end(), [](const std::string& s) { return StartsWith(s, "--std=") || StartsWith(s, "-std="); }))