Use internal engine if selected for immediate list

This ensures internal for instance that the list used for the
page-fault manager uses the internal engine, rather than one
used by the application.

Change-Id: I531d5c9d31c75ea9de14ac0439a4da01c688e91b
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
Jaime Arteaga
2020-08-12 15:01:06 -07:00
committed by sys_ocldev
parent 49526b9fd0
commit 5b50575c23
2 changed files with 34 additions and 1 deletions

View File

@@ -14,6 +14,7 @@
#include "test.h"
#include "level_zero/core/source/builtin/builtin_functions_lib_impl.h"
#include "level_zero/core/source/cmdqueue/cmdqueue_imp.h"
#include "level_zero/core/source/context/context.h"
#include "level_zero/core/source/driver/driver_handle_imp.h"
#include "level_zero/core/source/image/image_hw.h"
@@ -159,6 +160,33 @@ TEST_F(CommandListCreate, givenValidPtrThenAppendMemoryPrefetchReturnsSuccess) {
ASSERT_EQ(res, ZE_RESULT_SUCCESS);
}
TEST_F(CommandListCreate, givenImmediateCommandListThenInternalEngineIsUsedIfRequested) {
const ze_command_queue_desc_t desc = {};
bool internalEngine = true;
std::unique_ptr<L0::CommandList> commandList0(CommandList::createImmediate(productFamily,
device,
&desc,
internalEngine,
false));
ASSERT_NE(nullptr, commandList0);
CommandQueueImp *cmdQueue = reinterpret_cast<CommandQueueImp *>(commandList0->cmdQImmediate);
EXPECT_EQ(cmdQueue->getCsr(), neoDevice->getInternalEngine().commandStreamReceiver);
internalEngine = false;
std::unique_ptr<L0::CommandList> commandList1(CommandList::createImmediate(productFamily,
device,
&desc,
internalEngine,
false));
ASSERT_NE(nullptr, commandList1);
cmdQueue = reinterpret_cast<CommandQueueImp *>(commandList1->cmdQImmediate);
EXPECT_NE(cmdQueue->getCsr(), neoDevice->getInternalEngine().commandStreamReceiver);
}
TEST_F(CommandListCreate, givenImmediateCommandListThenCustomNumIddPerBlockUsed) {
const ze_command_queue_desc_t desc = {};