diff --git a/runtime/hsa-runtime/core/runtime/runtime.cpp b/runtime/hsa-runtime/core/runtime/runtime.cpp index 8412561608..2c20375045 100644 --- a/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -488,7 +488,6 @@ hsa_status_t Runtime::CopyMemory(void* dst, core::Agent* dst_agent, const void* return block.agentOwner; }; - const bool dst_gpu = (dst_agent->device_type() == core::Agent::DeviceType::kAmdGpuDevice); const bool src_gpu = (src_agent->device_type() == core::Agent::DeviceType::kAmdGpuDevice); core::Agent* copy_agent = (src_gpu) ? src_agent : dst_agent; diff --git a/runtime/hsa-runtime/image/addrlib/src/gfx10/gfx10addrlib.cpp b/runtime/hsa-runtime/image/addrlib/src/gfx10/gfx10addrlib.cpp index 7852b9369a..733252f884 100644 --- a/runtime/hsa-runtime/image/addrlib/src/gfx10/gfx10addrlib.cpp +++ b/runtime/hsa-runtime/image/addrlib/src/gfx10/gfx10addrlib.cpp @@ -2597,7 +2597,6 @@ BOOL_32 Gfx10Lib::ValidateSwModeParams( const BOOL_32 linear = IsLinear(swizzle); const BOOL_32 blk256B = IsBlock256b(swizzle); const BOOL_32 blkVar = IsBlockVariable(swizzle); - const BOOL_32 isNonPrtXor = IsNonPrtXor(swizzle); const BOOL_32 prt = flags.prt; const BOOL_32 fmask = flags.fmask; @@ -3108,7 +3107,6 @@ ADDR_E_RETURNCODE Gfx10Lib::HwlGetPreferredSurfaceSetting( const UINT_32 ratioLow = computeMinSize ? 1 : (pIn->flags.opt4space ? 3 : 2); const UINT_32 ratioHi = computeMinSize ? 1 : (pIn->flags.opt4space ? 2 : 1); - const UINT_64 sizeAlignInElement = Max(NextPow2(pIn->minSizeAlign) / (bpp >> 3), 1u); UINT_32 minSizeBlk = AddrBlockMicro; UINT_64 minSize = 0; diff --git a/runtime/hsa-runtime/image/addrlib/src/gfx11/gfx11addrlib.cpp b/runtime/hsa-runtime/image/addrlib/src/gfx11/gfx11addrlib.cpp index f3aa3001f7..c80c6cea83 100644 --- a/runtime/hsa-runtime/image/addrlib/src/gfx11/gfx11addrlib.cpp +++ b/runtime/hsa-runtime/image/addrlib/src/gfx11/gfx11addrlib.cpp @@ -386,7 +386,6 @@ ADDR_E_RETURNCODE Gfx11Lib::HwlComputeDccInfo( // Get the DCC address equation (copied from DccAddrFromCoord) const UINT_32 elemLog2 = Log2(pIn->bpp >> 3); - const UINT_32 numPipeLog2 = m_pipesLog2; UINT_32 index = m_dccBaseIndex + elemLog2; const UINT_8* patIdxTable = (pIn->swizzleMode == ADDR_SW_64KB_R_X) ? GFX11_DCC_64K_R_X_PATIDX : GFX11_DCC_256K_R_X_PATIDX; @@ -2222,7 +2221,6 @@ BOOL_32 Gfx11Lib::ValidateSwModeParams( const BOOL_32 thin3d = flags.view3dAs2dArray; const BOOL_32 linear = IsLinear(swizzle); const BOOL_32 blk256B = IsBlock256b(swizzle); - const BOOL_32 isNonPrtXor = IsNonPrtXor(swizzle); const BOOL_32 prt = flags.prt; // Misc check @@ -2629,7 +2627,6 @@ ADDR_E_RETURNCODE Gfx11Lib::HwlGetPreferredSurfaceSetting( const UINT_32 ratioLow = computeMinSize ? 1 : (pIn->flags.opt4space ? 3 : 2); const UINT_32 ratioHi = computeMinSize ? 1 : (pIn->flags.opt4space ? 2 : 1); - const UINT_64 sizeAlignInElement = Max(NextPow2(pIn->minSizeAlign) / (bpp >> 3), 1u); UINT_32 minSizeBlk = AddrBlockMicro; UINT_64 minSize = 0; diff --git a/runtime/hsa-runtime/image/addrlib/src/gfx9/gfx9addrlib.cpp b/runtime/hsa-runtime/image/addrlib/src/gfx9/gfx9addrlib.cpp index ef3f7dbf54..3b62d2d78a 100644 --- a/runtime/hsa-runtime/image/addrlib/src/gfx9/gfx9addrlib.cpp +++ b/runtime/hsa-runtime/image/addrlib/src/gfx9/gfx9addrlib.cpp @@ -363,7 +363,6 @@ ADDR_E_RETURNCODE Gfx9Lib::HwlComputeCmaskInfo( // Generate the CMASK address equation. pOut->equation.gfx9.num_bits = Min(32u, eq->getsize()); - bool checked = false; for (unsigned b = 0; b < pOut->equation.gfx9.num_bits; b++) { CoordTerm &bit = (*eq)[b]; @@ -728,7 +727,6 @@ ADDR_E_RETURNCODE Gfx9Lib::HwlComputeDccInfo( // Generate the DCC address equation. pOut->equation.gfx9.num_bits = Min(32u, eq->getsize()); - bool checked = false; for (unsigned b = 0; b < pOut->equation.gfx9.num_bits; b++) { CoordTerm &bit = (*eq)[b]; @@ -3765,7 +3763,6 @@ ADDR_E_RETURNCODE Gfx9Lib::HwlGetPreferredSurfaceSetting( const UINT_32 ratioLow = computeMinSize ? 1 : (pIn->flags.opt4space ? 3 : 2); const UINT_32 ratioHi = computeMinSize ? 1 : (pIn->flags.opt4space ? 2 : 1); - const UINT_64 sizeAlignInElement = Max(NextPow2(pIn->minSizeAlign) / (bpp >> 3), 1u); UINT_32 minSizeBlk = AddrBlockMicro; UINT_64 minSize = 0; diff --git a/runtime/hsa-runtime/image/image_manager_ai.cpp b/runtime/hsa-runtime/image/image_manager_ai.cpp index 9a7d57d409..5d0a5a5e71 100644 --- a/runtime/hsa-runtime/image/image_manager_ai.cpp +++ b/runtime/hsa-runtime/image/image_manager_ai.cpp @@ -73,7 +73,10 @@ hsa_status_t ImageManagerAi::CalculateImageSizeAndAlignment( hsa_ext_image_data_info_t& image_info) const { ADDR2_COMPUTE_SURFACE_INFO_OUTPUT out = {0}; hsa_profile_t profile; + hsa_status_t status = HSA::hsa_agent_get_info(component, HSA_AGENT_INFO_PROFILE, &profile); + if (status != HSA_STATUS_SUCCESS) return status; + Image::TileMode tileMode = Image::TileMode::LINEAR; if (image_data_layout == HSA_EXT_IMAGE_DATA_LAYOUT_OPAQUE) { tileMode = (profile == HSA_PROFILE_BASE && @@ -110,7 +113,6 @@ bool ImageManagerAi::IsLocalMemory(const void* address) const { hsa_status_t ImageManagerAi::PopulateImageSrd(Image& image, const metadata_amd_t* descriptor) const { metadata_amd_ai_t* desc = (metadata_amd_ai_t*)descriptor; - bool atc_access = true; const void* image_data_addr = image.data; ImageProperty image_prop = ImageLut().MapFormat(image.desc.format, image.desc.geometry); @@ -121,7 +123,6 @@ hsa_status_t ImageManagerAi::PopulateImageSrd(Image& image, const metadata_amd_t const Swizzle swizzle = ImageLut().MapSwizzle(image.desc.format.channel_order); if (IsLocalMemory(image.data)) { - atc_access = false; image_data_addr = reinterpret_cast( reinterpret_cast(image.data) - local_memory_base_address_); } @@ -138,7 +139,6 @@ hsa_status_t ImageManagerAi::PopulateImageSrd(Image& image, const metadata_amd_t if (image.desc.geometry == HSA_EXT_IMAGE_GEOMETRY_1DB) { sq_buf_rsrc_word0_u word0; sq_buf_rsrc_word1_u word1; - sq_buf_rsrc_word2_u word2; sq_buf_rsrc_word3_u word3; word0.val = 0; @@ -271,14 +271,11 @@ hsa_status_t ImageManagerAi::PopulateImageSrd(Image& image) const { assert(image_prop.cap != HSA_EXT_IMAGE_CAPABILITY_NOT_SUPPORTED); assert(image_prop.element_size != 0); - bool atc_access = true; const void* image_data_addr = image.data; - if (IsLocalMemory(image.data)) { - atc_access = false; + if (IsLocalMemory(image.data)) image_data_addr = reinterpret_cast( reinterpret_cast(image.data) - local_memory_base_address_); - } if (image.desc.geometry == HSA_EXT_IMAGE_GEOMETRY_1DB) { sq_buf_rsrc_word0_u word0; diff --git a/runtime/hsa-runtime/image/image_manager_gfx11.cpp b/runtime/hsa-runtime/image/image_manager_gfx11.cpp index c1dd7d44f7..196648b910 100644 --- a/runtime/hsa-runtime/image/image_manager_gfx11.cpp +++ b/runtime/hsa-runtime/image/image_manager_gfx11.cpp @@ -201,7 +201,10 @@ hsa_status_t ImageManagerGfx11::CalculateImageSizeAndAlignment( hsa_ext_image_data_info_t& image_info) const { ADDR2_COMPUTE_SURFACE_INFO_OUTPUT out = {0}; hsa_profile_t profile; + hsa_status_t status = HSA::hsa_agent_get_info(component, HSA_AGENT_INFO_PROFILE, &profile); + if (status != HSA_STATUS_SUCCESS) return status; + Image::TileMode tileMode = Image::TileMode::LINEAR; if (image_data_layout == HSA_EXT_IMAGE_DATA_LAYOUT_OPAQUE) { tileMode = (profile == HSA_PROFILE_BASE && @@ -239,7 +242,6 @@ bool ImageManagerGfx11::IsLocalMemory(const void* address) const { hsa_status_t ImageManagerGfx11::PopulateImageSrd(Image& image, const metadata_amd_t* descriptor) const { const metadata_amd_gfx11_t* desc = reinterpret_cast(descriptor); - bool atc_access = true; const void* image_data_addr = image.data; ImageProperty image_prop = ImageLut().MapFormat(image.desc.format, image.desc.geometry); @@ -250,7 +252,6 @@ hsa_status_t ImageManagerGfx11::PopulateImageSrd(Image& image, const Swizzle swizzle = ImageLut().MapSwizzle(image.desc.format.channel_order); if (IsLocalMemory(image.data)) { - atc_access = false; image_data_addr = reinterpret_cast( reinterpret_cast(image.data) - local_memory_base_address_); } @@ -267,7 +268,6 @@ hsa_status_t ImageManagerGfx11::PopulateImageSrd(Image& image, if (image.desc.geometry == HSA_EXT_IMAGE_GEOMETRY_1DB) { SQ_BUF_RSRC_WORD0 word0; SQ_BUF_RSRC_WORD1 word1; - SQ_BUF_RSRC_WORD2 word2; SQ_BUF_RSRC_WORD3 word3; word0.val = 0; @@ -390,14 +390,11 @@ hsa_status_t ImageManagerGfx11::PopulateImageSrd(Image& image) const { assert(image_prop.cap != HSA_EXT_IMAGE_CAPABILITY_NOT_SUPPORTED); assert(image_prop.element_size != 0); - bool atc_access = true; const void* image_data_addr = image.data; - if (IsLocalMemory(image.data)) { - atc_access = false; + if (IsLocalMemory(image.data)) image_data_addr = reinterpret_cast( reinterpret_cast(image.data) - local_memory_base_address_); - } if (image.desc.geometry == HSA_EXT_IMAGE_GEOMETRY_1DB) { SQ_BUF_RSRC_WORD0 word0; @@ -635,7 +632,6 @@ uint32_t ImageManagerGfx11::GetAddrlibSurfaceInfoNv( const uint32_t num_slice = static_cast( std::max(kMinNumSlice, std::max(desc.array_size, desc.depth))); - uint32_t minor_ver = MinorVerFromDevID(chip_id_); ADDR2_COMPUTE_SURFACE_INFO_INPUT in = {0}; in.size = sizeof(ADDR2_COMPUTE_SURFACE_INFO_INPUT); in.format = addrlib_format; diff --git a/runtime/hsa-runtime/image/image_manager_kv.cpp b/runtime/hsa-runtime/image/image_manager_kv.cpp index c3c3c67cd5..ad1dd3e025 100644 --- a/runtime/hsa-runtime/image/image_manager_kv.cpp +++ b/runtime/hsa-runtime/image/image_manager_kv.cpp @@ -205,7 +205,10 @@ hsa_status_t ImageManagerKv::CalculateImageSizeAndAlignment( hsa_ext_image_data_info_t& image_info) const { ADDR_COMPUTE_SURFACE_INFO_OUTPUT out = {0}; hsa_profile_t profile; + hsa_status_t status = HSA::hsa_agent_get_info(component, HSA_AGENT_INFO_PROFILE, &profile); + if (status != HSA_STATUS_SUCCESS) return status; + Image::TileMode tileMode = Image::TileMode::LINEAR; if (image_data_layout == HSA_EXT_IMAGE_DATA_LAYOUT_OPAQUE) { tileMode = (profile == HSA_PROFILE_BASE && diff --git a/runtime/hsa-runtime/image/image_manager_nv.cpp b/runtime/hsa-runtime/image/image_manager_nv.cpp index 2c3b8f501c..8b5f228fc9 100644 --- a/runtime/hsa-runtime/image/image_manager_nv.cpp +++ b/runtime/hsa-runtime/image/image_manager_nv.cpp @@ -187,7 +187,10 @@ hsa_status_t ImageManagerNv::CalculateImageSizeAndAlignment( hsa_ext_image_data_info_t& image_info) const { ADDR2_COMPUTE_SURFACE_INFO_OUTPUT out = {0}; hsa_profile_t profile; + hsa_status_t status = HSA::hsa_agent_get_info(component, HSA_AGENT_INFO_PROFILE, &profile); + if (status != HSA_STATUS_SUCCESS) return status; + Image::TileMode tileMode = Image::TileMode::LINEAR; if (image_data_layout == HSA_EXT_IMAGE_DATA_LAYOUT_OPAQUE) { tileMode = (profile == HSA_PROFILE_BASE && @@ -226,7 +229,6 @@ hsa_status_t ImageManagerNv::PopulateImageSrd(Image& image, const metadata_amd_t* descriptor) const { const metadata_amd_nv_t* desc = reinterpret_cast(descriptor); - bool atc_access = true; const void* image_data_addr = image.data; ImageProperty image_prop = ImageLut().MapFormat(image.desc.format, image.desc.geometry); @@ -237,7 +239,6 @@ hsa_status_t ImageManagerNv::PopulateImageSrd(Image& image, const Swizzle swizzle = ImageLut().MapSwizzle(image.desc.format.channel_order); if (IsLocalMemory(image.data)) { - atc_access = false; image_data_addr = reinterpret_cast( reinterpret_cast(image.data) - local_memory_base_address_); } @@ -254,7 +255,6 @@ hsa_status_t ImageManagerNv::PopulateImageSrd(Image& image, if (image.desc.geometry == HSA_EXT_IMAGE_GEOMETRY_1DB) { SQ_BUF_RSRC_WORD0 word0; SQ_BUF_RSRC_WORD1 word1; - SQ_BUF_RSRC_WORD2 word2; SQ_BUF_RSRC_WORD3 word3; word0.val = 0; @@ -377,11 +377,9 @@ hsa_status_t ImageManagerNv::PopulateImageSrd(Image& image) const { assert(image_prop.cap != HSA_EXT_IMAGE_CAPABILITY_NOT_SUPPORTED); assert(image_prop.element_size != 0); - bool atc_access = true; const void* image_data_addr = image.data; if (IsLocalMemory(image.data)) { - atc_access = false; image_data_addr = reinterpret_cast( reinterpret_cast(image.data) - local_memory_base_address_); }