mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +08:00
Add ULT for GmmHelper
Cover test case for getAddressWidth method. Related-To: NEO-6523 Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0966651a78
commit
2a71266708
@@ -6,7 +6,9 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/gmm_helper/client_context/gmm_handle_allocator.h"
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/gmm_helper/resource_info.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/mocks/mock_gmm_client_context.h"
|
||||
#include "shared/test/common/mocks/mock_gmm_resource_info.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
@@ -143,3 +145,25 @@ TEST(GmmResourceInfo, GivenEmptyHandleWhenUsingBaseHandleAllocatorThenOpenHandle
|
||||
EXPECT_TRUE(isNewHandleOpen);
|
||||
defaultAllocator.destroyHandle(handle);
|
||||
}
|
||||
|
||||
TEST(GmmHelperTests, WhenInitializingGmmHelperThenCorrectAddressWidthIsSet) {
|
||||
auto hwInfo = *NEO::defaultHwInfo;
|
||||
|
||||
hwInfo.capabilityTable.gpuAddressSpace = maxNBitValue(48);
|
||||
auto gmmHelper = std::make_unique<NEO::GmmHelper>(nullptr, &hwInfo);
|
||||
|
||||
auto addressWidth = gmmHelper->getAddressWidth();
|
||||
EXPECT_EQ(48u, addressWidth);
|
||||
|
||||
hwInfo.capabilityTable.gpuAddressSpace = maxNBitValue(36);
|
||||
gmmHelper = std::make_unique<NEO::GmmHelper>(nullptr, &hwInfo);
|
||||
|
||||
addressWidth = gmmHelper->getAddressWidth();
|
||||
EXPECT_EQ(48u, addressWidth);
|
||||
|
||||
hwInfo.capabilityTable.gpuAddressSpace = maxNBitValue(57);
|
||||
gmmHelper = std::make_unique<NEO::GmmHelper>(nullptr, &hwInfo);
|
||||
|
||||
addressWidth = gmmHelper->getAddressWidth();
|
||||
EXPECT_EQ(57u, addressWidth);
|
||||
}
|
||||
Reference in New Issue
Block a user