diff --git a/opencl/source/gen12lp/gtpin_setup_gen12lp.cpp b/opencl/source/gen12lp/gtpin_setup_gen12lp.cpp index efa222e7a5..4aa74b66cc 100644 --- a/opencl/source/gen12lp/gtpin_setup_gen12lp.cpp +++ b/opencl/source/gen12lp/gtpin_setup_gen12lp.cpp @@ -19,7 +19,7 @@ static const auto gfxFamily = IGFX_GEN12LP_CORE; template <> uint32_t GTPinHwHelperHw::getGenVersion() { - return gtpin::GTPIN_GEN_INVALID; + return gtpin::GTPIN_GEN_12_1; } template class GTPinHwHelperHw; diff --git a/opencl/test/unit_test/gtpin/gtpin_tests.cpp b/opencl/test/unit_test/gtpin/gtpin_tests.cpp index 3ea8b82bbd..8293da7b58 100644 --- a/opencl/test/unit_test/gtpin/gtpin_tests.cpp +++ b/opencl/test/unit_test/gtpin/gtpin_tests.cpp @@ -65,8 +65,10 @@ bool returnNullResource = false; context_handle_t currContext = nullptr; std::deque 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(>pinCallbacks, &driverServices, nullptr); + EXPECT_EQ(GTPIN_DI_SUCCESS, retFromGtPin); + + cl_device_id device = static_cast(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 >pinHelper = GTPinHwHelper::get(genFamily); + EXPECT_EQ(ULT::platformInfo.gen_version, static_cast(gtpinHelper.getGenVersion())); + + retVal = clReleaseContext(context); + EXPECT_EQ(CL_SUCCESS, retVal); +} + TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelIsExecutedThenGTPinCallbacksAreCalled) { gtpinCallbacks.onContextCreate = OnContextCreate; gtpinCallbacks.onContextDestroy = OnContextDestroy;