Skip to content

Commit 53873e3

Browse files
committed
rocr: Fix type mismatch in printf
Format packet.workgroup_size_x correctly as a size_t. Format packet.workgroup_size_y correctly as a size_t. Format packet.workgroup_size_z correctly as a size_t. Format packet.grid_size_x correctly as a size_t. Format packet.grid_size_y correctly as a size_t. Format packet.grid_size_z correctly as a size_t. Format packet.group_segment_size correctly as a size_t. Format packet.private_segment_size correctly as a size_t. Format barrier_packet.completion_signal correctly as an address using %zx. Format barrier_packet.dep_signal[0] correctly as an address using %zx. Format barrier_packet.dep_signal[1] correctly as an address using %zx. Format barrier_packet.dep_signal[2] correctly as an address using %zx. Format barrier_packet.dep_signal[3] correctly as an address using %zx. Format barrier_packet.dep_signal[4] correctly as an address using %zx. Format packet.kernarg_address correctly as an address using %zx. Format completion_signal correctly as an address using %zx. Format this->queue_->public_handle()->id correctly as an unsigned long. Format this->queue_->LoadReadIndexRelaxed() correctly as an unsigned long. Format write_index correctly as an unsigned long. Format index correctly as an unsigned long. Signed-off-by: Alysa Liu <Alysa.Liu@amd.com>
1 parent ea0a3e8 commit 53873e3

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

runtime/hsa-runtime/core/runtime/amd_blit_kernel.cpp

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -679,10 +679,10 @@ hsa_status_t BlitKernel::SubmitLinearCopyCommand(
679679
queue_buffer[(write_index)&queue_bitmask_].header = kBarrierPacketHeader;
680680

681681
LogPrint(HSA_AMD_LOG_FLAG_BLIT_KERNEL_PKTS,
682-
"HWq=%p, id=%d, Barrier Header = "
682+
"HWq=%p, id=%lu, Barrier Header = "
683683
"0x%x (type=%d, barrier=%d, acquire=%d, release=%d), "
684684
"dep_signal=[0x%zx 0x%zx 0x%zx 0x%zx 0x%zx], completion_signal=0x%zx "
685-
"rptr=%u, wptr=%u",
685+
"rptr=%lu, wptr=%lu",
686686
queue_->public_handle()->base_address, queue_->public_handle()->id,
687687
kBarrierPacketHeader,
688688
extractAqlBits(kBarrierPacketHeader,
@@ -693,9 +693,13 @@ hsa_status_t BlitKernel::SubmitLinearCopyCommand(
693693
HSA_PACKET_HEADER_WIDTH_SCACQUIRE_FENCE_SCOPE),
694694
extractAqlBits(kBarrierPacketHeader, HSA_PACKET_HEADER_SCRELEASE_FENCE_SCOPE,
695695
HSA_PACKET_HEADER_WIDTH_SCRELEASE_FENCE_SCOPE),
696-
barrier_packet.dep_signal[0], barrier_packet.dep_signal[1], barrier_packet.dep_signal[2],
697-
barrier_packet.dep_signal[3], barrier_packet.dep_signal[4],
698-
barrier_packet.completion_signal, queue_->LoadReadIndexRelaxed(), write_index);
696+
barrier_packet.dep_signal[0].handle,
697+
barrier_packet.dep_signal[1].handle,
698+
barrier_packet.dep_signal[2].handle,
699+
barrier_packet.dep_signal[3].handle,
700+
barrier_packet.dep_signal[4].handle,
701+
barrier_packet.completion_signal.handle,
702+
queue_->LoadReadIndexRelaxed(), write_index);
699703

700704
++write_index;
701705

@@ -897,11 +901,11 @@ void BlitKernel::PopulateQueue(uint64_t index, uint64_t code_handle, void* args,
897901
kDispatchPacketHeader | packet.setup << 16, __ATOMIC_RELEASE);
898902

899903
LogPrint(HSA_AMD_LOG_FLAG_BLIT_KERNEL_PKTS,
900-
"HWq=%p, id=%d, Dispatch Header = "
904+
"HWq=%p, id=%lu, Dispatch Header = "
901905
"0x%x (type=%d, barrier=%d, acquire=%d, release=%d), "
902906
"setup=%d, grid=[%zu, %zu, %zu], workgroup=[%zu, %zu, %zu], private_seg_size=%zu, "
903907
"group_seg_size=%zu, kernel_obj=0x%zx, kernarg_address=0x%zx, completion_signal=0x%zx "
904-
"rptr=%u, wptr=%u",
908+
"rptr=%lu, wptr=%lu",
905909
queue_->public_handle()->base_address, queue_->public_handle()->id,
906910
kDispatchPacketHeader,
907911
extractAqlBits(kDispatchPacketHeader,
@@ -912,11 +916,11 @@ void BlitKernel::PopulateQueue(uint64_t index, uint64_t code_handle, void* args,
912916
HSA_PACKET_HEADER_WIDTH_SCACQUIRE_FENCE_SCOPE),
913917
extractAqlBits(kDispatchPacketHeader, HSA_PACKET_HEADER_SCRELEASE_FENCE_SCOPE,
914918
HSA_PACKET_HEADER_WIDTH_SCRELEASE_FENCE_SCOPE),
915-
packet.setup, packet.grid_size_x, packet.grid_size_y, packet.grid_size_z,
916-
packet.workgroup_size_x, packet.workgroup_size_y, packet.workgroup_size_z,
917-
packet.private_segment_size, packet.group_segment_size,
918-
packet.kernel_object,packet.kernarg_address,
919-
completion_signal, queue_->LoadReadIndexRelaxed(), index);
919+
packet.setup, static_cast<size_t>(packet.grid_size_x), static_cast<size_t>(packet.grid_size_y), static_cast<size_t>(packet.grid_size_z),
920+
static_cast<size_t>(packet.workgroup_size_x), static_cast<size_t>(packet.workgroup_size_y), static_cast<size_t>(packet.workgroup_size_z),
921+
static_cast<size_t>(packet.private_segment_size), static_cast<size_t>(packet.group_segment_size),
922+
packet.kernel_object,reinterpret_cast<uintptr_t>(packet.kernarg_address),
923+
completion_signal.handle, queue_->LoadReadIndexRelaxed(), index);
920924
}
921925

922926
BlitKernel::KernelArgs* BlitKernel::ObtainAsyncKernelCopyArg() {

0 commit comments

Comments
 (0)