mirror of
https://github.com/intel/compute-runtime.git
synced 2025-11-10 05:49:51 +08:00
Update isCooperativeDispatchSupported
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
6b5a5d481e
commit
3d6d4acda2
@@ -5949,7 +5949,7 @@ cl_int CL_API_CALL clEnqueueNDCountKernelINTEL(cl_command_queue commandQueue,
|
||||
auto &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
|
||||
auto engineGroupType = hwHelper.getEngineGroupType(pCommandQueue->getGpgpuEngine().getEngineType(),
|
||||
pCommandQueue->getGpgpuEngine().getEngineUsage(), hardwareInfo);
|
||||
if (!hwHelper.isCooperativeDispatchSupported(engineGroupType)) {
|
||||
if (!hwHelper.isCooperativeDispatchSupported(engineGroupType, hardwareInfo)) {
|
||||
retVal = CL_INVALID_COMMAND_QUEUE;
|
||||
return retVal;
|
||||
}
|
||||
|
||||
@@ -1041,9 +1041,6 @@ uint32_t Kernel::getMaxWorkGroupCount(const cl_uint workDim, const size_t *local
|
||||
|
||||
auto engineGroupType = hwHelper.getEngineGroupType(commandQueue->getGpgpuEngine().getEngineType(),
|
||||
commandQueue->getGpgpuEngine().getEngineUsage(), hardwareInfo);
|
||||
if (!hwHelper.isCooperativeDispatchSupported(engineGroupType)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const auto &kernelDescriptor = kernelInfo.kernelDescriptor;
|
||||
auto dssCount = hardwareInfo.gtSystemInfo.DualSubSliceCount;
|
||||
|
||||
@@ -311,7 +311,7 @@ TEST_F(clEnqueueNDCountKernelTests, GivenQueueIncapableWhenEnqueuingNDCountKerne
|
||||
auto &hwHelper = HwHelper::get(::defaultHwInfo->platform.eRenderCoreFamily);
|
||||
auto engineGroupType = hwHelper.getEngineGroupType(pCommandQueue->getGpgpuEngine().getEngineType(),
|
||||
pCommandQueue->getGpgpuEngine().getEngineUsage(), *::defaultHwInfo);
|
||||
if (!hwHelper.isCooperativeDispatchSupported(engineGroupType)) {
|
||||
if (!hwHelper.isCooperativeDispatchSupported(engineGroupType, *::defaultHwInfo)) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
@@ -342,10 +342,10 @@ TEST_F(EnqueueKernelTest, givenKernelWhenAllArgsAreSetThenClEnqueueNDCountKernel
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
CommandQueue *pCmdQ2 = createCommandQueue(pClDevice);
|
||||
|
||||
HwHelper &hwHelper = HwHelper::get(pClDevice->getDevice().getHardwareInfo().platform.eRenderCoreFamily);
|
||||
HwHelper &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
|
||||
auto engineGroupType = hwHelper.getEngineGroupType(pCmdQ2->getGpgpuEngine().getEngineType(),
|
||||
pCmdQ2->getGpgpuEngine().getEngineUsage(), hardwareInfo);
|
||||
if (!hwHelper.isCooperativeDispatchSupported(engineGroupType)) {
|
||||
if (!hwHelper.isCooperativeDispatchSupported(engineGroupType, hardwareInfo)) {
|
||||
pCmdQ2->getGpgpuEngine().osContext = pCmdQ2->getDevice().getEngine(aub_stream::ENGINE_CCS, EngineUsage::LowPriority).osContext;
|
||||
}
|
||||
|
||||
@@ -390,10 +390,10 @@ TEST_F(EnqueueKernelTest, givenKernelWhenNotAllArgsAreSetButSetKernelArgIsCalled
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
CommandQueue *pCmdQ2 = createCommandQueue(pClDevice);
|
||||
|
||||
HwHelper &hwHelper = HwHelper::get(pClDevice->getDevice().getHardwareInfo().platform.eRenderCoreFamily);
|
||||
HwHelper &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
|
||||
auto engineGroupType = hwHelper.getEngineGroupType(pCmdQ2->getGpgpuEngine().getEngineType(),
|
||||
pCmdQ2->getGpgpuEngine().getEngineUsage(), hardwareInfo);
|
||||
if (!hwHelper.isCooperativeDispatchSupported(engineGroupType)) {
|
||||
if (!hwHelper.isCooperativeDispatchSupported(engineGroupType, hardwareInfo)) {
|
||||
pCmdQ2->getGpgpuEngine().osContext = pCmdQ2->getDevice().getEngine(aub_stream::ENGINE_CCS, EngineUsage::LowPriority).osContext;
|
||||
}
|
||||
|
||||
@@ -438,10 +438,10 @@ TEST_F(EnqueueKernelTest, givenKernelWhenSetKernelArgIsCalledForEachArgButAtLeas
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
CommandQueue *pCmdQ2 = createCommandQueue(pClDevice);
|
||||
|
||||
HwHelper &hwHelper = HwHelper::get(pClDevice->getDevice().getHardwareInfo().platform.eRenderCoreFamily);
|
||||
HwHelper &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
|
||||
auto engineGroupType = hwHelper.getEngineGroupType(pCmdQ2->getGpgpuEngine().getEngineType(),
|
||||
pCmdQ2->getGpgpuEngine().getEngineUsage(), hardwareInfo);
|
||||
if (!hwHelper.isCooperativeDispatchSupported(engineGroupType)) {
|
||||
if (!hwHelper.isCooperativeDispatchSupported(engineGroupType, hardwareInfo)) {
|
||||
pCmdQ2->getGpgpuEngine().osContext = pCmdQ2->getDevice().getEngine(aub_stream::ENGINE_CCS, EngineUsage::LowPriority).osContext;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
||||
#include "test.h"
|
||||
|
||||
#include "engine_node.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
class MockSyncBufferHandler : public SyncBufferHandler {
|
||||
@@ -69,6 +71,9 @@ class SyncBufferHandlerTest : public SyncBufferEnqueueHandlerTest {
|
||||
kernel->executionType = KernelExecutionType::Concurrent;
|
||||
commandQueue = reinterpret_cast<MockCommandQueue *>(new MockCommandQueueHw<FamilyType>(context, pClDevice, 0));
|
||||
hwHelper = &HwHelper::get(pClDevice->getHardwareInfo().platform.eRenderCoreFamily);
|
||||
if (hwHelper->isCooperativeEngineSupported(pClDevice->getHardwareInfo())) {
|
||||
commandQueue->gpgpuEngine = &pClDevice->getEngine(aub_stream::EngineType::ENGINE_CCS, EngineUsage::Cooperative);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename FamilyType>
|
||||
@@ -93,7 +98,7 @@ class SyncBufferHandlerTest : public SyncBufferEnqueueHandlerTest {
|
||||
bool isCooperativeDispatchSupported() {
|
||||
auto engineGroupType = hwHelper->getEngineGroupType(commandQueue->getGpgpuEngine().getEngineType(),
|
||||
commandQueue->getGpgpuEngine().getEngineUsage(), hardwareInfo);
|
||||
return hwHelper->isCooperativeDispatchSupported(engineGroupType);
|
||||
return hwHelper->isCooperativeDispatchSupported(engineGroupType, pDevice->getHardwareInfo());
|
||||
}
|
||||
|
||||
const cl_uint workDim = 1;
|
||||
@@ -116,9 +121,10 @@ HWTEST_TEMPLATED_F(SyncBufferHandlerTest, GivenAllocateSyncBufferPatchAndConcurr
|
||||
EXPECT_EQ(workItemsCount, syncBufferHandler->usedBufferSize);
|
||||
|
||||
commandQueue->flush();
|
||||
EXPECT_EQ(syncBufferHandler->graphicsAllocation->getTaskCount(
|
||||
pDevice->getUltCommandStreamReceiver<FamilyType>().getOsContext().getContextId()),
|
||||
pDevice->getUltCommandStreamReceiver<FamilyType>().latestSentTaskCount);
|
||||
|
||||
auto pCsr = commandQueue->getGpgpuEngine().commandStreamReceiver;
|
||||
EXPECT_EQ(syncBufferHandler->graphicsAllocation->getTaskCount(pCsr->getOsContext().getContextId()),
|
||||
static_cast<UltCommandStreamReceiver<FamilyType> *>(pCsr)->latestSentTaskCount);
|
||||
}
|
||||
|
||||
HWTEST_TEMPLATED_F(SyncBufferHandlerTest, GivenConcurrentKernelWithoutAllocateSyncBufferPatchWhenEnqueuingConcurrentKernelThenSyncBufferIsNotCreated) {
|
||||
|
||||
@@ -27,6 +27,7 @@ class MockCommandQueue : public CommandQueue {
|
||||
using CommandQueue::gpgpuEngine;
|
||||
using CommandQueue::isCopyOnly;
|
||||
using CommandQueue::obtainNewTimestampPacketNodes;
|
||||
using CommandQueue::overrideEngine;
|
||||
using CommandQueue::queueCapabilities;
|
||||
using CommandQueue::queueFamilyIndex;
|
||||
using CommandQueue::queueFamilySelected;
|
||||
|
||||
Reference in New Issue
Block a user