Add CMake flag to control device enqueue

Change-Id: Ia2ba2c5437adeca2c0335f5a2ffd28a6a2881a2a
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
Related-To: NEO-2942
This commit is contained in:
Maciej Dziuban
2019-07-15 15:08:42 +02:00
committed by sys_ocldev
parent a060bd2c5d
commit 7c30e1ed4a
28 changed files with 210 additions and 138 deletions

View File

@ -134,6 +134,8 @@ set(SUPPORT_PLATFORM_DEFAULT TRUE CACHE BOOL "default value for support platform
macro(SET_FLAGS_FOR GEN_TYPE)
set(SUPPORT_${GEN_TYPE} ${SUPPORT_GEN_DEFAULT} CACHE BOOL "Support ${GEN_TYPE} devices")
set(TESTS_${GEN_TYPE} ${SUPPORT_${GEN_TYPE}} CACHE BOOL "Build ULTs for ${GEN_TYPE} devices")
set(SUPPORT_DEVICE_ENQUEUE_${GEN_TYPE} TRUE CACHE BOOL "Support ${GEN_TYPE} for device side enqueue")
if(NOT SUPPORT_${GEN_TYPE} OR SKIP_UNIT_TESTS)
set(TESTS_${GEN_TYPE} FALSE)
endif()

View File

@ -15,13 +15,10 @@ set(RUNTIME_SRCS_GENX_CPP_LINUX
set(RUNTIME_SRCS_GENX_H_BASE
aub_mapper.h
device_enqueue.h
hw_cmds.h
hw_cmds_generated.h
hw_info.h
reg_configs.h
scheduler_definitions.h
scheduler_igdrcl_built_in.inl
)
set(RUNTIME_SRCS_GENX_CPP_BASE
@ -82,6 +79,12 @@ macro(macro_for_each_gen)
list(APPEND RUNTIME_SRCS_${GEN_TYPE}_H_BASE "${GENX_PREFIX}/hw_info_${GEN_TYPE_LOWER}.h")
endif()
if(${SUPPORT_DEVICE_ENQUEUE_${GEN_TYPE}})
list(APPEND RUNTIME_SRCS_${GEN_TYPE}_H_BASE ${GENX_PREFIX}/device_enqueue.h)
list(APPEND RUNTIME_SRCS_${GEN_TYPE}_H_BASE ${GENX_PREFIX}/scheduler_definitions.h)
list(APPEND RUNTIME_SRCS_${GEN_TYPE}_H_BASE ${GENX_PREFIX}/scheduler_igdrcl_built_in.inl)
endif()
foreach(OS_IT "BASE" "WINDOWS" "LINUX")
foreach(SRC_IT ${RUNTIME_SRCS_GENX_CPP_${OS_IT}})
list(APPEND RUNTIME_SRCS_${GEN_TYPE}_CPP_${OS_IT} ${GENX_PREFIX}/${SRC_IT}_${GEN_TYPE_LOWER}.cpp)

View File

@ -66,7 +66,8 @@ const RuntimeCapabilityTable ICLLP::capabilityTable{
true, // sourceLevelDebuggerSupported
true, // supportsVme
false, // supportCacheFlushAfterWalker
true // supportsImages
true, // supportsImages
true // supportsDeviceEnqueue
};
WorkaroundTable ICLLP::workaroundTable = {};

View File

@ -65,7 +65,8 @@ const RuntimeCapabilityTable LKF::capabilityTable{
true, // sourceLevelDebuggerSupported
false, // supportsVme
false, // supportCacheFlushAfterWalker
true // supportsImages
true, // supportsImages
true // supportsDeviceEnqueue
};
WorkaroundTable LKF::workaroundTable = {};

View File

@ -70,7 +70,8 @@ const RuntimeCapabilityTable BDW::capabilityTable{
false, // sourceLevelDebuggerSupported
true, // supportsVme
false, // supportCacheFlushAfterWalker
true // supportsImages
true, // supportsImages
true // supportsDeviceEnqueue
};
WorkaroundTable BDW::workaroundTable = {};

View File

@ -67,7 +67,8 @@ const RuntimeCapabilityTable BXT::capabilityTable{
true, // sourceLevelDebuggerSupported
true, // supportsVme
false, // supportCacheFlushAfterWalker
true // supportsImages
true, // supportsImages
false // supportsDeviceEnqueue
};
WorkaroundTable BXT::workaroundTable = {};

View File

@ -62,7 +62,8 @@ const RuntimeCapabilityTable CFL::capabilityTable{
true, // sourceLevelDebuggerSupported
true, // supportsVme
false, // supportCacheFlushAfterWalker
true // supportsImages
true, // supportsImages
true // supportsDeviceEnqueue
};
WorkaroundTable CFL::workaroundTable = {};

View File

@ -62,7 +62,8 @@ const RuntimeCapabilityTable GLK::capabilityTable{
true, // sourceLevelDebuggerSupported
true, // supportsVme
false, // supportCacheFlushAfterWalker
true // supportsImages
true, // supportsImages
false // supportsDeviceEnqueue
};
WorkaroundTable GLK::workaroundTable = {};

View File

@ -62,7 +62,8 @@ const RuntimeCapabilityTable KBL::capabilityTable{
true, // sourceLevelDebuggerSupported
true, // supportsVme
false, // supportCacheFlushAfterWalker
true // supportsImages
true, // supportsImages
true // supportsDeviceEnqueue
};
WorkaroundTable KBL::workaroundTable = {};

View File

@ -70,7 +70,8 @@ const RuntimeCapabilityTable SKL::capabilityTable{
true, // sourceLevelDebuggerSupported
true, // supportsVme
false, // supportCacheFlushAfterWalker
true // supportsImages
true, // supportsImages
true // supportsDeviceEnqueue
};
WorkaroundTable SKL::workaroundTable = {};
FeatureTable SKL::featureTable = {};

View File

@ -55,6 +55,7 @@ struct RuntimeCapabilityTable {
bool supportsVme;
bool supportCacheFlushAfterWalker;
bool supportsImages;
bool supportsDeviceEnqueue;
};
struct HardwareCapabilities {

View File

@ -56,7 +56,7 @@ endfunction()
macro(macro_for_each_gen)
foreach(PLATFORM_TYPE "CORE" "LP")
if(${GEN_TYPE}_HAS_${PLATFORM_TYPE})
if(${GEN_TYPE}_HAS_${PLATFORM_TYPE} AND SUPPORT_DEVICE_ENQUEUE_${GEN_TYPE})
get_family_name_with_type(${GEN_TYPE} ${PLATFORM_TYPE})
set(PLATFORM_2_0_LOWER ${DEFAULT_SUPPORTED_2_0_${GEN_TYPE}_${PLATFORM_TYPE}_PLATFORM})
if(COMPILE_BUILT_INS AND PLATFORM_2_0_LOWER)

View File

@ -13,6 +13,7 @@
#include "runtime/helpers/base_object.h"
#include "runtime/os_interface/os_context.h"
#include "unit_tests/fixtures/memory_management_fixture.h"
#include "unit_tests/helpers/unit_test_helper.h"
#include "unit_tests/mocks/mock_context.h"
#include "CL/cl_ext.h"
@ -74,8 +75,13 @@ TEST_P(clCreateCommandQueueWithPropertiesTests, GivenPropertiesWhenCreatingComma
CL_QUEUE_THROTTLE_KHR, CL_QUEUE_THROTTLE_MED_KHR,
0};
auto minimumCreateDeviceQueueFlags = static_cast<cl_command_queue_properties>(CL_QUEUE_ON_DEVICE |
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE);
const auto minimumCreateDeviceQueueFlags = static_cast<cl_command_queue_properties>(CL_QUEUE_ON_DEVICE |
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE);
const auto deviceQueueShouldBeCreated = (commandQueueProperties & minimumCreateDeviceQueueFlags) == minimumCreateDeviceQueueFlags;
if (deviceQueueShouldBeCreated && !castToObject<Device>(this->devices[0])->getHardwareInfo().capabilityTable.supportsDeviceEnqueue) {
return;
}
bool queueOnDeviceUsed = false;
bool priorityHintsUsed = false;
bool throttleHintsUsed = false;
@ -126,7 +132,7 @@ TEST_P(clCreateCommandQueueWithPropertiesTests, GivenPropertiesWhenCreatingComma
auto deviceQueueObj = castToObject<DeviceQueue>(deviceQ);
auto commandQueueObj = castToObject<CommandQueue>(cmdQ);
if ((commandQueueProperties & minimumCreateDeviceQueueFlags) == minimumCreateDeviceQueueFlags) { // created device queue
if (deviceQueueShouldBeCreated) { // created device queue
ASSERT_NE(deviceQueueObj, nullptr);
ASSERT_EQ(commandQueueObj, nullptr);
} else { // created host queue
@ -255,7 +261,7 @@ TEST_F(clCreateCommandQueueWithPropertiesApi, GivenDefaultDeviceQueueWithoutQueu
EXPECT_EQ(retVal, CL_INVALID_VALUE);
}
TEST_F(clCreateCommandQueueWithPropertiesApi, GivenNumberOfDevicesGreaterThanMaxWhenCreatingCommandQueueWithPropertiesThenOutOfResourcesErrorIsReturned) {
HWCMDTEST_F(IGFX_GEN8_CORE, clCreateCommandQueueWithPropertiesApi, GivenNumberOfDevicesGreaterThanMaxWhenCreatingCommandQueueWithPropertiesThenOutOfResourcesErrorIsReturned) {
cl_int retVal = CL_SUCCESS;
auto pDevice = castToObject<Device>(devices[0]);
cl_queue_properties odq[] = {CL_QUEUE_PROPERTIES, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE, 0, 0};
@ -279,7 +285,7 @@ TEST_F(clCreateCommandQueueWithPropertiesApi, GivenNumberOfDevicesGreaterThanMax
}
}
TEST_F(clCreateCommandQueueWithPropertiesApi, GivenFailedAllocationWhenCreatingCommandQueueWithPropertiesThenOutOfHostMemoryErrorIsReturned) {
HWCMDTEST_F(IGFX_GEN8_CORE, clCreateCommandQueueWithPropertiesApi, GivenFailedAllocationWhenCreatingCommandQueueWithPropertiesThenOutOfHostMemoryErrorIsReturned) {
InjectedFunction method = [this](size_t failureIndex) {
cl_queue_properties ooq[] = {CL_QUEUE_PROPERTIES, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE | CL_QUEUE_ON_DEVICE_DEFAULT, 0, 0};
auto retVal = CL_INVALID_VALUE;

View File

@ -7,10 +7,13 @@
#include "runtime/context/context.h"
#include "unit_tests/fixtures/device_host_queue_fixture.h"
#include "unit_tests/helpers/unit_test_helper.h"
#include "unit_tests/mocks/mock_kernel.h"
#include "cl_api_tests.h"
#include <type_traits>
using namespace NEO;
namespace DeviceHostQueue {
typedef ::testing::Types<CommandQueue, DeviceQueue> QueueTypes;
@ -21,6 +24,10 @@ class clReleaseCommandQueueTypeTests : public DeviceHostQueueFixture<T> {};
TYPED_TEST_CASE(clReleaseCommandQueueTypeTests, QueueTypes);
TYPED_TEST(clReleaseCommandQueueTypeTests, GivenValidCmdQueueWhenReleasingCmdQueueThenSucessIsReturned) {
if (std::is_same<TypeParam, DeviceQueue>::value && !castToObject<Device>(this->devices[0])->getHardwareInfo().capabilityTable.supportsDeviceEnqueue) {
return;
}
using BaseType = typename TypeParam::BaseType;
auto queue = this->createClQueue();

View File

@ -7,6 +7,7 @@
#include "runtime/context/context.h"
#include "unit_tests/fixtures/device_host_queue_fixture.h"
#include "unit_tests/helpers/unit_test_helper.h"
using namespace NEO;
namespace DeviceHostQueue {
@ -18,6 +19,10 @@ class clRetainReleaseCommandQueueTests : public DeviceHostQueueFixture<T> {};
TYPED_TEST_CASE(clRetainReleaseCommandQueueTests, QueueTypes);
TYPED_TEST(clRetainReleaseCommandQueueTests, retain_release) {
if (std::is_same<TypeParam, DeviceQueue>::value && !castToObject<Device>(this->devices[0])->getHardwareInfo().capabilityTable.supportsDeviceEnqueue) {
return;
}
using BaseType = typename TypeParam::BaseType;
auto queue = this->createClQueue();

View File

@ -40,14 +40,14 @@ struct clSetDefaultDeviceCommandQueueApiTest : public api_tests {
cl_command_queue deviceQueue = nullptr;
};
TEST_F(clSetDefaultDeviceCommandQueueApiTest, SetDefaultDeviceQueue_returnsSuccess) {
HWCMDTEST_F(IGFX_GEN8_CORE, clSetDefaultDeviceCommandQueueApiTest, SetDefaultDeviceQueue_returnsSuccess) {
retVal = clSetDefaultDeviceCommandQueue(pContext, devices[0], deviceQueue);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(static_cast<_device_queue *>(deviceQueue), static_cast<_device_queue *>(pContext->getDefaultDeviceQueue()));
}
TEST_F(clSetDefaultDeviceCommandQueueApiTest, ReplaceDefaultDeviceQueue_returnsSuccess) {
HWCMDTEST_F(IGFX_GEN8_CORE, clSetDefaultDeviceCommandQueueApiTest, ReplaceDefaultDeviceQueue_returnsSuccess) {
cl_queue_properties properties[] = {CL_QUEUE_PROPERTIES,
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE,
0,
@ -68,22 +68,22 @@ TEST_F(clSetDefaultDeviceCommandQueueApiTest, ReplaceDefaultDeviceQueue_returnsS
}
}
TEST_F(clSetDefaultDeviceCommandQueueApiTest, NullContext_returnsError) {
HWCMDTEST_F(IGFX_GEN8_CORE, clSetDefaultDeviceCommandQueueApiTest, NullContext_returnsError) {
retVal = clSetDefaultDeviceCommandQueue(nullptr, devices[0], deviceQueue);
ASSERT_EQ(CL_INVALID_CONTEXT, retVal);
}
TEST_F(clSetDefaultDeviceCommandQueueApiTest, NullDevice_returnsError) {
HWCMDTEST_F(IGFX_GEN8_CORE, clSetDefaultDeviceCommandQueueApiTest, NullDevice_returnsError) {
retVal = clSetDefaultDeviceCommandQueue(pContext, nullptr, deviceQueue);
ASSERT_EQ(CL_INVALID_DEVICE, retVal);
}
TEST_F(clSetDefaultDeviceCommandQueueApiTest, NullDeviceQueue_returnsError) {
HWCMDTEST_F(IGFX_GEN8_CORE, clSetDefaultDeviceCommandQueueApiTest, NullDeviceQueue_returnsError) {
retVal = clSetDefaultDeviceCommandQueue(pContext, devices[0], nullptr);
ASSERT_EQ(CL_INVALID_COMMAND_QUEUE, retVal);
}
TEST_F(clSetDefaultDeviceCommandQueueApiTest, HostDeviceQueue_returnsError) {
HWCMDTEST_F(IGFX_GEN8_CORE, clSetDefaultDeviceCommandQueueApiTest, HostDeviceQueue_returnsError) {
cl_queue_properties properties[] = {CL_QUEUE_PROPERTIES, 0, 0, 0};
cl_command_queue hostQueue = clCreateCommandQueueWithProperties(pContext, devices[0], properties, &retVal);
ASSERT_NE(nullptr, hostQueue);
@ -96,7 +96,7 @@ TEST_F(clSetDefaultDeviceCommandQueueApiTest, HostDeviceQueue_returnsError) {
EXPECT_EQ(CL_SUCCESS, retVal);
}
TEST_F(clSetDefaultDeviceCommandQueueApiTest, DeviceQueueCtx2_returnsError) {
HWCMDTEST_F(IGFX_GEN8_CORE, clSetDefaultDeviceCommandQueueApiTest, DeviceQueueCtx2_returnsError) {
auto context2 = clCreateContext(nullptr, num_devices, devices, nullptr, nullptr, &retVal);
ASSERT_EQ(CL_SUCCESS, retVal);
cl_queue_properties properties[] = {CL_QUEUE_PROPERTIES,

View File

@ -632,7 +632,7 @@ TEST_F(BuiltInTests, BuiltinDispatchInfoBuilderGetBuilderForUnknownBuiltInOp) {
EXPECT_TRUE(caughtException);
}
TEST_F(BuiltInTests, getSchedulerKernel) {
HWCMDTEST_F(IGFX_GEN8_CORE, BuiltInTests, getSchedulerKernel) {
if (pDevice->getSupportedClVersion() >= 20) {
Context &context = *pContext;
SchedulerKernel &schedulerKernel = pBuiltIns->getSchedulerKernel(context);
@ -641,7 +641,7 @@ TEST_F(BuiltInTests, getSchedulerKernel) {
}
}
HWTEST_F(BuiltInTests, getSchedulerKernelForSecondTimeDoesNotCreateNewKernel) {
HWCMDTEST_F(IGFX_GEN8_CORE, BuiltInTests, getSchedulerKernelForSecondTimeDoesNotCreateNewKernel) {
if (pDevice->getSupportedClVersion() >= 20) {
Context &context = *pContext;
SchedulerKernel &schedulerKernel = pBuiltIns->getSchedulerKernel(context);
@ -1044,11 +1044,14 @@ TEST_F(BuiltInTests, getBuiltinResourcesForTypeSource) {
EXPECT_NE(0u, mockBuiltinsLib->getBuiltinResource(EBuiltInOps::VmeBlockMotionEstimateIntel, BuiltinCode::ECodeType::Source, *pDevice).size());
EXPECT_NE(0u, mockBuiltinsLib->getBuiltinResource(EBuiltInOps::VmeBlockAdvancedMotionEstimateCheckIntel, BuiltinCode::ECodeType::Source, *pDevice).size());
EXPECT_NE(0u, mockBuiltinsLib->getBuiltinResource(EBuiltInOps::VmeBlockAdvancedMotionEstimateBidirectionalCheckIntel, BuiltinCode::ECodeType::Source, *pDevice).size());
EXPECT_EQ(0u, mockBuiltinsLib->getBuiltinResource(EBuiltInOps::Scheduler, BuiltinCode::ECodeType::Source, *pDevice).size());
EXPECT_EQ(0u, mockBuiltinsLib->getBuiltinResource(EBuiltInOps::COUNT, BuiltinCode::ECodeType::Source, *pDevice).size());
if (pDevice->getHardwareInfo().capabilityTable.supportsDeviceEnqueue) {
EXPECT_EQ(0u, mockBuiltinsLib->getBuiltinResource(EBuiltInOps::Scheduler, BuiltinCode::ECodeType::Source, *pDevice).size());
}
}
TEST_F(BuiltInTests, getBuiltinResourcesForTypeBinary) {
HWCMDTEST_F(IGFX_GEN8_CORE, BuiltInTests, getBuiltinResourcesForTypeBinary) {
class MockBuiltinsLib : BuiltinsLib {
public:
BuiltinResourceT getBuiltinResource(EBuiltInOps::Type builtin, BuiltinCode::ECodeType requestedCodeType, Device &device) {

View File

@ -25,7 +25,7 @@
using namespace NEO;
using namespace DeviceHostQueue;
HWTEST_F(DeviceQueueHwTest, resetOnlyExpected) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueHwTest, resetOnlyExpected) {
// profiling disabled
deviceQueue = createQueueObject();
ASSERT_NE(deviceQueue, nullptr);
@ -54,7 +54,7 @@ HWTEST_F(DeviceQueueHwTest, resetOnlyExpected) {
delete deviceQueue;
}
HWTEST_F(DeviceQueueHwTest, resetStack) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueHwTest, resetStack) {
deviceQueue = createQueueObject();
ASSERT_NE(deviceQueue, nullptr);
auto deviceQueueHw = castToHwType<FamilyType>(deviceQueue);
@ -67,7 +67,7 @@ HWTEST_F(DeviceQueueHwTest, resetStack) {
delete deviceQueue;
}
HWTEST_F(DeviceQueueHwTest, acquireEMCriticalSectionDoesNotAcquireWhenNullHardwareIsEnabled) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueHwTest, acquireEMCriticalSectionDoesNotAcquireWhenNullHardwareIsEnabled) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableNullHardware.set(1);
@ -411,7 +411,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueSlb, AddEMCleanupSectionWithProfiling) {
delete mockDeviceQueueHw;
}
HWTEST_F(DeviceQueueHwTest, getIndirectHeapDSH) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueHwTest, getIndirectHeapDSH) {
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
deviceQueue = createQueueObject();
@ -438,7 +438,7 @@ HWTEST_F(DeviceQueueHwTest, getIndirectHeapDSH) {
delete deviceQueue;
}
HWTEST_F(DeviceQueueHwTest, getIndirectHeapNonExistent) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueHwTest, getIndirectHeapNonExistent) {
deviceQueue = createQueueObject();
ASSERT_NE(deviceQueue, nullptr);
auto *devQueueHw = castToObject<DeviceQueueHw<FamilyType>>(deviceQueue);
@ -450,7 +450,7 @@ HWTEST_F(DeviceQueueHwTest, getIndirectHeapNonExistent) {
delete deviceQueue;
}
HWTEST_F(DeviceQueueHwTest, getDshOffset) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueHwTest, getDshOffset) {
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
deviceQueue = createQueueObject();
@ -497,7 +497,7 @@ class DeviceQueueHwWithKernel : public ExecutionModelKernelFixture {
MockContext *context;
};
HWTEST_P(DeviceQueueHwWithKernel, setupIndirectState) {
HWCMDTEST_P(IGFX_GEN8_CORE, DeviceQueueHwWithKernel, setupIndirectState) {
if (std::string(pPlatform->getDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
EXPECT_TRUE(pKernel->isParentKernel);
@ -528,7 +528,7 @@ HWTEST_P(DeviceQueueHwWithKernel, setupIndirectState) {
}
}
HWTEST_P(DeviceQueueHwWithKernel, setupIndirectStateSetsCorrectStartBlockID) {
HWCMDTEST_P(IGFX_GEN8_CORE, DeviceQueueHwWithKernel, setupIndirectStateSetsCorrectStartBlockID) {
if (std::string(pPlatform->getDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
EXPECT_TRUE(pKernel->isParentKernel);

View File

@ -16,7 +16,9 @@
using namespace NEO;
using namespace DeviceHostQueue;
TEST(DeviceQueueSimpleTest, setupExecutionModelDispatchDoesNothing) {
using DeviceQueueSimpleTest = ::testing::Test;
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueSimpleTest, setupExecutionModelDispatchDoesNothing) {
DeviceQueue devQueue;
char buffer[20];
@ -34,7 +36,7 @@ TEST(DeviceQueueSimpleTest, setupExecutionModelDispatchDoesNothing) {
}
}
TEST(DeviceQueueSimpleTest, nonUsedBaseMethods) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueSimpleTest, nonUsedBaseMethods) {
DeviceQueue devQueue;
devQueue.resetDeviceQueue();
EXPECT_EQ(nullptr, devQueue.getIndirectHeap(IndirectHeap::DYNAMIC_STATE));
@ -64,7 +66,7 @@ class DeviceQueueTest : public DeviceHostQueueFixture<DeviceQueue> {
Device *device;
};
TEST_F(DeviceQueueTest, createDeviceQueueWhenNoDeviceQueueIsSupported) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, createDeviceQueueWhenNoDeviceQueueIsSupported) {
auto maxOnDeviceQueues = device->getDeviceInfo().maxOnDeviceQueues;
const_cast<DeviceInfo *>(&device->getDeviceInfo())->maxOnDeviceQueues = 0;
@ -74,7 +76,7 @@ TEST_F(DeviceQueueTest, createDeviceQueueWhenNoDeviceQueueIsSupported) {
const_cast<DeviceInfo *>(&device->getDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues;
}
TEST_F(DeviceQueueTest, createDeviceQueuesWhenSingleDeviceQueueIsSupported) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, createDeviceQueuesWhenSingleDeviceQueueIsSupported) {
auto maxOnDeviceQueues = device->getDeviceInfo().maxOnDeviceQueues;
const_cast<DeviceInfo *>(&device->getDeviceInfo())->maxOnDeviceQueues = 1;
@ -90,7 +92,7 @@ TEST_F(DeviceQueueTest, createDeviceQueuesWhenSingleDeviceQueueIsSupported) {
const_cast<DeviceInfo *>(&device->getDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues;
}
TEST_F(DeviceQueueTest, createDeviceQueuesWhenMultipleDeviceQueuesAreSupported) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, createDeviceQueuesWhenMultipleDeviceQueuesAreSupported) {
auto maxOnDeviceQueues = device->getDeviceInfo().maxOnDeviceQueues;
const_cast<DeviceInfo *>(&device->getDeviceInfo())->maxOnDeviceQueues = 2;
@ -112,7 +114,7 @@ TEST_F(DeviceQueueTest, createDeviceQueuesWhenMultipleDeviceQueuesAreSupported)
typedef DeviceQueueTest DeviceQueueBuffer;
TEST_F(DeviceQueueBuffer, setPrefferedSizeWhenNoPropertyGiven) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueBuffer, setPrefferedSizeWhenNoPropertyGiven) {
auto &deviceInfo = device->getDeviceInfo();
deviceQueue = createQueueObject(); // only minimal properties
ASSERT_NE(deviceQueue, nullptr);
@ -120,7 +122,7 @@ TEST_F(DeviceQueueBuffer, setPrefferedSizeWhenNoPropertyGiven) {
deviceQueue->release();
}
TEST_F(DeviceQueueBuffer, setPrefferedSizeWhenInvalidPropertyGiven) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueBuffer, setPrefferedSizeWhenInvalidPropertyGiven) {
cl_queue_properties properties[5] = {CL_QUEUE_PROPERTIES, deviceQueueProperties::minimumProperties[1],
CL_QUEUE_SIZE, 0, 0};
auto &deviceInfo = device->getDeviceInfo();
@ -137,7 +139,7 @@ TEST_F(DeviceQueueBuffer, setPrefferedSizeWhenInvalidPropertyGiven) {
delete deviceQueue;
}
TEST_F(DeviceQueueBuffer, setValidQueueSize) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueBuffer, setValidQueueSize) {
auto &deviceInfo = device->getDeviceInfo();
cl_uint validSize = deviceInfo.queueOnDevicePreferredSize - 1;
cl_queue_properties properties[5] = {CL_QUEUE_PROPERTIES, deviceQueueProperties::minimumProperties[1],
@ -152,7 +154,7 @@ TEST_F(DeviceQueueBuffer, setValidQueueSize) {
delete deviceQueue;
}
TEST_F(DeviceQueueBuffer, initValues) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueBuffer, initValues) {
auto &deviceInfo = device->getDeviceInfo();
deviceQueue = createQueueObject();
@ -177,7 +179,7 @@ TEST_F(DeviceQueueBuffer, initValues) {
typedef DeviceQueueTest DeviceQueueStackBuffer;
TEST_F(DeviceQueueStackBuffer, allocateResourcesZeroesStackBufferAndQueueStorage) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueStackBuffer, allocateResourcesZeroesStackBufferAndQueueStorage) {
deviceQueue = createQueueObject();
ASSERT_NE(deviceQueue, nullptr);
@ -186,7 +188,7 @@ TEST_F(DeviceQueueStackBuffer, allocateResourcesZeroesStackBufferAndQueueStorage
delete deviceQueue;
}
TEST_F(DeviceQueueStackBuffer, initAllocation) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueStackBuffer, initAllocation) {
deviceQueue = createQueueObject();
ASSERT_NE(deviceQueue, nullptr);
@ -202,7 +204,7 @@ TEST_F(DeviceQueueStackBuffer, initAllocation) {
typedef DeviceQueueTest DeviceQueueStorageBuffer;
TEST_F(DeviceQueueStorageBuffer, initAllocation) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueStorageBuffer, initAllocation) {
deviceQueue = createQueueObject();
ASSERT_NE(deviceQueue, nullptr);
@ -216,7 +218,7 @@ TEST_F(DeviceQueueStorageBuffer, initAllocation) {
typedef DeviceQueueTest DefaultDeviceQueue;
TEST_F(DefaultDeviceQueue, createOnlyOneDefaultDeviceQueueWhenSingleDeviceQueueIsSupported) {
HWCMDTEST_F(IGFX_GEN8_CORE, DefaultDeviceQueue, createOnlyOneDefaultDeviceQueueWhenSingleDeviceQueueIsSupported) {
cl_queue_properties properties[] = {CL_QUEUE_PROPERTIES, CL_QUEUE_ON_DEVICE_DEFAULT, 0, 0, 0};
auto maxOnDeviceQueues = device->getDeviceInfo().maxOnDeviceQueues;
@ -242,7 +244,7 @@ TEST_F(DefaultDeviceQueue, createOnlyOneDefaultDeviceQueueWhenSingleDeviceQueueI
const_cast<DeviceInfo *>(&device->getDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues;
}
TEST_F(DefaultDeviceQueue, createOnlyOneDefaultDeviceQueueWhenMultipleDeviceQueuesAreSupported) {
HWCMDTEST_F(IGFX_GEN8_CORE, DefaultDeviceQueue, createOnlyOneDefaultDeviceQueueWhenMultipleDeviceQueuesAreSupported) {
cl_queue_properties properties[] = {CL_QUEUE_PROPERTIES, CL_QUEUE_ON_DEVICE_DEFAULT, 0, 0, 0};
auto maxOnDeviceQueues = device->getDeviceInfo().maxOnDeviceQueues;
@ -270,7 +272,7 @@ TEST_F(DefaultDeviceQueue, createOnlyOneDefaultDeviceQueueWhenMultipleDeviceQueu
typedef DeviceQueueTest DeviceQueueEventPool;
TEST_F(DeviceQueueEventPool, poolBufferSize) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueEventPool, poolBufferSize) {
auto &deviceInfo = device->getDeviceInfo();
// number of events + event pool representation
@ -287,7 +289,7 @@ TEST_F(DeviceQueueEventPool, poolBufferSize) {
delete deviceQueue;
}
TEST_F(DeviceQueueTest, sizeOfDshBuffer) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, sizeOfDshBuffer) {
deviceQueue = createQueueObject();
ASSERT_NE(deviceQueue, nullptr);
@ -298,7 +300,7 @@ TEST_F(DeviceQueueTest, sizeOfDshBuffer) {
delete deviceQueue;
}
TEST_F(DeviceQueueTest, dispatchScheduler) {
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, dispatchScheduler) {
DeviceQueue devQueue;
MockContext context;
MockProgram program(*device->getExecutionEnvironment());
@ -310,28 +312,3 @@ TEST_F(DeviceQueueTest, dispatchScheduler) {
devQueue.dispatchScheduler(cmdStream, *kernel, device->getPreemptionMode(), nullptr, nullptr);
delete kernel;
}
class DeviceQueueUnderTest : public DeviceQueue {
public:
DeviceQueueUnderTest() : DeviceQueue(){};
void verifyConstructor() {
EXPECT_EQ(nullptr, context);
EXPECT_EQ(nullptr, device);
EXPECT_EQ(0u, commandQueueProperties);
EXPECT_EQ(0u, queueSize);
EXPECT_EQ(nullptr, queueBuffer);
EXPECT_EQ(nullptr, eventPoolBuffer);
EXPECT_EQ(nullptr, slbBuffer);
EXPECT_EQ(nullptr, stackBuffer);
EXPECT_EQ(nullptr, queueStorageBuffer);
EXPECT_EQ(nullptr, dshBuffer);
EXPECT_EQ(nullptr, debugQueue);
EXPECT_EQ(nullptr, debugData);
}
};
TEST(DeviceQueue, GivenDeviceQueueWhenCreatedThenProperlyInitialized) {
DeviceQueueUnderTest deviceQueue;
deviceQueue.verifyConstructor();
}

View File

@ -30,7 +30,7 @@ class GetDeviceQueueInfoTest : public DeviceHostQueueFixture<DeviceQueue> {
DeviceQueue *deviceQueue;
};
TEST_F(GetDeviceQueueInfoTest, context) {
HWCMDTEST_F(IGFX_GEN8_CORE, GetDeviceQueueInfoTest, context) {
cl_context contextReturned = nullptr;
retVal = deviceQueue->getCommandQueueInfo(
@ -42,7 +42,7 @@ TEST_F(GetDeviceQueueInfoTest, context) {
EXPECT_EQ((cl_context)pContext, contextReturned);
}
TEST_F(GetDeviceQueueInfoTest, device) {
HWCMDTEST_F(IGFX_GEN8_CORE, GetDeviceQueueInfoTest, device) {
cl_device_id deviceExpected = devices[0];
cl_device_id deviceIdReturned = nullptr;
@ -55,7 +55,7 @@ TEST_F(GetDeviceQueueInfoTest, device) {
EXPECT_EQ(deviceExpected, deviceIdReturned);
}
TEST_F(GetDeviceQueueInfoTest, queueProperties) {
HWCMDTEST_F(IGFX_GEN8_CORE, GetDeviceQueueInfoTest, queueProperties) {
cl_command_queue_properties propertiesReturned = 0;
retVal = deviceQueue->getCommandQueueInfo(
@ -67,7 +67,7 @@ TEST_F(GetDeviceQueueInfoTest, queueProperties) {
EXPECT_EQ(deviceQueueProperties::allProperties[1], propertiesReturned);
}
TEST_F(GetDeviceQueueInfoTest, queueSize) {
HWCMDTEST_F(IGFX_GEN8_CORE, GetDeviceQueueInfoTest, queueSize) {
cl_uint queueSizeReturned = 0;
retVal = deviceQueue->getCommandQueueInfo(
@ -80,7 +80,7 @@ TEST_F(GetDeviceQueueInfoTest, queueSize) {
}
// OCL 2.1
TEST_F(GetDeviceQueueInfoTest, queueDeviceDefault) {
HWCMDTEST_F(IGFX_GEN8_CORE, GetDeviceQueueInfoTest, queueDeviceDefault) {
cl_command_queue commandQueueReturned = nullptr;
retVal = deviceQueue->getCommandQueueInfo(
@ -94,11 +94,11 @@ TEST_F(GetDeviceQueueInfoTest, queueDeviceDefault) {
EXPECT_EQ(deviceQueue, commandQueueReturned);
}
TEST_F(GetDeviceQueueInfoTest, profiling) {
HWCMDTEST_F(IGFX_GEN8_CORE, GetDeviceQueueInfoTest, profiling) {
EXPECT_TRUE(deviceQueue->isProfilingEnabled());
}
TEST_F(GetDeviceQueueInfoTest, invalidParameter) {
HWCMDTEST_F(IGFX_GEN8_CORE, GetDeviceQueueInfoTest, invalidParameter) {
uint32_t tempValue = 0;
retVal = deviceQueue->getCommandQueueInfo(

View File

@ -102,7 +102,7 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueu
}
}
HWTEST_P(ParentKernelEnqueueTest, GivenBlockKernelWithPrivateSurfaceWhenParentKernelIsEnqueuedThenPrivateSurfaceIsMadeResident) {
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlockKernelWithPrivateSurfaceWhenParentKernelIsEnqueuedThenPrivateSurfaceIsMadeResident) {
if (pDevice->getSupportedClVersion() >= 20) {
size_t offset[3] = {0, 0, 0};
size_t gws[3] = {1, 1, 1};
@ -122,7 +122,7 @@ HWTEST_P(ParentKernelEnqueueTest, GivenBlockKernelWithPrivateSurfaceWhenParentKe
}
}
HWTEST_P(ParentKernelEnqueueTest, GivenBlocksWithPrivateMemoryWhenEnqueueKernelThatIsBlockedByUserEventIsCalledThenPrivateAllocationIsMadeResidentWhenEventUnblocks) {
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlocksWithPrivateMemoryWhenEnqueueKernelThatIsBlockedByUserEventIsCalledThenPrivateAllocationIsMadeResidentWhenEventUnblocks) {
if (pDevice->getSupportedClVersion() >= 20) {
size_t offset[3] = {0, 0, 0};
size_t gws[3] = {1, 1, 1};
@ -149,7 +149,7 @@ HWTEST_P(ParentKernelEnqueueTest, GivenBlocksWithPrivateMemoryWhenEnqueueKernelT
}
}
HWTEST_P(ParentKernelEnqueueTest, GivenParentKernelWithBlocksWhenEnqueueKernelIsCalledThenBlockKernelIsaAllocationIsMadeResident) {
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenParentKernelWithBlocksWhenEnqueueKernelIsCalledThenBlockKernelIsaAllocationIsMadeResident) {
if (pDevice->getSupportedClVersion() >= 20) {
size_t offset[3] = {0, 0, 0};
size_t gws[3] = {1, 1, 1};
@ -167,7 +167,7 @@ HWTEST_P(ParentKernelEnqueueTest, GivenParentKernelWithBlocksWhenEnqueueKernelIs
}
}
HWTEST_P(ParentKernelEnqueueTest, GivenBlockKernelManagerFilledWithBlocksWhenMakeInternalAllocationsResidentIsCalledThenAllSurfacesAreMadeResident) {
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlockKernelManagerFilledWithBlocksWhenMakeInternalAllocationsResidentIsCalledThenAllSurfacesAreMadeResident) {
if (pDevice->getSupportedClVersion() >= 20) {
auto blockKernelManager = pKernel->getProgram()->getBlockKernelManager();
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
@ -182,7 +182,7 @@ HWTEST_P(ParentKernelEnqueueTest, GivenBlockKernelManagerFilledWithBlocksWhenMak
}
}
HWTEST_P(ParentKernelEnqueueTest, GivenParentKernelWithBlocksWhenEnqueueKernelThatIsBlockedByUserEventIsCalledThenBlockKernelIsaAllocationIsMadeResidentWhenEventUnblocks) {
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenParentKernelWithBlocksWhenEnqueueKernelThatIsBlockedByUserEventIsCalledThenBlockKernelIsaAllocationIsMadeResidentWhenEventUnblocks) {
if (pDevice->getSupportedClVersion() >= 20) {
size_t offset[3] = {0, 0, 0};
size_t gws[3] = {1, 1, 1};
@ -209,7 +209,7 @@ HWTEST_P(ParentKernelEnqueueTest, GivenParentKernelWithBlocksWhenEnqueueKernelTh
}
}
HWTEST_P(ParentKernelEnqueueTest, givenParentKernelWhenEnqueuedSecondTimeThenDeviceQueueDSHIsResetToInitialOffset) {
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueuedSecondTimeThenDeviceQueueDSHIsResetToInitialOffset) {
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
if (std::string(pPlatform->getDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
@ -240,7 +240,7 @@ HWTEST_P(ParentKernelEnqueueTest, givenParentKernelWhenEnqueuedSecondTimeThenDev
}
}
HWTEST_P(ParentKernelEnqueueTest, givenParentKernelWhenEnqueuedThenBlocksSurfaceStatesAreCopied) {
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueuedThenBlocksSurfaceStatesAreCopied) {
using BINDING_TABLE_STATE = typename FamilyType::BINDING_TABLE_STATE;
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
@ -306,7 +306,7 @@ HWTEST_P(ParentKernelEnqueueTest, givenParentKernelWhenEnqueuedThenBlocksSurface
}
}
HWTEST_P(ParentKernelEnqueueTest, givenParentKernelWhenEnqueuedThenReflectionSurfaceIsCreated) {
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueuedThenReflectionSurfaceIsCreated) {
using BINDING_TABLE_STATE = typename FamilyType::BINDING_TABLE_STATE;
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
@ -411,7 +411,7 @@ class ParentKernelEnqueueFixture : public ExecutionModelSchedulerTest,
}
};
TEST_F(ParentKernelEnqueueFixture, GivenParentKernelWhenEnqueuedTheDefaultDeviceQueueAndEventPoolIsPatched) {
HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, GivenParentKernelWhenEnqueuedTheDefaultDeviceQueueAndEventPoolIsPatched) {
if (pDevice->getSupportedClVersion() >= 20) {
size_t offset[3] = {0, 0, 0};
@ -437,7 +437,7 @@ TEST_F(ParentKernelEnqueueFixture, GivenParentKernelWhenEnqueuedTheDefaultDevice
}
}
HWTEST_F(ParentKernelEnqueueFixture, GivenParentKernelWhenEnqueuedThenBlocksDSHOnReflectionSurfaceArePatchedWithDeviceQueueAndEventPoolAddresses) {
HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, GivenParentKernelWhenEnqueuedThenBlocksDSHOnReflectionSurfaceArePatchedWithDeviceQueueAndEventPoolAddresses) {
if (pDevice->getSupportedClVersion() >= 20) {
size_t offset[3] = {0, 0, 0};
@ -477,7 +477,7 @@ HWTEST_F(ParentKernelEnqueueFixture, GivenParentKernelWhenEnqueuedThenBlocksDSHO
}
}
HWTEST_F(ParentKernelEnqueueFixture, GivenParentKernelWhenEnqueuedToNonBlockedQueueThenDeviceQueueCriticalSetionIsAcquired) {
HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, GivenParentKernelWhenEnqueuedToNonBlockedQueueThenDeviceQueueCriticalSetionIsAcquired) {
if (pDevice->getSupportedClVersion() >= 20) {
size_t offset[3] = {0, 0, 0};
@ -492,7 +492,7 @@ HWTEST_F(ParentKernelEnqueueFixture, GivenParentKernelWhenEnqueuedToNonBlockedQu
}
}
HWTEST_F(ParentKernelEnqueueFixture, GivenParentKernelWhenEnqueuedToBlockedQueueThenDeviceQueueCriticalSetionIsNotAcquired) {
HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, GivenParentKernelWhenEnqueuedToBlockedQueueThenDeviceQueueCriticalSetionIsNotAcquired) {
if (pDevice->getSupportedClVersion() >= 20) {
size_t offset[3] = {0, 0, 0};
@ -511,7 +511,7 @@ HWTEST_F(ParentKernelEnqueueFixture, GivenParentKernelWhenEnqueuedToBlockedQueue
}
}
HWTEST_F(ParentKernelEnqueueFixture, ParentKernelEnqueuedToNonBlockedQueueFlushesCSRWithSLM) {
HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, ParentKernelEnqueuedToNonBlockedQueueFlushesCSRWithSLM) {
if (pDevice->getSupportedClVersion() >= 20) {
size_t offset[3] = {0, 0, 0};
@ -556,7 +556,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, ParentKernelEnqueuedWith
}
}
HWTEST_F(ParentKernelEnqueueFixture, givenCsrInBatchingModeWhenExecutionModelKernelIsSubmittedThenItIsFlushed) {
HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, givenCsrInBatchingModeWhenExecutionModelKernelIsSubmittedThenItIsFlushed) {
if (pDevice->getSupportedClVersion() >= 20) {
auto mockCsr = new MockCsrHw2<FamilyType>(*pDevice->executionEnvironment);
mockCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
@ -578,7 +578,7 @@ HWTEST_F(ParentKernelEnqueueFixture, givenCsrInBatchingModeWhenExecutionModelKer
}
}
HWTEST_F(ParentKernelEnqueueFixture, ParentKernelEnqueueMarksCSRMediaVFEStateDirty) {
HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelEnqueueFixture, ParentKernelEnqueueMarksCSRMediaVFEStateDirty) {
if (pDevice->getSupportedClVersion() >= 20) {
size_t offset[3] = {0, 0, 0};

View File

@ -26,7 +26,7 @@ static const char *KernelNames[] = {"kernel_reflection", "simple_block_kernel"};
typedef ExecutionModelKernelTest ParentKernelDispatchTest;
HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenDeviceQueueDSHIsUsed) {
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenDeviceQueueDSHIsUsed) {
if (std::string(pPlatform->getDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
DeviceQueueHw<FamilyType> *pDevQueueHw = castToObject<DeviceQueueHw<FamilyType>>(pDevQueue);
@ -64,7 +64,7 @@ HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenDev
}
}
HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenDynamicStateHeapIsRequestedThenDeviceQueueHeapIsReturned) {
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenDynamicStateHeapIsRequestedThenDeviceQueueHeapIsReturned) {
if (std::string(pPlatform->getDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
DeviceQueueHw<FamilyType> *pDevQueueHw = castToObject<DeviceQueueHw<FamilyType>>(pDevQueue);
@ -76,7 +76,7 @@ HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenDynamicStateHeapIsReques
}
}
HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenIndirectObjectHeapIsRequestedThenDeviceQueueDSHIsReturned) {
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenIndirectObjectHeapIsRequestedThenDeviceQueueDSHIsReturned) {
if (std::string(pPlatform->getDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
DeviceQueueHw<FamilyType> *pDevQueueHw = castToObject<DeviceQueueHw<FamilyType>>(pDevQueue);
@ -88,7 +88,7 @@ HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenIndirectObjectHeapIsRequ
}
}
HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenDefaultCmdQIOHIsNotUsed) {
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenDefaultCmdQIOHIsNotUsed) {
if (std::string(pPlatform->getDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
KernelOperation *blockedCommandsData = nullptr;
const size_t globalOffsets[3] = {0, 0, 0};
@ -117,7 +117,7 @@ HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenDef
}
}
HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenSSHSizeAccountForsBlocksSurfaceStates) {
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenSSHSizeAccountForsBlocksSurfaceStates) {
if (std::string(pPlatform->getDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
KernelOperation *blockedCommandsData = nullptr;
const size_t globalOffsets[3] = {0, 0, 0};
@ -149,7 +149,7 @@ HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenSSH
}
}
HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsBlockedThenSSHSizeForParentIsAllocated) {
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenQueueIsBlockedThenSSHSizeForParentIsAllocated) {
using BINDING_TABLE_STATE = typename FamilyType::BINDING_TABLE_STATE;
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
@ -204,7 +204,7 @@ INSTANTIATE_TEST_CASE_P(ParentKernelDispatchTest,
typedef ParentKernelCommandQueueFixture ParentKernelCommandStreamFixture;
HWTEST_F(ParentKernelCommandStreamFixture, GivenDispatchInfoWithParentKernelWhenCommandStreamIsAcquiredThenSizeAccountsForSchedulerDispatch) {
HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelCommandStreamFixture, GivenDispatchInfoWithParentKernelWhenCommandStreamIsAcquiredThenSizeAccountsForSchedulerDispatch) {
if (device->getSupportedClVersion() >= 20) {
MockParentKernel *mockParentKernel = MockParentKernel::create(*context);
@ -254,7 +254,7 @@ class MockParentKernelDispatch : public ExecutionModelSchedulerTest,
DebugManagerStateRestore dbgRestore;
};
HWTEST_F(MockParentKernelDispatch, GivenBlockedQueueWhenParentKernelIsDispatchedThenDshHeapForIndirectObjectHeapIsUsed) {
HWCMDTEST_F(IGFX_GEN8_CORE, MockParentKernelDispatch, GivenBlockedQueueWhenParentKernelIsDispatchedThenDshHeapForIndirectObjectHeapIsUsed) {
if (pDevice->getSupportedClVersion() >= 20) {
MockParentKernel *mockParentKernel = MockParentKernel::create(*context);
@ -334,7 +334,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, MockParentKernelDispatch, GivenParentKernelWhenDispa
}
}
HWTEST_F(MockParentKernelDispatch, GivenUsedSSHHeapWhenParentKernelIsDispatchedThenNewSSHIsAllocated) {
HWCMDTEST_F(IGFX_GEN8_CORE, MockParentKernelDispatch, GivenUsedSSHHeapWhenParentKernelIsDispatchedThenNewSSHIsAllocated) {
if (pDevice->getSupportedClVersion() >= 20) {
MockParentKernel *mockParentKernel = MockParentKernel::create(*context);
@ -376,7 +376,7 @@ HWTEST_F(MockParentKernelDispatch, GivenUsedSSHHeapWhenParentKernelIsDispatchedT
}
}
HWTEST_F(MockParentKernelDispatch, GivenNotUsedSSHHeapWhenParentKernelIsDispatchedThenExistingSSHIsUsed) {
HWCMDTEST_F(IGFX_GEN8_CORE, MockParentKernelDispatch, GivenNotUsedSSHHeapWhenParentKernelIsDispatchedThenExistingSSHIsUsed) {
if (pDevice->getSupportedClVersion() >= 20) {
MockParentKernel *mockParentKernel = MockParentKernel::create(*context);

View File

@ -226,7 +226,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelCommandQueueFixture, dispatchSchedulerWi
}
}
HWTEST_F(ExecutionModelSchedulerFixture, ForceDispatchSchedulerEnqueuesSchedulerKernel) {
HWCMDTEST_F(IGFX_GEN8_CORE, ExecutionModelSchedulerFixture, ForceDispatchSchedulerEnqueuesSchedulerKernel) {
if (pDevice->getSupportedClVersion() >= 20) {
DebugManagerStateRestore dbgRestorer;

View File

@ -74,7 +74,7 @@ class MockDeviceQueueHwWithCriticalSectionRelease : public DeviceQueueHw<GfxFami
HwTimeStamps *timestampAddedInCleanupSection = nullptr;
};
HWTEST_F(ParentKernelCommandQueueFixture, givenLockedEMcritcalSectionWhenParentKernelCommandIsSubmittedThenItWaitsForcriticalSectionReleasement) {
HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelCommandQueueFixture, givenLockedEMcritcalSectionWhenParentKernelCommandIsSubmittedThenItWaitsForcriticalSectionReleasement) {
if (device->getSupportedClVersion() >= 20) {
cl_queue_properties properties[3] = {0};
MockParentKernel *parentKernel = MockParentKernel::create(*context);
@ -116,7 +116,7 @@ HWTEST_F(ParentKernelCommandQueueFixture, givenLockedEMcritcalSectionWhenParentK
}
}
HWTEST_F(ParentKernelCommandQueueFixture, givenParentKernelWhenCommandIsSubmittedThenPassedDshIsUsed) {
HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelCommandQueueFixture, givenParentKernelWhenCommandIsSubmittedThenPassedDshIsUsed) {
if (device->getSupportedClVersion() >= 20) {
cl_queue_properties properties[3] = {0};
MockParentKernel *parentKernel = MockParentKernel::create(*context);
@ -181,7 +181,7 @@ HWTEST_F(ParentKernelCommandQueueFixture, givenParentKernelWhenCommandIsSubmitte
}
}
HWTEST_F(ParentKernelCommandQueueFixture, givenParentKernelWhenCommandIsSubmittedThenIndirectStateAndEMCleanupSectionIsSetup) {
HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelCommandQueueFixture, givenParentKernelWhenCommandIsSubmittedThenIndirectStateAndEMCleanupSectionIsSetup) {
if (device->getSupportedClVersion() >= 20) {
cl_queue_properties properties[3] = {0};
MockParentKernel *parentKernel = MockParentKernel::create(*context);
@ -223,7 +223,7 @@ HWTEST_F(ParentKernelCommandQueueFixture, givenParentKernelWhenCommandIsSubmitte
}
}
HWTEST_F(ParentKernelCommandQueueFixture, givenBlockedParentKernelWithProfilingWhenCommandIsSubmittedThenEMCleanupSectionsSetsCompleteTimestamp) {
HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelCommandQueueFixture, givenBlockedParentKernelWithProfilingWhenCommandIsSubmittedThenEMCleanupSectionsSetsCompleteTimestamp) {
if (device->getSupportedClVersion() >= 20) {
cl_queue_properties properties[3] = {0};
MockParentKernel *parentKernel = MockParentKernel::create(*context);
@ -265,7 +265,7 @@ HWTEST_F(ParentKernelCommandQueueFixture, givenBlockedParentKernelWithProfilingW
}
}
HWTEST_F(ParentKernelCommandQueueFixture, givenParentKernelWhenCommandIsSubmittedThenSchedulerIsDispatched) {
HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelCommandQueueFixture, givenParentKernelWhenCommandIsSubmittedThenSchedulerIsDispatched) {
if (device->getSupportedClVersion() >= 20) {
cl_queue_properties properties[3] = {0};
MockParentKernel *parentKernel = MockParentKernel::create(*context);

View File

@ -1103,7 +1103,7 @@ HWTEST_F(HardwareCommandsHelperTests, whenProgrammingMiAtomicThenSetupAllFields)
typedef ExecutionModelKernelFixture ParentKernelCommandsFromBinaryTest;
HWTEST_P(ParentKernelCommandsFromBinaryTest, getSizeRequiredForExecutionModelForSurfaceStatesReturnsSizeOfBlocksPlusMaxBindingTableSizeForAllIDTEntriesAndSchedulerSSHSize) {
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelCommandsFromBinaryTest, getSizeRequiredForExecutionModelForSurfaceStatesReturnsSizeOfBlocksPlusMaxBindingTableSizeForAllIDTEntriesAndSchedulerSSHSize) {
using BINDING_TABLE_STATE = typename FamilyType::BINDING_TABLE_STATE;
if (std::string(pPlatform->getDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
@ -1140,7 +1140,7 @@ HWTEST_P(ParentKernelCommandsFromBinaryTest, getSizeRequiredForExecutionModelFor
}
}
HWTEST_P(ParentKernelCommandsFromBinaryTest, getSizeRequiredForExecutionModelForIOHReturnsSchedulerSize) {
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelCommandsFromBinaryTest, getSizeRequiredForExecutionModelForIOHReturnsSchedulerSize) {
using BINDING_TABLE_STATE = typename FamilyType::BINDING_TABLE_STATE;
if (std::string(pPlatform->getDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
@ -1154,7 +1154,7 @@ HWTEST_P(ParentKernelCommandsFromBinaryTest, getSizeRequiredForExecutionModelFor
}
}
HWTEST_P(ParentKernelCommandsFromBinaryTest, getSizeRequiredForExecutionModelForGSH) {
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelCommandsFromBinaryTest, getSizeRequiredForExecutionModelForGSH) {
using BINDING_TABLE_STATE = typename FamilyType::BINDING_TABLE_STATE;
if (std::string(pPlatform->getDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {

View File

@ -71,11 +71,11 @@ struct KernelArgDevQueueTest : public DeviceFixture,
KernelArgPatchInfo kernelArgPatchInfo;
};
TEST_F(KernelArgDevQueueTest, GIVENkernelWithDevQueueArgWHENsetArgHandleTHENsetsProperHandle) {
HWCMDTEST_F(IGFX_GEN8_CORE, KernelArgDevQueueTest, GIVENkernelWithDevQueueArgWHENsetArgHandleTHENsetsProperHandle) {
EXPECT_EQ(pKernel->kernelArgHandlers[0], &Kernel::setArgDevQueue);
}
TEST_F(KernelArgDevQueueTest, GIVENdevQueueArgHandlerWHENpassDevQueueTHENacceptObjAndPatch) {
HWCMDTEST_F(IGFX_GEN8_CORE, KernelArgDevQueueTest, GIVENdevQueueArgHandlerWHENpassDevQueueTHENacceptObjAndPatch) {
auto clDeviceQueue = static_cast<cl_command_queue>(pDeviceQueue);
auto ret = pKernel->setArgDevQueue(0, sizeof(cl_command_queue), &clDeviceQueue);
@ -86,7 +86,7 @@ TEST_F(KernelArgDevQueueTest, GIVENdevQueueArgHandlerWHENpassDevQueueTHENacceptO
EXPECT_EQ(*(reinterpret_cast<uint32_t *>(patchLocation)), gpuAddress);
}
TEST_F(KernelArgDevQueueTest, GIVENdevQueueArgHandlerWHENpassNormalQueueTHENrejectObjAndReturnError) {
HWCMDTEST_F(IGFX_GEN8_CORE, KernelArgDevQueueTest, GIVENdevQueueArgHandlerWHENpassNormalQueueTHENrejectObjAndReturnError) {
auto clCmdQueue = static_cast<cl_command_queue>(pCommandQueue);
auto ret = pKernel->setArgDevQueue(0, sizeof(cl_command_queue), &clCmdQueue);
@ -94,7 +94,7 @@ TEST_F(KernelArgDevQueueTest, GIVENdevQueueArgHandlerWHENpassNormalQueueTHENreje
EXPECT_EQ(crossThreadDataUnchanged(), true);
}
TEST_F(KernelArgDevQueueTest, GIVENdevQueueArgHandlerWHENpassNonQueueObjTHENrejectObjAndReturnError) {
HWCMDTEST_F(IGFX_GEN8_CORE, KernelArgDevQueueTest, GIVENdevQueueArgHandlerWHENpassNonQueueObjTHENrejectObjAndReturnError) {
Buffer *buffer = new MockBuffer();
auto clBuffer = static_cast<cl_mem>(buffer);
@ -105,7 +105,7 @@ TEST_F(KernelArgDevQueueTest, GIVENdevQueueArgHandlerWHENpassNonQueueObjTHENreje
delete buffer;
}
TEST_F(KernelArgDevQueueTest, GIVENdevQueueArgHandlerWHENpassFakeQueueTHENrejectObjAndReturnError) {
HWCMDTEST_F(IGFX_GEN8_CORE, KernelArgDevQueueTest, GIVENdevQueueArgHandlerWHENpassFakeQueueTHENrejectObjAndReturnError) {
char *pFakeDeviceQueue = new char[sizeof(DeviceQueue)];
auto clFakeDeviceQueue = reinterpret_cast<cl_command_queue *>(pFakeDeviceQueue);
@ -116,13 +116,13 @@ TEST_F(KernelArgDevQueueTest, GIVENdevQueueArgHandlerWHENpassFakeQueueTHENreject
delete[] pFakeDeviceQueue;
}
TEST_F(KernelArgDevQueueTest, GIVENdevQueueArgHandlerWHENpassNullptrTHENrejectObjAndReturnError) {
HWCMDTEST_F(IGFX_GEN8_CORE, KernelArgDevQueueTest, GIVENdevQueueArgHandlerWHENpassNullptrTHENrejectObjAndReturnError) {
auto ret = pKernel->setArgDevQueue(0, sizeof(cl_command_queue), nullptr);
EXPECT_EQ(ret, CL_INVALID_ARG_VALUE);
EXPECT_EQ(crossThreadDataUnchanged(), true);
}
TEST_F(KernelArgDevQueueTest, GIVENdevQueueArgHandlerWHENpassWrongSizeTHENrejectObjAndReturnError) {
HWCMDTEST_F(IGFX_GEN8_CORE, KernelArgDevQueueTest, GIVENdevQueueArgHandlerWHENpassWrongSizeTHENrejectObjAndReturnError) {
auto clDeviceQueue = static_cast<cl_command_queue>(pDeviceQueue);
auto ret = pKernel->setArgDevQueue(0, sizeof(cl_command_queue) - 1, &clDeviceQueue);

View File

@ -1026,7 +1026,7 @@ INSTANTIATE_TEST_CASE_P(KernelReflectionSurfaceTest,
::testing::Values(binaryFile),
::testing::ValuesIn(KernelNames)));
TEST_P(KernelReflectionSurfaceWithQueueTest, ObtainKernelReflectionSurfacePatchesBlocksCurbe) {
HWCMDTEST_P(IGFX_GEN8_CORE, KernelReflectionSurfaceWithQueueTest, ObtainKernelReflectionSurfacePatchesBlocksCurbe) {
if (std::string(pPlatform->getDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
BlockKernelManager *blockManager = pProgram->getBlockKernelManager();
@ -1100,7 +1100,7 @@ TEST_P(KernelReflectionSurfaceWithQueueTest, ObtainKernelReflectionSurfacePatche
}
}
TEST_P(KernelReflectionSurfaceWithQueueTest, ObtainKernelReflectionSurfaceSetsParentImageAndSamplersParams) {
HWCMDTEST_P(IGFX_GEN8_CORE, KernelReflectionSurfaceWithQueueTest, ObtainKernelReflectionSurfaceSetsParentImageAndSamplersParams) {
if (std::string(pPlatform->getDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
BlockKernelManager *blockManager = pProgram->getBlockKernelManager();

View File

@ -22,6 +22,7 @@
#include "runtime/os_interface/os_context.h"
#include "test.h"
#include "unit_tests/fixtures/device_fixture.h"
#include "unit_tests/fixtures/device_host_queue_fixture.h"
#include "unit_tests/fixtures/execution_model_fixture.h"
#include "unit_tests/fixtures/memory_management_fixture.h"
#include "unit_tests/helpers/gtest_helpers.h"
@ -38,6 +39,7 @@
#include <memory>
using namespace NEO;
using namespace DeviceHostQueue;
class KernelTest : public ProgramFromBinaryTest {
public:
@ -1164,7 +1166,7 @@ TEST_F(KernelConstantSurfaceTest, givenStatelessKernelWhenKernelIsCreatedThenCon
delete pKernel;
}
HWTEST_F(KernelEventPoolSurfaceTest, givenStatefulKernelWhenKernelIsCreatedThenEventPoolSurfaceStateIsPatchedWithNullSurface) {
HWCMDTEST_F(IGFX_GEN8_CORE, KernelEventPoolSurfaceTest, givenStatefulKernelWhenKernelIsCreatedThenEventPoolSurfaceStateIsPatchedWithNullSurface) {
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
@ -1216,7 +1218,7 @@ HWTEST_F(KernelEventPoolSurfaceTest, givenStatefulKernelWhenKernelIsCreatedThenE
delete pKernel;
}
HWTEST_F(KernelEventPoolSurfaceTest, givenStatefulKernelWhenEventPoolIsPatchedThenEventPoolSurfaceStateIsProgrammed) {
HWCMDTEST_F(IGFX_GEN8_CORE, KernelEventPoolSurfaceTest, givenStatefulKernelWhenEventPoolIsPatchedThenEventPoolSurfaceStateIsProgrammed) {
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
@ -1268,7 +1270,7 @@ HWTEST_F(KernelEventPoolSurfaceTest, givenStatefulKernelWhenEventPoolIsPatchedTh
delete pKernel;
}
HWTEST_F(KernelEventPoolSurfaceTest, givenKernelWithNullEventPoolInKernelInfoWhenEventPoolIsPatchedThenAddressIsNotPatched) {
HWCMDTEST_F(IGFX_GEN8_CORE, KernelEventPoolSurfaceTest, givenKernelWithNullEventPoolInKernelInfoWhenEventPoolIsPatchedThenAddressIsNotPatched) {
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
@ -1300,7 +1302,7 @@ HWTEST_F(KernelEventPoolSurfaceTest, givenKernelWithNullEventPoolInKernelInfoWhe
delete pKernel;
}
TEST_F(KernelEventPoolSurfaceTest, givenStatelessKernelWhenKernelIsCreatedThenEventPoolSurfaceStateIsNotPatched) {
HWCMDTEST_F(IGFX_GEN8_CORE, KernelEventPoolSurfaceTest, givenStatelessKernelWhenKernelIsCreatedThenEventPoolSurfaceStateIsNotPatched) {
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
@ -1336,7 +1338,7 @@ TEST_F(KernelEventPoolSurfaceTest, givenStatelessKernelWhenKernelIsCreatedThenEv
delete pKernel;
}
TEST_F(KernelEventPoolSurfaceTest, givenStatelessKernelWhenEventPoolIsPatchedThenCrossThreadDataIsPatched) {
HWCMDTEST_F(IGFX_GEN8_CORE, KernelEventPoolSurfaceTest, givenStatelessKernelWhenEventPoolIsPatchedThenCrossThreadDataIsPatched) {
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
@ -1374,7 +1376,7 @@ TEST_F(KernelEventPoolSurfaceTest, givenStatelessKernelWhenEventPoolIsPatchedThe
delete pKernel;
}
HWTEST_F(KernelDefaultDeviceQueueSurfaceTest, givenStatefulKernelWhenKernelIsCreatedThenDefaultDeviceQueueSurfaceStateIsPatchedWithNullSurface) {
HWCMDTEST_F(IGFX_GEN8_CORE, KernelDefaultDeviceQueueSurfaceTest, givenStatefulKernelWhenKernelIsCreatedThenDefaultDeviceQueueSurfaceStateIsPatchedWithNullSurface) {
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
@ -1426,7 +1428,7 @@ HWTEST_F(KernelDefaultDeviceQueueSurfaceTest, givenStatefulKernelWhenKernelIsCre
delete pKernel;
}
HWTEST_F(KernelDefaultDeviceQueueSurfaceTest, givenStatefulKernelWhenDefaultDeviceQueueIsPatchedThenSurfaceStateIsCorrectlyProgrammed) {
HWCMDTEST_F(IGFX_GEN8_CORE, KernelDefaultDeviceQueueSurfaceTest, givenStatefulKernelWhenDefaultDeviceQueueIsPatchedThenSurfaceStateIsCorrectlyProgrammed) {
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
@ -1480,7 +1482,7 @@ HWTEST_F(KernelDefaultDeviceQueueSurfaceTest, givenStatefulKernelWhenDefaultDevi
delete pKernel;
}
TEST_F(KernelDefaultDeviceQueueSurfaceTest, givenStatelessKernelWhenKernelIsCreatedThenDefaultDeviceQueueSurfaceStateIsNotPatched) {
HWCMDTEST_F(IGFX_GEN8_CORE, KernelDefaultDeviceQueueSurfaceTest, givenStatelessKernelWhenKernelIsCreatedThenDefaultDeviceQueueSurfaceStateIsNotPatched) {
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
@ -1514,7 +1516,7 @@ TEST_F(KernelDefaultDeviceQueueSurfaceTest, givenStatelessKernelWhenKernelIsCrea
delete pKernel;
}
TEST_F(KernelDefaultDeviceQueueSurfaceTest, givenKernelWithNullDeviceQueueKernelInfoWhenDefaultDeviceQueueIsPatchedThenAddressIsNotPatched) {
HWCMDTEST_F(IGFX_GEN8_CORE, KernelDefaultDeviceQueueSurfaceTest, givenKernelWithNullDeviceQueueKernelInfoWhenDefaultDeviceQueueIsPatchedThenAddressIsNotPatched) {
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
@ -1546,7 +1548,7 @@ TEST_F(KernelDefaultDeviceQueueSurfaceTest, givenKernelWithNullDeviceQueueKernel
delete pKernel;
}
TEST_F(KernelDefaultDeviceQueueSurfaceTest, givenStatelessKernelWhenDefaultDeviceQueueIsPatchedThenCrossThreadDataIsPatched) {
HWCMDTEST_F(IGFX_GEN8_CORE, KernelDefaultDeviceQueueSurfaceTest, givenStatelessKernelWhenDefaultDeviceQueueIsPatchedThenCrossThreadDataIsPatched) {
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
@ -2672,3 +2674,61 @@ TEST(KernelTest, givenKernelWithoutMediaVfeStateSlot1WhenGettingSizeForPrivateSc
EXPECT_EQ(0u, mockKernel.mockKernel->getPrivateScratchSize());
}
namespace NEO {
template <typename GfxFamily>
class DeviceQueueHwMock : public DeviceQueueHw<GfxFamily> {
using BaseClass = DeviceQueueHw<GfxFamily>;
public:
using BaseClass::buildSlbDummyCommands;
using BaseClass::getCSPrefetchSize;
using BaseClass::getExecutionModelCleanupSectionSize;
using BaseClass::getMediaStateClearCmdsSize;
using BaseClass::getMinimumSlbSize;
using BaseClass::getProfilingEndCmdsSize;
using BaseClass::getSlbCS;
using BaseClass::getWaCommandsSize;
using BaseClass::offsetDsh;
DeviceQueueHwMock(Context *context, Device *device, cl_queue_properties &properties) : BaseClass(context, device, properties) {
auto slb = this->getSlbBuffer();
LinearStream *slbCS = getSlbCS();
slbCS->replaceBuffer(slb->getUnderlyingBuffer(), slb->getUnderlyingBufferSize()); // reset
};
};
} // namespace NEO
HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueHwTest, whenSlbEndOffsetGreaterThanZeroThenOverwriteOneEnqueue) {
std::unique_ptr<DeviceQueueHwMock<FamilyType>> mockDeviceQueueHw(new DeviceQueueHwMock<FamilyType>(pContext, device, deviceQueueProperties::minimumProperties[0]));
auto slb = mockDeviceQueueHw->getSlbBuffer();
auto commandsSize = mockDeviceQueueHw->getMinimumSlbSize() + mockDeviceQueueHw->getWaCommandsSize();
auto slbCopy = malloc(slb->getUnderlyingBufferSize());
memset(slb->getUnderlyingBuffer(), 0xFE, slb->getUnderlyingBufferSize());
memcpy(slbCopy, slb->getUnderlyingBuffer(), slb->getUnderlyingBufferSize());
auto igilCmdQueue = reinterpret_cast<IGIL_CommandQueue *>(mockDeviceQueueHw->getQueueBuffer()->getUnderlyingBuffer());
// slbEndOffset < commandsSize * 128
// always fill only 1 enqueue (after offset)
auto offset = static_cast<int>(commandsSize) * 50;
igilCmdQueue->m_controls.m_SLBENDoffsetInBytes = offset;
mockDeviceQueueHw->resetDeviceQueue();
EXPECT_EQ(0, memcmp(slb->getUnderlyingBuffer(), slbCopy, offset)); // dont touch memory before offset
EXPECT_NE(0, memcmp(ptrOffset(slb->getUnderlyingBuffer(), offset),
slbCopy, commandsSize)); // change 1 enqueue
EXPECT_EQ(0, memcmp(ptrOffset(slb->getUnderlyingBuffer(), offset + commandsSize),
slbCopy, offset)); // dont touch memory after (offset + 1 enqueue)
// slbEndOffset == commandsSize * 128
// dont fill commands
memset(slb->getUnderlyingBuffer(), 0xFEFEFEFE, slb->getUnderlyingBufferSize());
offset = static_cast<int>(commandsSize) * 128;
igilCmdQueue->m_controls.m_SLBENDoffsetInBytes = static_cast<int>(commandsSize);
mockDeviceQueueHw->resetDeviceQueue();
EXPECT_EQ(0, memcmp(slb->getUnderlyingBuffer(), slbCopy, commandsSize * 128)); // dont touch memory for enqueues
free(slbCopy);
}