SWDEV-437832 - Adding new test to print if the device is APU.
Change-Id: Iab97730e25d565d04a31ce526fbcacfc3c6d84bd
This commit is contained in:
@@ -16,6 +16,7 @@ set(TEST_SRC
|
||||
hipGetSetDeviceFlags.cc
|
||||
hipSetGetDevice.cc
|
||||
hipDeviceGetUuid.cc
|
||||
hipDeviceAPUCheck.cc
|
||||
hipDeviceGetDefaultMemPool.cc
|
||||
hipDeviceCanAccessPeer.cc
|
||||
hipDeviceEnableDisablePeerAccess.cc
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
Copyright (c) 2024 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
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <hip_test_common.hh>
|
||||
|
||||
/**
|
||||
* @addtogroup hipDeviceAPUCheck
|
||||
* @{
|
||||
* @ingroup DeviceTest
|
||||
* `hipGetDeviceProperties(const hipDeviceProp_t* prop, int device)` -
|
||||
* Device which matches `hipDeviceProp_t` is returned.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* - Prints if the system is an APU or has discrete graphics card.
|
||||
* Test source
|
||||
* ------------------------
|
||||
* - unit/device/hipDeviceAPUCheck.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* - HIP_VERSION >= 6.2
|
||||
*/
|
||||
TEST_CASE("Unit_hipDeviceAPUCheck") {
|
||||
hipDeviceProp_t prop;
|
||||
HIP_CHECK(hipGetDeviceProperties(&prop, 0));
|
||||
if (!prop.integrated) {
|
||||
HipTest::HIP_SKIP_TEST("This device is a Discrete Graphics card. So skipping test");
|
||||
return;
|
||||
} else {
|
||||
std::cout<<"This device is an APU"<<std::endl;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user