SWDEV-543366 - Bump PAL_CLIENT_INTERFACE_MAJOR_VERSION 916 --> 932 (#725)

Co-authored-by: Lin, Qun <Quentin.Lin@amd.com>
Co-authored-by: Lin,Qun <qlin@amd.com>
This commit is contained in:
GunaShekar, Ajay
2025-08-08 08:45:42 -07:00
committed by GitHub
parent 4646a756d9
commit ed903e8889
5 changed files with 36 additions and 7 deletions
+22 -3
View File
@@ -483,8 +483,10 @@ hsa_kernel_dispatch_packet_t* HSAILKernel::loadArguments(
hsaDisp->completion_signal.handle = 0;
memcpy(aqlArgBuf + argsBufferSize(), hsaDisp, sizeof(hsa_kernel_dispatch_packet_t));
if (AMD_HSA_BITS_GET(akc_.kernel_code_properties,
AMD_KERNEL_CODE_PROPERTIES_ENABLE_SGPR_QUEUE_PTR)) {
static_assert(offsetof(amd_kernel_code_t, kernel_code_properties) ==
offsetof(llvm::amdhsa::kernel_descriptor_t, kernel_code_properties));
if (AMD_HSA_BITS_GET(akd_.kernel_code_properties,
llvm::amdhsa::KERNEL_CODE_PROPERTY_ENABLE_SGPR_QUEUE_PTR)) {
gpu.addVmMemory(gpu.hsaQueueMem());
}
@@ -511,7 +513,7 @@ bool LightningKernel::postLoad() {
auto sym = prog().getSymbol(symbolName().c_str(), &agent);
if (!setKernelCode(sym, &akc_)) {
if (!setKernelDescriptor(sym, &akd_)) {
return false;
}
if (!sym->GetInfo(HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_DYNAMIC_CALLSTACK,
@@ -571,6 +573,23 @@ bool LightningKernel::postLoad() {
return true;
}
bool LightningKernel::setKernelDescriptor(amd::hsa::loader::Symbol* sym,
llvm::amdhsa::kernel_descriptor_t* akd) {
if (!sym) {
return false;
}
if (!sym->GetInfo(HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_OBJECT, reinterpret_cast<void*>(&code_))) {
return false;
}
// Copy code object of this kernel from the program CPU segment
memcpy(akd, reinterpret_cast<void*>(prog().findHostKernelAddress(code_)),
sizeof(llvm::amdhsa::kernel_descriptor_t));
return true;
}
#endif // defined(USE_COMGR_LIBRARY)
} // namespace amd::pal