mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
Return correct GEN version
Change-Id: Ieb0f6bc65ecc49d4aad59cd81087c16fac137f63 Signed-off-by: Koska <andrzej.koska@intel.com> Related-To: NEO-4141
This commit is contained in:
@@ -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>;
|
||||
|
||||
@@ -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(>pinCallbacks, &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 >pinHelper = 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;
|
||||
|
||||
Reference in New Issue
Block a user