diff --git a/rocrtst/suites/functional/ipc.cc b/rocrtst/suites/functional/ipc.cc index 3744181536..25dbbc4050 100644 --- a/rocrtst/suites/functional/ipc.cc +++ b/rocrtst/suites/functional/ipc.cc @@ -515,7 +515,7 @@ void IPCTest::PrintVerboseMesg(void) { FORK_ASSERT_EQ(HSA_STATUS_SUCCESS, err, "hsa_agent_get_info() failed\n"); // Collect BDF information of GPU's - uint16_t loc1, loc2; + uint32_t loc1, loc2; err = hsa_agent_get_info(*cpu_device(), (hsa_agent_info_t)HSA_AMD_AGENT_INFO_BDFID, &loc1); FORK_ASSERT_EQ(HSA_STATUS_SUCCESS, err); err = hsa_agent_get_info(*gpu_device1(), (hsa_agent_info_t)HSA_AMD_AGENT_INFO_BDFID, &loc2); diff --git a/rocrtst/suites/functional/memory_access.cc b/rocrtst/suites/functional/memory_access.cc index 9ebb36b26f..dfd6bfd7ac 100755 --- a/rocrtst/suites/functional/memory_access.cc +++ b/rocrtst/suites/functional/memory_access.cc @@ -215,17 +215,17 @@ void MemoryAccessTest::GPUAccessToCPUMemoryTest(hsa_agent_t cpuAgent, int *gpuResult = NULL; err = hsa_amd_memory_pool_allocate(global_pool, - kMemoryAllocSize, 0, + kMemoryAllocSize*sizeof(int), 0, reinterpret_cast(&cpuResult)); ASSERT_EQ(err, HSA_STATUS_SUCCESS); err = hsa_amd_memory_pool_allocate(global_pool, - kMemoryAllocSize, 0, + kMemoryAllocSize*sizeof(int), 0, reinterpret_cast(&sys_data)); ASSERT_EQ(err, HSA_STATUS_SUCCESS); err = hsa_amd_memory_pool_allocate(global_pool, - kMemoryAllocSize, 0, + kMemoryAllocSize*sizeof(int), 0, reinterpret_cast(&dup_sys_data)); ASSERT_EQ(err, HSA_STATUS_SUCCESS); @@ -249,8 +249,8 @@ void MemoryAccessTest::GPUAccessToCPUMemoryTest(hsa_agent_t cpuAgent, // Get local memory of GPU to allocate device side buffers - err = hsa_amd_memory_pool_allocate(gpu_pool, kMemoryAllocSize, 0, - reinterpret_cast(&gpuResult)); + err = hsa_amd_memory_pool_allocate(gpu_pool, + kMemoryAllocSize*sizeof(int), 0, reinterpret_cast(&gpuResult)); ASSERT_EQ(err, HSA_STATUS_SUCCESS); @@ -352,11 +352,11 @@ void MemoryAccessTest::GPUAccessToCPUMemoryTest(hsa_agent_t cpuAgent, std::cout<< "gpu has written to system memory successfully"<< std::endl; } - if (sys_data) { hsa_memory_free(sys_data); } - if (dup_sys_data) { hsa_memory_free(dup_sys_data); } - if (cpuResult) {hsa_memory_free(cpuResult); } - if (gpuResult) {hsa_memory_free(gpuResult); } - if (kernArgs) { hsa_memory_free(kernArgs); } + if (sys_data) { hsa_amd_memory_pool_free(sys_data); } + if (dup_sys_data) { hsa_amd_memory_pool_free(dup_sys_data); } + if (cpuResult) {hsa_amd_memory_pool_free(cpuResult); } + if (gpuResult) {hsa_amd_memory_pool_free(gpuResult); } + if (kernArgs) { hsa_amd_memory_pool_free(kernArgs); } if (signal.handle) { hsa_signal_destroy(signal); } if (queue) { hsa_queue_destroy(queue); } } else { diff --git a/rocrtst/suites/functional/memory_allocation.cc b/rocrtst/suites/functional/memory_allocation.cc index a5d835805b..7eaf1e4c7d 100644 --- a/rocrtst/suites/functional/memory_allocation.cc +++ b/rocrtst/suites/functional/memory_allocation.cc @@ -219,7 +219,7 @@ void MemoryAllocationTest::GroupMemoryDynamicAllocation(hsa_agent_t cpuAgent, args *kernArgs = NULL; err = hsa_amd_memory_pool_allocate(global_pool, - kMemoryAllocSize, 0, + kMemoryAllocSize*sizeof(uint32_t), 0, reinterpret_cast(&Indata)); ASSERT_EQ(err, HSA_STATUS_SUCCESS); @@ -240,7 +240,7 @@ void MemoryAllocationTest::GroupMemoryDynamicAllocation(hsa_agent_t cpuAgent, // Get local memory of GPU to allocate device side buffers uint32_t *OutData = NULL; - err = hsa_amd_memory_pool_allocate(gpu_pool, kMemoryAllocSize, 0, + err = hsa_amd_memory_pool_allocate(gpu_pool, kMemoryAllocSize*sizeof(uint32_t), 0, reinterpret_cast(&OutData)); ASSERT_EQ(err, HSA_STATUS_SUCCESS); @@ -332,9 +332,9 @@ void MemoryAllocationTest::GroupMemoryDynamicAllocation(hsa_agent_t cpuAgent, } ASSERT_EQ(OutData[i], Indata[i]); } - if (Indata) { hsa_memory_free(Indata); } - if (OutData) {hsa_memory_free(OutData); } - if (kernArgs) { hsa_memory_free(kernArgs); } + if (Indata) { hsa_amd_memory_pool_free(Indata); } + if (OutData) { hsa_amd_memory_pool_free(OutData); } + if (kernArgs) { hsa_amd_memory_pool_free(kernArgs); } if (queue) { hsa_queue_destroy(queue); } } else { if (verbosity() > 0) {