From 93b84eed4bb0ed876a618456e2282d96831dae59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20=C3=84ij=C3=B6?= Date: Wed, 23 Nov 2016 21:10:00 +0200 Subject: [PATCH] Fix the indexing of the queue --- src/core/api/test_helper_func.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/api/test_helper_func.c b/src/core/api/test_helper_func.c index c7aa40c..f8b558f 100644 --- a/src/core/api/test_helper_func.c +++ b/src/core/api/test_helper_func.c @@ -438,7 +438,7 @@ void launch_no_op_kernels(hsa_agent_t* agent, // Obtain the address of the queue packet entry queue_packet = (hsa_kernel_dispatch_packet_t*) (queue->base_address + - write_index * packet_size); + (write_index % queue->size) * packet_size); // Copy the initialized packet to the queue packet entry memcpy(queue_packet, &dispatch_packet, packet_size); // Set the queue packet entries header.type value