From d3942fe73bace69498ea5629774671eafa915521 Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Fri, 24 Mar 2023 16:00:35 +0530 Subject: [PATCH] SWDEV-367689 - [catch2][dtest] UnifiedAddress attribute support for AMD (#204) Change-Id: Ie820e8d9fb59322fb66380bf676a66362adc0b65 --- catch/unit/device/hipGetDeviceAttribute.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/catch/unit/device/hipGetDeviceAttribute.cc b/catch/unit/device/hipGetDeviceAttribute.cc index 62b1aceed4..208f997e2b 100644 --- a/catch/unit/device/hipGetDeviceAttribute.cc +++ b/catch/unit/device/hipGetDeviceAttribute.cc @@ -1,16 +1,13 @@ /* -Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. - +Copyright (c) 2022 - 2023 Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -232,8 +229,10 @@ TEST_CASE("Unit_hipGetDeviceAttribute_CheckAttrValues") { hipDeviceAttributeEccEnabled, props.ECCEnabled)); HIP_CHECK(test_hipDeviceGetAttribute(deviceId, - hipDeviceAttributeTexturePitchAlignment, - props.texturePitchAlignment)); + hipDeviceAttributeTexturePitchAlignment, + props.texturePitchAlignment)); + HIP_CHECK(test_hipDeviceGetAttribute(deviceId, + hipDeviceAttributeUnifiedAddressing, 1/*true*/)); } /** @@ -375,7 +374,7 @@ using AttributeToStringMap = std::array kCommonAttributes{{ +constexpr AttributeToStringMap<57> kCommonAttributes{{ {hipDeviceAttributeEccEnabled, "hipDeviceAttributeEccEnabled"}, {hipDeviceAttributeCanMapHostMemory, "hipDeviceAttributeCanMapHostMemory"}, {hipDeviceAttributeClockRate, "hipDeviceAttributeClockRate"}, @@ -436,12 +435,13 @@ constexpr AttributeToStringMap<56> kCommonAttributes{{ {hipDeviceAttributeTotalGlobalMem, "hipDeviceAttributeTotalGlobalMem"}, {hipDeviceAttributeWarpSize, "hipDeviceAttributeWarpSize"}, {hipDeviceAttributeMemoryPoolsSupported, "hipDeviceAttributeMemoryPoolsSupported"}, + {hipDeviceAttributeUnifiedAddressing, "hipDeviceAttributeUnifiedAddressing"}, {hipDeviceAttributeVirtualMemoryManagementSupported, "hipDeviceAttributeVirtualMemoryManagementSupported"} }}; #if HT_NVIDIA -constexpr AttributeToStringMap<34> kCudaOnlyAttributes{ +constexpr AttributeToStringMap<33> kCudaOnlyAttributes{ {{hipDeviceAttributeAccessPolicyMaxWindowSize, "hipDeviceAttributeAccessPolicyMaxWindowSize"}, {hipDeviceAttributeAsyncEngineCount, "hipDeviceAttributeAsyncEngineCount"}, {hipDeviceAttributeCanUseHostPointerForRegisteredMem, @@ -476,7 +476,6 @@ constexpr AttributeToStringMap<34> kCudaOnlyAttributes{ {hipDeviceAttributeStreamPrioritiesSupported, "hipDeviceAttributeStreamPrioritiesSupported"}, {hipDeviceAttributeSurfaceAlignment, "hipDeviceAttributeSurfaceAlignment"}, {hipDeviceAttributeTccDriver, "hipDeviceAttributeTccDriver"}, - {hipDeviceAttributeUnifiedAddressing, "hipDeviceAttributeUnifiedAddressing"}, {hipDeviceAttributeUuid, "hipDeviceAttributeUuid"}}}; #endif @@ -555,4 +554,4 @@ TEST_CASE("Print_Out_Attributes") { #endif std::flush(std::cout); -} \ No newline at end of file +}