Return correct GEN version

Change-Id: Ieb0f6bc65ecc49d4aad59cd81087c16fac137f63
Signed-off-by: Koska <andrzej.koska@intel.com>
Related-To: NEO-4141
This commit is contained in:
Koska
2020-02-24 14:35:50 +01:00
committed by sys_ocldev
parent dbb2f1b8c9
commit 7ded3e9906
2 changed files with 27 additions and 1 deletions

View File

@@ -19,7 +19,7 @@ static const auto gfxFamily = IGFX_GEN12LP_CORE;
template <>
uint32_t GTPinHwHelperHw<Family>::getGenVersion() {
return gtpin::GTPIN_GEN_INVALID;
return gtpin::GTPIN_GEN_12_1;
}
template class GTPinHwHelperHw<Family>;

View File

@@ -65,8 +65,10 @@ bool returnNullResource = false;
context_handle_t currContext = nullptr;
std::deque<resource_handle_t> kernelResources;
platform_info_t platformInfo;
void OnContextCreate(context_handle_t context, platform_info_t *platformInfo, igc_init_t **igcInit) {
ULT::platformInfo.gen_version = platformInfo->gen_version;
currContext = context;
kernelResources.clear();
ContextCreateCallbackCount++;
@@ -670,6 +672,30 @@ TEST_F(GTPinTests, givenUninitializedGTPinInterfaceThenGTPinKernelCreateCallback
EXPECT_EQ(CL_SUCCESS, retVal);
}
TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenContextIsCreatedThenCorrectVersionIsSet) {
gtpinCallbacks.onContextCreate = OnContextCreate;
gtpinCallbacks.onContextDestroy = OnContextDestroy;
gtpinCallbacks.onKernelCreate = OnKernelCreate;
gtpinCallbacks.onKernelSubmit = OnKernelSubmit;
gtpinCallbacks.onCommandBufferCreate = OnCommandBufferCreate;
gtpinCallbacks.onCommandBufferComplete = OnCommandBufferComplete;
retFromGtPin = GTPin_Init(&gtpinCallbacks, &driverServices, nullptr);
EXPECT_EQ(GTPIN_DI_SUCCESS, retFromGtPin);
cl_device_id device = static_cast<cl_device_id>(pDevice);
cl_context context = nullptr;
context = clCreateContext(nullptr, 1, &device, nullptr, nullptr, &retVal);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_NE(nullptr, context);
GFXCORE_FAMILY genFamily = pDevice->getHardwareInfo().platform.eRenderCoreFamily;
GTPinHwHelper &gtpinHelper = GTPinHwHelper::get(genFamily);
EXPECT_EQ(ULT::platformInfo.gen_version, static_cast<gtpin::GTPIN_GEN_VERSION>(gtpinHelper.getGenVersion()));
retVal = clReleaseContext(context);
EXPECT_EQ(CL_SUCCESS, retVal);
}
TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelIsExecutedThenGTPinCallbacksAreCalled) {
gtpinCallbacks.onContextCreate = OnContextCreate;
gtpinCallbacks.onContextDestroy = OnContextDestroy;