diff --git a/libhsakmt/src/hsakmtmodel.c b/libhsakmt/src/hsakmtmodel.c index aed62d03bd..c065c3f0a3 100644 --- a/libhsakmt/src/hsakmtmodel.c +++ b/libhsakmt/src/hsakmtmodel.c @@ -99,7 +99,7 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtModelEnabled(bool* enable) return HSAKMT_STATUS_SUCCESS; } -void model_init_env_vars() +void model_init_env_vars(void) { /* Check whether to use a model instead of real hardware */ hsakmt_model_topology = getenv("HSA_MODEL_TOPOLOGY"); @@ -262,7 +262,7 @@ static void model_set_event(void *data, unsigned event_id) pthread_cond_broadcast(&model_event_condvar); } -void model_init() +void model_init(void) { if (!hsakmt_use_model) return; @@ -637,7 +637,7 @@ static int model_kfd_ioctl_locked(unsigned long request, void *arg) { unsigned slot = events[i].event_id - 1; struct model_event *event = &model_events[slot]; - bool this_ready; + bool this_ready = false; if (event->event_type == HSA_EVENTTYPE_SIGNAL) { uint64_t current_age = event->value; diff --git a/rocrtst/suites/functional/cu_masking.cc b/rocrtst/suites/functional/cu_masking.cc index 5a70614fee..aabc30154a 100644 --- a/rocrtst/suites/functional/cu_masking.cc +++ b/rocrtst/suites/functional/cu_masking.cc @@ -174,7 +174,7 @@ void CU_Masking::Run() { auto dispatch = [&]() { memset(args->hw_ids, 0, sizeof(uint32_t)*threads); - Aql pkt = {0}; + Aql pkt = { }; pkt.header.type = HSA_PACKET_TYPE_KERNEL_DISPATCH; pkt.header.acquire = HSA_FENCE_SCOPE_SYSTEM; pkt.header.release = HSA_FENCE_SCOPE_SYSTEM; diff --git a/runtime/hsa-runtime/core/inc/amd_gpu_agent.h b/runtime/hsa-runtime/core/inc/amd_gpu_agent.h index 9d3fc4a9b3..5edd750b15 100644 --- a/runtime/hsa-runtime/core/inc/amd_gpu_agent.h +++ b/runtime/hsa-runtime/core/inc/amd_gpu_agent.h @@ -555,13 +555,13 @@ class GpuAgent : public GpuAgentInt { hsa_status_t PcSamplingIterateConfig(hsa_ven_amd_pcs_iterate_configuration_callback_t cb, void* cb_data) override; - hsa_status_t PcSamplingCreate(pcs::PcsRuntime::PcSamplingSession& session); + hsa_status_t PcSamplingCreate(pcs::PcsRuntime::PcSamplingSession& session) override; hsa_status_t PcSamplingCreateFromId(HsaPcSamplingTraceId pcsId, - pcs::PcsRuntime::PcSamplingSession& session); - hsa_status_t PcSamplingDestroy(pcs::PcsRuntime::PcSamplingSession& session); - hsa_status_t PcSamplingStart(pcs::PcsRuntime::PcSamplingSession& session); - hsa_status_t PcSamplingStop(pcs::PcsRuntime::PcSamplingSession& session); - hsa_status_t PcSamplingFlush(pcs::PcsRuntime::PcSamplingSession& session); + pcs::PcsRuntime::PcSamplingSession& session) override; + hsa_status_t PcSamplingDestroy(pcs::PcsRuntime::PcSamplingSession& session) override; + hsa_status_t PcSamplingStart(pcs::PcsRuntime::PcSamplingSession& session) override; + hsa_status_t PcSamplingStop(pcs::PcsRuntime::PcSamplingSession& session) override; + hsa_status_t PcSamplingFlush(pcs::PcsRuntime::PcSamplingSession& session) override; hsa_status_t PcSamplingFlushDeviceBuffers(pcs::PcsRuntime::PcSamplingSession& session); // @brief Node properties. diff --git a/runtime/hsa-runtime/core/inc/runtime.h b/runtime/hsa-runtime/core/inc/runtime.h index b9b495ea0b..4c3a1cea00 100644 --- a/runtime/hsa-runtime/core/inc/runtime.h +++ b/runtime/hsa-runtime/core/inc/runtime.h @@ -91,6 +91,7 @@ #define HSA_ARGUMENT_ALIGN_BYTES 16 #define HSA_QUEUE_ALIGN_BYTES 64 #define HSA_PACKET_ALIGN_BYTES 64 +#define HSA_MAX_DEP_SIGNALS 5 //Avoids include namespace rocr { diff --git a/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp b/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp index 57d66df9fc..2fbc1a3af0 100644 --- a/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp @@ -98,8 +98,6 @@ AqlQueue::AqlQueue(core::SharedQueue* shared_queue, GpuAgent* agent, size_t req_ priority_(HSA_QUEUE_PRIORITY_NORMAL), exception_signal_(nullptr) { - const core::Isa* isa = agent_->supported_isas()[0]; - // Queue size is a function of several restrictions. const uint32_t min_pkts = ComputeRingBufferMinPkts(); const uint32_t max_pkts = ComputeRingBufferMaxPkts(); diff --git a/runtime/hsa-runtime/core/runtime/amd_blit_kernel.cpp b/runtime/hsa-runtime/core/runtime/amd_blit_kernel.cpp index ed4364eab0..b74e6cbee1 100644 --- a/runtime/hsa-runtime/core/runtime/amd_blit_kernel.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_blit_kernel.cpp @@ -52,7 +52,6 @@ namespace rocr { namespace AMD { -static const uint16_t kInvalidPacketHeader = HSA_PACKET_TYPE_INVALID; static std::string& kBlitKernelSource() { static std::string kBlitKernelSource_(R"( @@ -862,7 +861,7 @@ void BlitKernel::PopulateQueue(uint64_t index, uint64_t code_handle, void* args, hsa_signal_t completion_signal) { assert(IsMultipleOf(args, 16)); - hsa_kernel_dispatch_packet_t packet = {0}; + hsa_kernel_dispatch_packet_t packet = { }; static const uint16_t kDispatchPacketHeader = (HSA_PACKET_TYPE_KERNEL_DISPATCH << HSA_PACKET_HEADER_TYPE) | diff --git a/runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp b/runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp index a4692fa1d0..a9384dfcc0 100644 --- a/runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp @@ -287,7 +287,7 @@ hsa_status_t BlitSdma: uint32_t num_poll_command = 0; // Cached copy of dep_signals[i]->LoadRelaxed - uint64_t dep_signals_value[dep_signals.size()]; + uint64_t dep_signals_value[HSA_MAX_DEP_SIGNALS]; for (size_t i = 0; i < dep_signals.size(); ++i) { // The signal is 64 bit value, and poll checks for 32 bit value. diff --git a/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index 6022c4ac8a..88d06b391b 100644 --- a/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -800,7 +800,7 @@ void GpuAgent::InitDma() { // Dedicated compute queue for PC Sampling CP-DMA commands. We need a dedicated queue that runs at // highest priority because we do not want the CP-DMA commands to be delayed/blocked due to // other dispatches/barriers that could be in the other AQL queues. - queues_[QueuePCSampling].reset([queue_lambda, this]() { return queue_lambda(HSA_QUEUE_PRIORITY_MAXIMUM); }); + queues_[QueuePCSampling].reset([queue_lambda]() { return queue_lambda(HSA_QUEUE_PRIORITY_MAXIMUM); }); // Decide which engine to use for blits. auto blit_lambda = [this](bool use_xgmi, lazy_ptr& queue, bool isHostToDev, uint32_t rec_eng) { diff --git a/runtime/hsa-runtime/image/blit_kernel.cpp b/runtime/hsa-runtime/image/blit_kernel.cpp index 637e855f5c..01b54fafa9 100644 --- a/runtime/hsa-runtime/image/blit_kernel.cpp +++ b/runtime/hsa-runtime/image/blit_kernel.cpp @@ -261,7 +261,7 @@ hsa_status_t BlitKernel::CopyBufferToImage( assert(dst_image_view != NULL); - hsa_kernel_dispatch_packet_t packet = {0}; + hsa_kernel_dispatch_packet_t packet = { }; const BlitCodeInfo& blit_code = blit_code_catalog.at(KERNEL_OP_COPY_BUFFER_TO_IMAGE); @@ -369,7 +369,7 @@ hsa_status_t BlitKernel::CopyImageToBuffer( assert(src_image_view != NULL); - hsa_kernel_dispatch_packet_t packet = {0}; + hsa_kernel_dispatch_packet_t packet = { }; const BlitCodeInfo& blit_code = blit_code_catalog.at(KERNEL_OP_COPY_IMAGE_TO_BUFFER); @@ -496,7 +496,7 @@ hsa_status_t BlitKernel::CopyImage( blit_code = &blit_code_catalog.at(copy_type); } - hsa_kernel_dispatch_packet_t packet = {0}; + hsa_kernel_dispatch_packet_t packet = { }; packet.kernel_object = blit_code->code_handle_; packet.group_segment_size = blit_code->group_segment_size_; @@ -555,7 +555,7 @@ hsa_status_t BlitKernel::FillImage( BlitQueue& blit_queue, const std::vector& blit_code_catalog, const Image& image, const void* pattern, const hsa_ext_image_region_t& region) { - hsa_kernel_dispatch_packet_t packet = {0}; + hsa_kernel_dispatch_packet_t packet = { }; const BlitCodeInfo& blit_code = (image.desc.geometry != HSA_EXT_IMAGE_GEOMETRY_1DB) diff --git a/runtime/hsa-runtime/image/image_manager_gfx12.cpp b/runtime/hsa-runtime/image/image_manager_gfx12.cpp index 8606f279dc..2ac9640c56 100644 --- a/runtime/hsa-runtime/image/image_manager_gfx12.cpp +++ b/runtime/hsa-runtime/image/image_manager_gfx12.cpp @@ -62,24 +62,24 @@ namespace rocr { namespace image { -static_assert(sizeof(SQ_BUF_RSRC_WORD0) == sizeof(uint32_t)); -static_assert(sizeof(SQ_BUF_RSRC_WORD1) == sizeof(uint32_t)); -static_assert(sizeof(SQ_BUF_RSRC_WORD2) == sizeof(uint32_t)); -static_assert(sizeof(SQ_BUF_RSRC_WORD3) == sizeof(uint32_t)); +static_assert(sizeof(SQ_BUF_RSRC_WORD0) == sizeof(uint32_t), "struct size is invalid"); +static_assert(sizeof(SQ_BUF_RSRC_WORD1) == sizeof(uint32_t), "struct size is invalid"); +static_assert(sizeof(SQ_BUF_RSRC_WORD2) == sizeof(uint32_t), "struct size is invalid"); +static_assert(sizeof(SQ_BUF_RSRC_WORD3) == sizeof(uint32_t), "struct size is invalid"); -static_assert(sizeof(SQ_IMG_RSRC_WORD0) == sizeof(uint32_t)); -static_assert(sizeof(SQ_IMG_RSRC_WORD1) == sizeof(uint32_t)); -static_assert(sizeof(SQ_IMG_RSRC_WORD2) == sizeof(uint32_t)); -static_assert(sizeof(SQ_IMG_RSRC_WORD3) == sizeof(uint32_t)); -static_assert(sizeof(SQ_IMG_RSRC_WORD4) == sizeof(uint32_t)); -static_assert(sizeof(SQ_IMG_RSRC_WORD5) == sizeof(uint32_t)); -static_assert(sizeof(SQ_IMG_RSRC_WORD6) == sizeof(uint32_t)); -static_assert(sizeof(SQ_IMG_RSRC_WORD7) == sizeof(uint32_t)); +static_assert(sizeof(SQ_IMG_RSRC_WORD0) == sizeof(uint32_t), "struct size is invalid"); +static_assert(sizeof(SQ_IMG_RSRC_WORD1) == sizeof(uint32_t), "struct size is invalid"); +static_assert(sizeof(SQ_IMG_RSRC_WORD2) == sizeof(uint32_t), "struct size is invalid"); +static_assert(sizeof(SQ_IMG_RSRC_WORD3) == sizeof(uint32_t), "struct size is invalid"); +static_assert(sizeof(SQ_IMG_RSRC_WORD4) == sizeof(uint32_t), "struct size is invalid"); +static_assert(sizeof(SQ_IMG_RSRC_WORD5) == sizeof(uint32_t), "struct size is invalid"); +static_assert(sizeof(SQ_IMG_RSRC_WORD6) == sizeof(uint32_t), "struct size is invalid"); +static_assert(sizeof(SQ_IMG_RSRC_WORD7) == sizeof(uint32_t), "struct size is invalid"); -static_assert(sizeof(SQ_IMG_SAMP_WORD0) == sizeof(uint32_t)); -static_assert(sizeof(SQ_IMG_SAMP_WORD1) == sizeof(uint32_t)); -static_assert(sizeof(SQ_IMG_SAMP_WORD2) == sizeof(uint32_t)); -static_assert(sizeof(SQ_IMG_SAMP_WORD3) == sizeof(uint32_t)); +static_assert(sizeof(SQ_IMG_SAMP_WORD0) == sizeof(uint32_t), "struct size is invalid"); +static_assert(sizeof(SQ_IMG_SAMP_WORD1) == sizeof(uint32_t), "struct size is invalid"); +static_assert(sizeof(SQ_IMG_SAMP_WORD2) == sizeof(uint32_t), "struct size is invalid"); +static_assert(sizeof(SQ_IMG_SAMP_WORD3) == sizeof(uint32_t), "struct size is invalid"); //----------------------------------------------------------------------------- // Workaround switch to combined format/type codes and missing gfx11