diff --git a/opencl/source/dll/linux/os_interface.cpp b/opencl/source/dll/linux/os_interface.cpp index 3051b4a8f8..6961305289 100644 --- a/opencl/source/dll/linux/os_interface.cpp +++ b/opencl/source/dll/linux/os_interface.cpp @@ -15,7 +15,10 @@ namespace NEO { bool OSInterface::osEnableLocalMemory = true; void OSInterface::setGmmInputArgs(void *args) { - reinterpret_cast(args)->FileDescriptor = this->get()->getDrm()->getFileDescriptor(); + auto gmmInArgs = reinterpret_cast(args); + + gmmInArgs->FileDescriptor = this->get()->getDrm()->getFileDescriptor(); + gmmInArgs->ClientType = GMM_CLIENT::GMM_OCL_VISTA; } } // namespace NEO diff --git a/opencl/test/unit_test/linux/os_interface_linux_tests.cpp b/opencl/test/unit_test/linux/os_interface_linux_tests.cpp index fe752d854a..d20ec4dff0 100644 --- a/opencl/test/unit_test/linux/os_interface_linux_tests.cpp +++ b/opencl/test/unit_test/linux/os_interface_linux_tests.cpp @@ -34,6 +34,7 @@ TEST(OsInterfaceTest, whenOsInterfaceSetupsGmmInputArgsThenProperFileDescriptorI auto expectedFileDescriptor = drm->getFileDescriptor(); EXPECT_EQ(static_cast(expectedFileDescriptor), gmmInputArgs.FileDescriptor); + EXPECT_EQ(GMM_CLIENT::GMM_OCL_VISTA, gmmInputArgs.ClientType); } TEST(GmmHelperTest, whenCreateGmmHelperWithoutOsInterfaceThenPassedFileDescriptorIsZeroed) { @@ -45,5 +46,6 @@ TEST(GmmHelperTest, whenCreateGmmHelperWithoutOsInterfaceThenPassedFileDescripto gmmHelper.reset(new GmmHelper(nullptr, defaultHwInfo.get())); EXPECT_EQ(expectedFileDescriptor, passedInputArgs.FileDescriptor); + EXPECT_EQ(GMM_CLIENT::GMM_OCL_VISTA, passedInputArgs.ClientType); } } // namespace NEO diff --git a/opencl/test/unit_test/windows/os_interface_tests.cpp b/opencl/test/unit_test/windows/os_interface_tests.cpp index 4367108271..1b9f5cb1ef 100644 --- a/opencl/test/unit_test/windows/os_interface_tests.cpp +++ b/opencl/test/unit_test/windows/os_interface_tests.cpp @@ -18,7 +18,7 @@ TEST(osInterfaceTests, osInterfaceLocalMemoryEnabledByDefault) { EXPECT_TRUE(OSInterface::osEnableLocalMemory); } -TEST(osInterfaceTests, whenOsInterfaceSetupGmmInputArgsThenProperAdapterBDFIsSet) { +TEST(osInterfaceTests, whenOsInterfaceSetupGmmInputArgsThenArgsAreSet) { MockExecutionEnvironment executionEnvironment; RootDeviceEnvironment rootDeviceEnvironment(executionEnvironment); auto wddm = new WddmMock(rootDeviceEnvironment); @@ -33,6 +33,9 @@ TEST(osInterfaceTests, whenOsInterfaceSetupGmmInputArgsThenProperAdapterBDFIsSet GMM_INIT_IN_ARGS gmmInputArgs = {}; EXPECT_NE(0, memcmp(&adapterBDF, &gmmInputArgs.stAdapterBDF, sizeof(ADAPTER_BDF))); + rootDeviceEnvironment.osInterface->setGmmInputArgs(&gmmInputArgs); + EXPECT_EQ(0, memcmp(&adapterBDF, &gmmInputArgs.stAdapterBDF, sizeof(ADAPTER_BDF))); + EXPECT_EQ(GMM_CLIENT::GMM_OCL_VISTA, gmmInputArgs.ClientType); } diff --git a/shared/source/os_interface/windows/wddm/wddm.cpp b/shared/source/os_interface/windows/wddm/wddm.cpp index 1d852f2d62..dd69047d3e 100644 --- a/shared/source/os_interface/windows/wddm/wddm.cpp +++ b/shared/source/os_interface/windows/wddm/wddm.cpp @@ -1013,7 +1013,10 @@ void Wddm::waitOnPagingFenceFromCpu() { } void Wddm::setGmmInputArg(void *args) { - reinterpret_cast(args)->stAdapterBDF = this->adapterBDF; + auto gmmInArgs = reinterpret_cast(args); + + gmmInArgs->stAdapterBDF = this->adapterBDF; + gmmInArgs->ClientType = GMM_CLIENT::GMM_OCL_VISTA; } void Wddm::updatePagingFenceValue(uint64_t newPagingFenceValue) { diff --git a/shared/test/unit_test/os_interface/windows/gmm_helper_tests_win.cpp b/shared/test/unit_test/os_interface/windows/gmm_helper_tests_win.cpp index 9cc4056ddd..693fe6d3bc 100644 --- a/shared/test/unit_test/os_interface/windows/gmm_helper_tests_win.cpp +++ b/shared/test/unit_test/os_interface/windows/gmm_helper_tests_win.cpp @@ -25,6 +25,7 @@ TEST(GmmHelperTest, whenCreateGmmHelperWithoutOsInterfaceThenPassedAdapterBDFIsZ gmmHelper.reset(new GmmHelper(nullptr, defaultHwInfo.get())); EXPECT_EQ(0, memcmp(&expectedAdapterBDF, &passedInputArgs.stAdapterBDF, sizeof(ADAPTER_BDF))); + EXPECT_EQ(GMM_CLIENT::GMM_OCL_VISTA, passedInputArgs.ClientType); } } // namespace NEO