diff --git a/rocclr/runtime/platform/kernel.cpp b/rocclr/runtime/platform/kernel.cpp index d710170fe8..a272a176e0 100644 --- a/rocclr/runtime/platform/kernel.cpp +++ b/rocclr/runtime/platform/kernel.cpp @@ -298,5 +298,15 @@ KernelSignature::KernelSignature(const std::vector& p // 16 bytes is the current HW alignment for the arguments paramsSize_ = alignUp(paramsSize_, 16); } + + if (hiddenParams.size() > 0) { + uint32_t lastArg = hiddenParams.size() - 1; + // Check if it's LC path and the hidden arguments are placed at the end + if (hiddenParams[lastArg].offset_ >= paramsSize_) { + paramsSize_ = hiddenParams[lastArg].offset_ + hiddenParams[lastArg].size_; + // 16 bytes is the current HW alignment for the arguments + paramsSize_ = alignUp(paramsSize_, 16); + } + } } } // namespace amd