SWDEV-404889 - Inital change for debugger support

- Program unique AQL index for debugger. The logic manages AQL array of packets per HW queue.
- Provide debug state to PAL

Change-Id: I38fa1f5435fa711fd1d44dc391f2e61eb2a25efa
This commit is contained in:
German
2023-08-17 16:17:23 -04:00
committed by German Andryeyev
vanhempi 6f5277c701
commit d97cc0abbd
7 muutettua tiedostoa jossa 126 lisäystä ja 34 poistoa
+12 -3
Näytä tiedosto
@@ -242,6 +242,14 @@ inline static std::vector<std::string> splitSpaceSeparatedString(char* str) {
return vec;
}
inline static std::string GetUriFromMemoryAddress(const void* memory, size_t size) {
int pid = amd::Os::getProcessId();
std::ostringstream uri_stream;
uri_stream << "memory://" << pid << "#offset=0x" << std::hex <<
reinterpret_cast<uintptr_t>(memory) << std::dec << "&size=" << size;
return uri_stream.str();
}
bool HSAILProgram::createKernels(void* binary, size_t binSize, bool useUniformWorkGroupSize,
bool internalKernel) {
#if defined(WITH_COMPILER_LIB)
@@ -256,7 +264,8 @@ bool HSAILProgram::createKernels(void* binary, size_t binSize, bool useUniformWo
code_object.handle = reinterpret_cast<uint64_t>(binary);
hsa_agent_t agent = {amd::Device::toHandle(&(device()))};
hsa_status_t status = executable_->LoadCodeObject(agent, code_object, nullptr);
auto uri = GetUriFromMemoryAddress(binary, binSize);
hsa_status_t status = executable_->LoadCodeObject(agent, code_object, nullptr, uri);
if (status != HSA_STATUS_SUCCESS) {
buildLog_ += "Error: AMD HSA Code Object loading failed.\n";
return false;
@@ -762,8 +771,8 @@ bool LightningProgram::createKernels(void* binary, size_t binSize, bool useUnifo
code_object.handle = reinterpret_cast<uint64_t>(binary);
hsa_agent_t agent = {amd::Device::toHandle(&(device()))};
hsa_status_t status = executable_->LoadCodeObject(agent, code_object, nullptr);
auto uri = GetUriFromMemoryAddress(binary, binSize);
hsa_status_t status = executable_->LoadCodeObject(agent, code_object, nullptr, uri);
if (status != HSA_STATUS_SUCCESS) {
LogError("Error: AMD HSA Code Object loading failed.");
return false;