From d962fc39bb9a2ccbb54ab6a90197e95aab90c277 Mon Sep 17 00:00:00 2001 From: Konstantin Zhuravlyov Date: Fri, 15 Jul 2022 16:03:27 -0400 Subject: [PATCH] Add support for the following kernel symbol query: - HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_DYNAMIC_CALLSTACK Change-Id: Idff5c1a2ce2a3e2d65bcc9cf1f66a68d37cd41ef --- runtime/hsa-runtime/loader/AMDHSAKernelDescriptor.h | 3 ++- runtime/hsa-runtime/loader/executable.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/hsa-runtime/loader/AMDHSAKernelDescriptor.h b/runtime/hsa-runtime/loader/AMDHSAKernelDescriptor.h index d49f7f7640..e9d77bd921 100644 --- a/runtime/hsa-runtime/loader/AMDHSAKernelDescriptor.h +++ b/runtime/hsa-runtime/loader/AMDHSAKernelDescriptor.h @@ -190,7 +190,8 @@ enum : int32_t { KERNEL_CODE_PROPERTY(ENABLE_SGPR_PRIVATE_SEGMENT_SIZE, 6, 1), KERNEL_CODE_PROPERTY(RESERVED0, 7, 3), KERNEL_CODE_PROPERTY(ENABLE_WAVEFRONT_SIZE32, 10, 1), // GFX10+ - KERNEL_CODE_PROPERTY(RESERVED1, 11, 5), + KERNEL_CODE_PROPERTY(USES_DYNAMIC_STACK, 11, 1), + KERNEL_CODE_PROPERTY(RESERVED1, 12, 4), }; #undef KERNEL_CODE_PROPERTY diff --git a/runtime/hsa-runtime/loader/executable.cpp b/runtime/hsa-runtime/loader/executable.cpp index c1bcf2bcba..dbad4b93b1 100644 --- a/runtime/hsa-runtime/loader/executable.cpp +++ b/runtime/hsa-runtime/loader/executable.cpp @@ -1431,7 +1431,7 @@ hsa_status_t ExecutableImpl::LoadDefinitionSymbol(hsa_agent_t agent, uint32_t kernarg_segment_alignment = 16; // FIXME: Use the minumum HSA required alignment. uint32_t group_segment_size = kd.group_segment_fixed_size; uint32_t private_segment_size = kd.private_segment_fixed_size; - bool is_dynamic_callstack = false; + bool is_dynamic_callstack = AMDHSA_BITS_GET(kd.kernel_code_properties, rocr::llvm::amdhsa::KERNEL_CODE_PROPERTY_USES_DYNAMIC_STACK); uint64_t size = sym->Size();