Skip to content

Commit

Permalink
Using BOs of type BO_SHMEM instead of BO_CMD for kernarg memory region (
Browse files Browse the repository at this point in the history
#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
  • Loading branch information
eddierichter-amd authored and makslevental committed Sep 10, 2024
1 parent ab60a07 commit 8a6677d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rocrtst/suites/aie/aie_hsa_dispatch_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<void **>(&input));
assert(r == HSA_STATUS_SUCCESS);
std::uint32_t input_handle = {};
Expand All @@ -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<void **>(&output));
assert(r == HSA_STATUS_SUCCESS);
std::uint32_t output_handle = {};
Expand Down
2 changes: 1 addition & 1 deletion runtime/hsa-runtime/core/driver/xdna/amd_xdna_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8a6677d

Please sign in to comment.