From 1580a936b62022bb51b05b9a3366a5b00043e557 Mon Sep 17 00:00:00 2001 From: Michal Mrozek Date: Wed, 23 Oct 2019 17:16:09 +0200 Subject: [PATCH] Make sure we hint as OpenCL. Change-Id: I11b75b9e627651d9ee56ce58864cc4520ee82bfd Signed-off-by: Michal Mrozek --- runtime/os_interface/windows/wddm/wddm.cpp | 2 +- unit_tests/os_interface/windows/wddm20_tests.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/runtime/os_interface/windows/wddm/wddm.cpp b/runtime/os_interface/windows/wddm/wddm.cpp index e124858c28..80b22383ac 100644 --- a/runtime/os_interface/windows/wddm/wddm.cpp +++ b/runtime/os_interface/windows/wddm/wddm.cpp @@ -729,7 +729,7 @@ bool Wddm::createContext(OsContextWin &osContext) { CreateContext.PrivateDriverDataSize = sizeof(PrivateData); CreateContext.NodeOrdinal = WddmEngineMapper::engineNodeMap(osContext.getEngineType()); CreateContext.pPrivateDriverData = &PrivateData; - CreateContext.ClientHint = D3DKMT_CLIENTHINT_OPENGL; + CreateContext.ClientHint = D3DKMT_CLIENTHINT_OPENCL; CreateContext.hDevice = device; status = gdi->createContext(&CreateContext); diff --git a/unit_tests/os_interface/windows/wddm20_tests.cpp b/unit_tests/os_interface/windows/wddm20_tests.cpp index 17d14960ac..3c5f1ce53f 100644 --- a/unit_tests/os_interface/windows/wddm20_tests.cpp +++ b/unit_tests/os_interface/windows/wddm20_tests.cpp @@ -565,6 +565,12 @@ TEST_F(Wddm20WithMockGdiDllTestsWithoutWddmInit, givenUseNoRingFlushesKmdModeDeb EXPECT_FALSE(!!privateData->NoRingFlushes); } +TEST_F(Wddm20WithMockGdiDllTestsWithoutWddmInit, givenCreateContextCallWhenDriverHintsItPointsToOpenCL) { + init(); + auto createContextParams = this->getCreateContextDataFcn(); + EXPECT_EQ(D3DKMT_CLIENTHINT_OPENCL, createContextParams->ClientHint); +} + TEST_F(Wddm20WithMockGdiDllTestsWithoutWddmInit, givenUseNoRingFlushesKmdModeDebugFlagToTrueWhenCreateContextIsCalledThenNoRingFlushesKmdModeIsSetToTrue) { DebugManagerStateRestore dbgRestore; DebugManager.flags.UseNoRingFlushesKmdMode.set(true);