From 8a6677d0033271f2fd3dec65b9b6dffda5aebb58 Mon Sep 17 00:00:00 2001 From: eddierichter-amd Date: Thu, 5 Sep 2024 10:20:39 -0600 Subject: [PATCH] Using BOs of type BO_SHMEM instead of BO_CMD for kernarg memory region (#19) * Using BOs of type BO_SHMEM instead of BO_CMD for kernarg memory region * Changing test to use kernarg memory region for operand allocation --- rocrtst/suites/aie/aie_hsa_dispatch_test.cc | 4 ++-- runtime/hsa-runtime/core/driver/xdna/amd_xdna_driver.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rocrtst/suites/aie/aie_hsa_dispatch_test.cc b/rocrtst/suites/aie/aie_hsa_dispatch_test.cc index fca55e4a4..e2b91bf44 100644 --- a/rocrtst/suites/aie/aie_hsa_dispatch_test.cc +++ b/rocrtst/suites/aie/aie_hsa_dispatch_test.cc @@ -223,7 +223,7 @@ int main(int argc, char **argv) { num_data_elements * sizeof(std::uint32_t); std::uint32_t *input = {}; - r = hsa_amd_memory_pool_allocate(global_dev_mem_pool, data_buffer_size, 0, + r = hsa_amd_memory_pool_allocate(global_kernarg_mem_pool, data_buffer_size, 0, reinterpret_cast(&input)); assert(r == HSA_STATUS_SUCCESS); std::uint32_t input_handle = {}; @@ -232,7 +232,7 @@ int main(int argc, char **argv) { assert(input_handle != 0); std::uint32_t *output = {}; - r = hsa_amd_memory_pool_allocate(global_dev_mem_pool, data_buffer_size, 0, + r = hsa_amd_memory_pool_allocate(global_kernarg_mem_pool, data_buffer_size, 0, reinterpret_cast(&output)); assert(r == HSA_STATUS_SUCCESS); std::uint32_t output_handle = {}; diff --git a/runtime/hsa-runtime/core/driver/xdna/amd_xdna_driver.cpp b/runtime/hsa-runtime/core/driver/xdna/amd_xdna_driver.cpp index 4982bc910..12f140e5c 100644 --- a/runtime/hsa-runtime/core/driver/xdna/amd_xdna_driver.cpp +++ b/runtime/hsa-runtime/core/driver/xdna/amd_xdna_driver.cpp @@ -147,7 +147,7 @@ XdnaDriver::AllocateMemory(const core::MemoryRegion &mem_region, } if (region.kernarg()) { - create_bo_args.type = AMDXDNA_BO_CMD; + create_bo_args.type = AMDXDNA_BO_SHMEM; } else { create_bo_args.type = AMDXDNA_BO_DEV; }