Remove device helper

Change-Id: Ie66c029359a62b81c8658d804dcf8565647100f1
This commit is contained in:
Mateusz Jablonski
2018-07-25 17:12:44 +02:00
committed by sys_ocldev
parent 282f335269
commit 98061903aa
37 changed files with 145 additions and 169 deletions

View File

@ -26,6 +26,7 @@
using OCLRT::AUBCommandStreamReceiver;
using OCLRT::AUBCommandStreamReceiverHw;
using OCLRT::AUBFamilyMapper;
using OCLRT::DeviceFixture;
using OCLRT::EngineType;
using OCLRT::folderAUB;

View File

@ -23,7 +23,7 @@
#include "aub_batch_buffer_tests_gen10.h"
#include "unit_tests/fixtures/device_fixture.h"
typedef Test<DeviceFixture> Gen10AubBatchBufferTests;
using Gen10AubBatchBufferTests = Test<OCLRT::DeviceFixture>;
static constexpr auto gpuBatchBufferAddr = 0x800400001000; // 48-bit GPU address

View File

@ -23,7 +23,7 @@
#include "aub_batch_buffer_tests.h"
#include "unit_tests/fixtures/device_fixture.h"
typedef Test<DeviceFixture> AubBatchBufferTests;
using AubBatchBufferTests = Test<OCLRT::DeviceFixture>;
static constexpr auto gpuBatchBufferAddr = 0x800400001000ull; // 48-bit GPU address

View File

@ -1035,7 +1035,7 @@ HWTEST_F(CommandQueueHwTest, givenReadOnlyHostPointerWhenAllocationForHostSurfac
::testing::NiceMock<GMockMemoryManager> *gmockMemoryManager = new ::testing::NiceMock<GMockMemoryManager>;
ASSERT_NE(nullptr, gmockMemoryManager);
std::unique_ptr<MockDevice> device(DeviceHelper<>::create(nullptr));
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
ASSERT_NE(nullptr, device.get());
device->injectMemoryManager(gmockMemoryManager);
MockContext *mockContext = new MockContext(device.get());
@ -1068,7 +1068,7 @@ HWTEST_F(CommandQueueHwTest, givenReadOnlyHostPointerWhenAllocationForHostSurfac
::testing::NiceMock<GMockMemoryManager> *gmockMemoryManager = new ::testing::NiceMock<GMockMemoryManager>;
ASSERT_NE(nullptr, gmockMemoryManager);
std::unique_ptr<MockDevice> device(DeviceHelper<>::create(nullptr));
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
ASSERT_NE(nullptr, device.get());
device->injectMemoryManager(gmockMemoryManager);
MockContext *mockContext = new MockContext(device.get());

View File

@ -227,7 +227,7 @@ HWTEST_F(ReadWriteBufferCpuCopyTest, cpuCopyCriteriaMet) {
auto smallBufferPtr = alignedMalloc(1 * MB, MemoryConstants::cacheLineSize);
auto largeBufferPtr = alignedMalloc(100 * MB, MemoryConstants::cacheLineSize);
auto mockDevice = std::unique_ptr<MockDevice>(DeviceHelper<>::create());
auto mockDevice = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto mockContext = std::unique_ptr<MockContext>(new MockContext(mockDevice.get()));
std::unique_ptr<Buffer> buffer(Buffer::create(context, CL_MEM_USE_HOST_PTR, size, alignedBufferPtr, retVal));
@ -276,7 +276,7 @@ HWTEST_F(ReadWriteBufferCpuCopyTest, cpuCopyCriteriaNotMet) {
auto unalignedHostPtr = ptrOffset(alignedHostPtr, 1);
auto largeBufferPtr = alignedMalloc(100 * MB, MemoryConstants::cacheLineSize);
auto mockDevice = std::unique_ptr<MockDevice>(DeviceHelper<>::create());
auto mockDevice = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto mockContext = std::unique_ptr<MockContext>(new MockContext(mockDevice.get()));
std::unique_ptr<Buffer> buffer(Buffer::create(context, CL_MEM_USE_HOST_PTR, size, alignedBufferPtr, retVal));

View File

@ -31,7 +31,7 @@ using namespace OCLRT;
TEST(ContextMultiDevice, singleDevice) {
cl_device_id devices[] = {
DeviceHelper<>::create()};
MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr)};
auto numDevices = ARRAY_COUNT(devices);
auto retVal = CL_SUCCESS;
@ -60,14 +60,14 @@ TEST(ContextMultiDevice, singleDevice) {
TEST(ContextMultiDevice, eightDevices) {
cl_device_id devices[] = {
DeviceHelper<>::create(),
DeviceHelper<>::create(),
DeviceHelper<>::create(),
DeviceHelper<>::create(),
DeviceHelper<>::create(),
DeviceHelper<>::create(),
DeviceHelper<>::create(),
DeviceHelper<>::create()};
MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr),
MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr),
MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr),
MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr),
MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr),
MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr),
MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr),
MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr)};
auto numDevices = ARRAY_COUNT(devices);
ASSERT_EQ(8u, numDevices);

View File

@ -36,7 +36,7 @@ using namespace OCLRT;
typedef Test<MemoryManagementFixture> ContextFailureInjection;
TEST_F(ContextFailureInjection, failedAllocationInjection) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create());
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
cl_device_id deviceID = device.get();
InjectedFunction method = [deviceID](size_t failureIndex) {
@ -59,7 +59,7 @@ TEST_F(ContextFailureInjection, failedAllocationInjection) {
}
TEST(InvalidPropertyContextTest, GivenInvalidPropertiesWhenContextIsCreatedThenErrorIsReturned) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create());
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
cl_device_id deviceID = device.get();
auto pPlatform = OCLRT::platform();
cl_platform_id pid[1];

View File

@ -76,7 +76,7 @@ TEST_F(DeviceGetCapsF, GivenDeviceCapsWhenQueryingForSLMWindowStartAddressThenPo
}
TEST(Device_GetCaps, validate) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
const auto &sysInfo = *platformDevices[0]->pSysInfo;
@ -199,7 +199,7 @@ TEST(Device_GetCaps, validate) {
}
TEST(Device_GetCaps, validateImage3DDimensions) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
if (device->getHardwareInfo().pPlatform->eRenderCoreFamily > IGFX_GEN8_CORE) {
@ -217,7 +217,7 @@ TEST(Device_GetCaps, givenDontForcePreemptionModeDebugVariableWhenCreateDeviceTh
DebugManagerStateRestore dbgRestorer;
{
DebugManager.flags.ForcePreemptionMode.set(-1);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
EXPECT_TRUE(device->getHardwareInfo().capabilityTable.defaultPreemptionMode ==
device->getPreemptionMode());
}
@ -232,7 +232,7 @@ TEST(Device_GetCaps, givenForcePreemptionModeDebugVariableWhenCreateDeviceThenSe
forceMode = PreemptionMode::ThreadGroup;
}
DebugManager.flags.ForcePreemptionMode.set((int32_t)forceMode);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
EXPECT_TRUE(forceMode == device->getPreemptionMode());
}
@ -250,7 +250,7 @@ TEST(Device_GetCaps, givenDeviceWithMidThreadPreemptionWhenDeviceIsCreatedThenSi
EXPECT_FALSE(mockBuiltins->getSipKernelCalled);
DebugManager.flags.ForcePreemptionMode.set((int32_t)PreemptionMode::MidThread);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
EXPECT_TRUE(mockBuiltins->getSipKernelCalled);
mockBuiltins->restoreGlobalBuiltins();
//make sure to release builtins prior to device as they use device
@ -262,7 +262,7 @@ TEST(Device_GetCaps, givenForceOclVersion21WhenCapsAreCreatedThenDeviceReportsOp
DebugManagerStateRestore dbgRestorer;
{
DebugManager.flags.ForceOCLVersion.set(21);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_STREQ("OpenCL 2.1 NEO ", caps.clVersion);
EXPECT_STREQ("OpenCL C 2.0 ", caps.clCVersion);
@ -274,7 +274,7 @@ TEST(Device_GetCaps, givenForceOclVersion20WhenCapsAreCreatedThenDeviceReportsOp
DebugManagerStateRestore dbgRestorer;
{
DebugManager.flags.ForceOCLVersion.set(20);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_STREQ("OpenCL 2.0 NEO ", caps.clVersion);
EXPECT_STREQ("OpenCL C 2.0 ", caps.clCVersion);
@ -286,7 +286,7 @@ TEST(Device_GetCaps, givenForceOclVersion12WhenCapsAreCreatedThenDeviceReportsOp
DebugManagerStateRestore dbgRestorer;
{
DebugManager.flags.ForceOCLVersion.set(12);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_STREQ("OpenCL 1.2 NEO ", caps.clVersion);
EXPECT_STREQ("OpenCL C 1.2 ", caps.clCVersion);
@ -298,7 +298,7 @@ TEST(Device_GetCaps, givenForceInvalidOclVersionWhenCapsAreCreatedThenDeviceWill
DebugManagerStateRestore dbgRestorer;
{
DebugManager.flags.ForceOCLVersion.set(1);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_STREQ("OpenCL 1.2 NEO ", caps.clVersion);
EXPECT_STREQ("OpenCL C 1.2 ", caps.clCVersion);
@ -310,7 +310,7 @@ TEST(Device_GetCaps, givenForce32bitAddressingWhenCapsAreCreatedThenDeviceReport
DebugManagerStateRestore dbgRestorer;
{
DebugManager.flags.Force32bitAddressing.set(true);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
if (is64bit) {
EXPECT_TRUE(caps.force32BitAddressess);
@ -326,7 +326,7 @@ TEST(Device_GetCaps, givenForce32bitAddressingWhenCapsAreCreatedThenDeviceReport
}
TEST(Device_GetCaps, alignGlobalMemSizeDownToPageSize) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
auto expectedSize = alignDown(caps.globalMemSize, MemoryConstants::pageSize);
@ -335,7 +335,7 @@ TEST(Device_GetCaps, alignGlobalMemSizeDownToPageSize) {
}
TEST(Device_GetCaps, checkGlobalMemSize) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
auto pMemManager = device->getMemoryManager();
unsigned int enabledCLVer = device->getEnabledClVersion();
@ -354,7 +354,7 @@ TEST(Device_GetCaps, checkGlobalMemSize) {
}
TEST(Device_GetCaps, givenGlobalMemSizeWhenCalculatingMaxAllocSizeThenAdjustToHWCap) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
HardwareCapabilities hwCaps = {0};
@ -368,7 +368,7 @@ TEST(Device_GetCaps, givenGlobalMemSizeWhenCalculatingMaxAllocSizeThenAdjustToHW
}
TEST(Device_GetCaps, extensionsStringEndsWithSpace) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
auto len = strlen(caps.deviceExtensions);
ASSERT_LT(0U, len);
@ -376,14 +376,14 @@ TEST(Device_GetCaps, extensionsStringEndsWithSpace) {
}
TEST(Device_GetCaps, DISABLED_givenDeviceWhenCapsAreCreateThenClGLSharingIsReported) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_gl_sharing ")));
}
TEST(Device_GetCaps, givenOpenCLVersion21WhenCapsAreCreatedThenDeviceReportsClKhrSubgroupsExtension) {
DebugManager.flags.ForceOCLVersion.set(21);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_subgroups")));
@ -393,7 +393,7 @@ TEST(Device_GetCaps, givenOpenCLVersion21WhenCapsAreCreatedThenDeviceReportsClKh
TEST(Device_GetCaps, givenOpenCLVersion20WhenCapsAreCreatedThenDeviceDoesntReportClKhrSubgroupsExtension) {
DebugManager.flags.ForceOCLVersion.set(20);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_khr_subgroups"))));
@ -403,7 +403,7 @@ TEST(Device_GetCaps, givenOpenCLVersion20WhenCapsAreCreatedThenDeviceDoesntRepor
TEST(Device_GetCaps, givenOpenCLVersion21WhenCapsAreCreatedThenDeviceReportsClKhrIlProgramExtension) {
DebugManager.flags.ForceOCLVersion.set(21);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_il_program")));
@ -413,7 +413,7 @@ TEST(Device_GetCaps, givenOpenCLVersion21WhenCapsAreCreatedThenDeviceReportsClKh
TEST(Device_GetCaps, givenOpenCLVersion20WhenCapsAreCreatedThenDeviceDoesntReportClKhrIlProgramExtension) {
DebugManager.flags.ForceOCLVersion.set(20);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_khr_il_program"))));
@ -423,7 +423,7 @@ TEST(Device_GetCaps, givenOpenCLVersion20WhenCapsAreCreatedThenDeviceDoesntRepor
TEST(Device_GetCaps, givenEnableNV12setToTrueWhenCapsAreCreatedThenDeviceReportsNV12Extension) {
DebugManager.flags.EnableNV12.set(true);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_planar_yuv")));
@ -434,7 +434,7 @@ TEST(Device_GetCaps, givenEnableNV12setToTrueWhenCapsAreCreatedThenDeviceReports
TEST(Device_GetCaps, givenEnablePackedYuvsetToTrueWhenCapsAreCreatedThenDeviceReportsPackedYuvExtension) {
DebugManager.flags.EnablePackedYuv.set(true);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_packed_yuv")));
@ -445,7 +445,7 @@ TEST(Device_GetCaps, givenEnablePackedYuvsetToTrueWhenCapsAreCreatedThenDeviceRe
TEST(Device_GetCaps, givenEnableVmeSetToTrueWhenCapsAreCreatedThenDeviceReportsVmeExtensionAndBuiltins) {
DebugManager.flags.EnableIntelVme.set(true);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_motion_estimation")));
@ -458,7 +458,7 @@ TEST(Device_GetCaps, givenEnableVmeSetToTrueWhenCapsAreCreatedThenDeviceReportsV
TEST(Device_GetCaps, givenEnableVmeSetToFalseWhenCapsAreCreatedThenDeviceDoesNotReportsVmeExtensionAndBuiltins) {
DebugManager.flags.EnableIntelVme.set(false);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_motion_estimation"))));
@ -471,7 +471,7 @@ TEST(Device_GetCaps, givenEnableVmeSetToFalseWhenCapsAreCreatedThenDeviceDoesNot
TEST(Device_GetCaps, givenEnableAdvancedVmeSetToTrueWhenCapsAreCreatedThenDeviceReportsAdvancedVmeExtensionAndBuiltins) {
DebugManager.flags.EnableIntelAdvancedVme.set(true);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_advanced_motion_estimation")));
@ -484,7 +484,7 @@ TEST(Device_GetCaps, givenEnableAdvancedVmeSetToTrueWhenCapsAreCreatedThenDevice
TEST(Device_GetCaps, givenEnableAdvancedVmeSetToFalseWhenCapsAreCreatedThenDeviceDoesNotReportsAdvancedVmeExtensionAndBuiltins) {
DebugManager.flags.EnableIntelAdvancedVme.set(false);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_advanced_motion_estimation"))));
@ -503,7 +503,7 @@ TEST(Device_GetCaps, byDefaultVmeIsTurnedOn) {
TEST(Device_GetCaps, givenOpenCL21DeviceCapsWhenAskedForCPUcopyFlagThenTrueIsReturned) {
DebugManagerStateRestore stateRestorer;
DebugManager.flags.ForceOCLVersion.set(21);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_TRUE(caps.cpuCopyAllowed);
}
@ -511,7 +511,7 @@ TEST(Device_GetCaps, givenOpenCL21DeviceCapsWhenAskedForCPUcopyFlagThenTrueIsRet
TEST(Device_GetCaps, givenOpenCL20DeviceCapsWhenAskedForCPUcopyFlagThenTrueIsReturned) {
DebugManagerStateRestore stateRestorer;
DebugManager.flags.ForceOCLVersion.set(20);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_TRUE(caps.cpuCopyAllowed);
}
@ -519,27 +519,27 @@ TEST(Device_GetCaps, givenOpenCL20DeviceCapsWhenAskedForCPUcopyFlagThenTrueIsRet
TEST(Device_GetCaps, givenOpenCL12DeviceCapsWhenAskedForCPUcopyFlagThenTrueIsReturned) {
DebugManagerStateRestore stateRestorer;
DebugManager.flags.ForceOCLVersion.set(12);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_TRUE(caps.cpuCopyAllowed);
}
TEST(Device_GetCaps, deviceReportsPriorityHintsExtension) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_priority_hints")));
}
TEST(Device_GetCaps, deviceReportsCreateCommandQueueExtension) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_create_command_queue")));
}
TEST(Device_GetCaps, deviceReportsThrottleHintsExtension) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_throttle_hints")));
@ -549,7 +549,7 @@ TEST(Device_GetCaps, givenAtleastOCL2DeviceThenExposesMipmapImageExtensions) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.ForceOCLVersion.set(20);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_mipmap_image")));
@ -560,7 +560,7 @@ TEST(Device_GetCaps, givenOCL12DeviceThenDoesNotExposeMipmapImageExtensions) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.ForceOCLVersion.set(12);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_khr_mipmap_image"))));
@ -570,7 +570,7 @@ TEST(Device_GetCaps, givenOCL12DeviceThenDoesNotExposeMipmapImageExtensions) {
TEST(Device_GetCaps, givenDeviceThatDoesntHaveFp64ThenExtensionIsNotReported) {
HardwareInfo nonFp64Device = *platformDevices[0];
nonFp64Device.capabilityTable.ftrSupportsFP64 = false;
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(&nonFp64Device));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&nonFp64Device));
const auto &caps = device->getDeviceInfo();
std::string extensionString = caps.deviceExtensions;
@ -584,7 +584,7 @@ TEST(DeviceGetCaps, givenDeviceThatDoesntHaveFp64WhenDbgFlagEnablesFp64ThenRepor
HardwareInfo nonFp64Device = *platformDevices[0];
nonFp64Device.capabilityTable.ftrSupportsFP64 = false;
nonFp64Device.capabilityTable.ftrSupports64BitMath = false;
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(&nonFp64Device));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&nonFp64Device));
const auto &caps = device->getDeviceInfo();
std::string extensionString = caps.deviceExtensions;
@ -601,7 +601,7 @@ TEST(DeviceGetCaps, givenDeviceThatDoesHaveFp64WhenDbgFlagDisablesFp64ThenDontRe
HardwareInfo fp64Device = *platformDevices[0];
fp64Device.capabilityTable.ftrSupportsFP64 = true;
fp64Device.capabilityTable.ftrSupports64BitMath = true;
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(&fp64Device));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&fp64Device));
const auto &caps = device->getDeviceInfo();
std::string extensionString = caps.deviceExtensions;
@ -616,7 +616,7 @@ TEST(Device_GetCaps, givenOclVersionLessThan21WhenCapsAreCreatedThenDeviceReport
DebugManagerStateRestore dbgRestorer;
{
DebugManager.flags.ForceOCLVersion.set(12);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_STREQ("", caps.ilVersion);
DebugManager.flags.ForceOCLVersion.set(0);
@ -627,7 +627,7 @@ TEST(Device_GetCaps, givenOclVersion21WhenCapsAreCreatedThenDeviceReportsSpirvAs
DebugManagerStateRestore dbgRestorer;
{
DebugManager.flags.ForceOCLVersion.set(21);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_STREQ("SPIR-V_1.0 ", caps.ilVersion);
DebugManager.flags.ForceOCLVersion.set(0);
@ -644,7 +644,7 @@ TEST(Device_GetCaps, givenDisabledFtrPooledEuWhenCalculatingMaxEuPerSSThenIgnore
mySysInfo.EuCountPerPoolMin = 99999;
mySkuTable.ftrPooledEuEnabled = 0;
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(&myHwInfo));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&myHwInfo));
auto expectedMaxWGS = (mySysInfo.EUCount / mySysInfo.SubSliceCount) *
(mySysInfo.ThreadCount / mySysInfo.EUCount) * 8;
@ -663,7 +663,7 @@ TEST(Device_GetCaps, givenEnabledFtrPooledEuWhenCalculatingMaxEuPerSSThenDontIgn
mySysInfo.EuCountPerPoolMin = 99999;
mySkuTable.ftrPooledEuEnabled = 1;
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(&myHwInfo));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&myHwInfo));
auto expectedMaxWGS = mySysInfo.EuCountPerPoolMin * (mySysInfo.ThreadCount / mySysInfo.EUCount) * 8;
expectedMaxWGS = std::min(Math::prevPowerOfTwo(expectedMaxWGS), 256u);
@ -683,7 +683,7 @@ TEST(Device_GetCaps, givenDebugFlagToUseMaxSimdSizeForWkgCalculationWhenDeviceCa
mySysInfo.EUCount = 24;
mySysInfo.SubSliceCount = 3;
mySysInfo.ThreadCount = 24 * 7;
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(&myHwInfo));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&myHwInfo));
EXPECT_EQ(1024u, device->getDeviceInfo().maxWorkGroupSize);
EXPECT_EQ(device->getDeviceInfo().maxWorkGroupSize / 32, device->getDeviceInfo().maxNumOfSubGroups);
@ -744,7 +744,7 @@ TEST(Device_GetCaps, givenSystemWithNoDriverInfoWhenGettingNameAndVersionThenRet
TEST(Device_GetCaps, GivenFlagEnabled64kbPagesWhenSetThenReturnCorrectValue) {
DebugManagerStateRestore dbgRestore;
bool orgOsEnabled64kbPages = OSInterface::osEnabled64kbPages;
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
HardwareInfo &hwInfo = const_cast<HardwareInfo &>(device->getHardwareInfo());
bool orgftr64KBpages = hwInfo.capabilityTable.ftr64KBpages;

View File

@ -68,7 +68,7 @@ TEST_F(DeviceTest, getTagAddress) {
}
TEST_F(DeviceTest, WhenGetOSTimeThenNotNull) {
auto pDevice = std::unique_ptr<Device>(DeviceHelper<>::create());
auto pDevice = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
OSTime *osTime = pDevice->getOSTime();
ASSERT_NE(nullptr, osTime);
@ -76,7 +76,7 @@ TEST_F(DeviceTest, WhenGetOSTimeThenNotNull) {
TEST_F(DeviceTest, GivenDebugVariableForcing32BitAllocationsWhenDeviceIsCreatedThenMemoryManagerHasForce32BitFlagSet) {
DebugManager.flags.Force32bitAddressing.set(true);
auto pDevice = std::unique_ptr<Device>(DeviceHelper<>::create());
auto pDevice = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
if (is64bit) {
EXPECT_TRUE(pDevice->getDeviceInfo().force32BitAddressess);
EXPECT_TRUE(pDevice->getMemoryManager()->peekForce32BitAllocations());
@ -108,7 +108,7 @@ TEST_F(DeviceTest, getEngineTypeDefault) {
auto pTestDevice = std::unique_ptr<Device>(createWithUsDeviceId(0));
EngineType actualEngineType = pDevice->getEngineType();
EngineType defaultEngineType = hwInfoHelper.capabilityTable.defaultEngineType;
EngineType defaultEngineType = pDevice->getHardwareInfo().capabilityTable.defaultEngineType;
EXPECT_EQ(defaultEngineType, actualEngineType);
}
@ -120,7 +120,7 @@ TEST_F(DeviceTest, givenDebugVariableOverrideEngineTypeWhenDeviceIsCreatedThenUs
auto pTestDevice = std::unique_ptr<Device>(createWithUsDeviceId(0));
EngineType actualEngineType = pTestDevice->getEngineType();
EngineType defaultEngineType = hwInfoHelper.capabilityTable.defaultEngineType;
EngineType defaultEngineType = pDevice->getHardwareInfo().capabilityTable.defaultEngineType;
EXPECT_NE(defaultEngineType, actualEngineType);
EXPECT_EQ(expectedEngine, actualEngineType);

View File

@ -60,7 +60,7 @@ TEST(MockOSTime, DeviceHostDeltaCheck) {
cl_ulong allowedDiff = 0;
float allowedErr = 0.005f;
auto mDev = std::unique_ptr<MockDevice>(DeviceHelper<>::create());
auto mDev = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
mDev->getDeviceAndHostTimer(
&deviceTimestamp[0],

View File

@ -34,7 +34,7 @@ typedef ::testing::Test MockOSTimeWinTest;
HWTEST_F(MockOSTimeWinTest, DynamicResolution) {
auto wddmMock = std::unique_ptr<WddmMock>(new WddmMock());
auto mDev = std::unique_ptr<MockDevice>(DeviceHelper<>::create());
auto mDev = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
bool error = wddmMock->init<FamilyType>();
EXPECT_EQ(1u, wddmMock->createContextResult.called);

View File

@ -36,7 +36,7 @@ struct GetDeviceInfoSize : public ::testing::TestWithParam<std::pair<uint32_t /*
};
TEST_P(GetDeviceInfoSize, sizeIsValid) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create());
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
size_t sizeReturned = 0;
auto retVal = device->getDeviceInfo(
@ -152,7 +152,7 @@ INSTANTIATE_TEST_CASE_P(
testing::ValuesIn(deviceInfoParams2));
TEST(DeviceInfoTests, givenDefaultDeviceWhenQueriedForDeviceVersionThenProperSizeIsReturned) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create());
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
size_t sizeReturned = 0;
auto retVal = device->getDeviceInfo(
CL_DEVICE_VERSION,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2017 - 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@ -28,7 +28,7 @@
using namespace OCLRT;
TEST(GetDeviceInfo, InvalidFlags_returnsError) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create());
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto retVal = device->getDeviceInfo(
0,
@ -39,7 +39,7 @@ TEST(GetDeviceInfo, InvalidFlags_returnsError) {
}
TEST(GetDeviceInfo, devicePlanarYuvMaxWidthHeightReturnsErrorWhenPlanarYuvExtensionDisabled) {
auto device = std::unique_ptr<MockDevice>(DeviceHelper<>::create());
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
device->getDeviceInfoToModify()->nv12Extension = false;
uint32_t value;
@ -62,7 +62,7 @@ TEST(GetDeviceInfo, devicePlanarYuvMaxWidthHeightReturnsErrorWhenPlanarYuvExtens
}
TEST(GetDeviceInfo, devicePlanarYuvMaxWidthHeightReturnsCorrectValuesWhenPlanarYuvExtensionEnabled) {
auto device = std::unique_ptr<MockDevice>(DeviceHelper<>::create());
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
device->getDeviceInfoToModify()->nv12Extension = true;
size_t value = 0;
@ -87,7 +87,7 @@ TEST(GetDeviceInfo, devicePlanarYuvMaxWidthHeightReturnsCorrectValuesWhenPlanarY
}
TEST(GetDeviceInfo, numSimultaneousInterops) {
auto device = std::unique_ptr<MockDevice>(DeviceHelper<>::create());
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
device->simultaneousInterops = {0};
cl_uint value = 0;
@ -106,7 +106,7 @@ TEST(GetDeviceInfo, numSimultaneousInterops) {
}
TEST(GetDeviceInfo, simultaneousInterops) {
auto device = std::unique_ptr<MockDevice>(DeviceHelper<>::create());
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
device->simultaneousInterops = {0};
cl_uint value[4] = {};
@ -123,7 +123,7 @@ TEST(GetDeviceInfo, simultaneousInterops) {
}
TEST(GetDeviceInfo, prefferedInteropUserSync) {
auto device = std::unique_ptr<MockDevice>(DeviceHelper<>::create());
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
cl_bool value = 0;
size_t size = 0;
@ -143,7 +143,7 @@ struct GetDeviceInfo : public ::testing::TestWithParam<uint32_t /*cl_device_info
};
TEST_P(GetDeviceInfo, valid_returnsSuccess) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create());
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
size_t sizeReturned = 0;
auto retVal = device->getDeviceInfo(

View File

@ -57,7 +57,7 @@ TEST(EventCallbackTest, NestedCallbacksAreCalledForUserEvent) {
TEST(EventCallbackTest, NestedCallbacksAreCalledForEvent) {
constructPlatform();
std::unique_ptr<Device> device(DeviceHelper<>::create());
std::unique_ptr<Device> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
MockContext context;
MockCommandQueue queue(&context, device.get(), nullptr);
MockEvent<Event> event(&queue, CL_COMMAND_MARKER, 0, 0);

View File

@ -192,7 +192,7 @@ TEST(Event, waitForEventsFlushesAllQueues) {
uint32_t flushCounter = 0;
};
std::unique_ptr<Device> device(DeviceHelper<>::create());
std::unique_ptr<Device> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
MockContext context;
std::unique_ptr<MockCommandQueueWithFlushCheck> cmdQ1(new MockCommandQueueWithFlushCheck(context, device.get()));
@ -223,7 +223,7 @@ TEST(Event, waitForEventsWithNotReadyEventDoesNotFlushQueue) {
uint32_t flushCounter = 0;
};
std::unique_ptr<Device> device(DeviceHelper<>::create());
std::unique_ptr<Device> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
MockContext context;
std::unique_ptr<MockCommandQueueWithFlushCheck> cmdQ1(new MockCommandQueueWithFlushCheck(context, device.get()));

View File

@ -20,24 +20,16 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include "device_fixture.h"
#include "runtime/command_stream/command_stream_receiver.h"
#include "runtime/helpers/options.h"
#include "gtest/gtest.h"
#include "unit_tests/mocks/mock_ostime.h"
using OCLRT::Device;
using OCLRT::HardwareInfo;
using OCLRT::MockOSTime;
using OCLRT::OSTime;
using OCLRT::platformDevices;
#include "unit_tests/fixtures/device_fixture.h"
namespace OCLRT {
void DeviceFixture::SetUp() {
SetUpImpl(nullptr);
}
void DeviceFixture::SetUpImpl(const OCLRT::HardwareInfo *hardwareInfo) {
pDevice = DeviceHelper<>::create(hardwareInfo);
pDevice = MockDevice::createWithNewExecutionEnvironment<MockDevice>(hardwareInfo);
ASSERT_NE(nullptr, pDevice);
auto &commandStreamReceiver = pDevice->getCommandStreamReceiver();
@ -49,10 +41,11 @@ void DeviceFixture::TearDown() {
delete pDevice;
}
OCLRT::MockDevice *DeviceFixture::createWithUsDeviceId(unsigned short usDeviceId) {
MockDevice *DeviceFixture::createWithUsDeviceId(unsigned short usDeviceId) {
hwInfoHelper = *platformDevices[0];
platformHelper = *platformDevices[0]->pPlatform;
platformHelper.usDeviceID = usDeviceId;
hwInfoHelper.pPlatform = &platformHelper;
return DeviceHelper<>::create(&hwInfoHelper);
return MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfoHelper);
}
} // namespace OCLRT

View File

@ -22,38 +22,20 @@
#pragma once
#include "unit_tests/mocks/mock_device.h"
#include <cassert>
namespace OCLRT {
struct HardwareInfo;
extern const HardwareInfo **platformDevices;
} // namespace OCLRT
struct DeviceDefaults {
};
template <typename DeviceTraits = DeviceDefaults>
struct DeviceHelper {
static OCLRT::MockDevice *create(const OCLRT::HardwareInfo *hardwareInfo = nullptr) {
OCLRT::MockDevice *device = OCLRT::MockDevice::createWithNewExecutionEnvironment<OCLRT::MockDevice>(hardwareInfo);
assert(device != nullptr);
return device;
}
};
struct DeviceFixture {
DeviceFixture()
: pDevice(nullptr),
pTagMemory(nullptr) {
}
void SetUp();
void SetUpImpl(const OCLRT::HardwareInfo *hardwareInfo);
void TearDown();
OCLRT::MockDevice *createWithUsDeviceId(unsigned short usDeviceId);
OCLRT::MockDevice *pDevice;
volatile uint32_t *pTagMemory;
OCLRT::HardwareInfo hwInfoHelper;
PLATFORM platformHelper;
MockDevice *createWithUsDeviceId(unsigned short usDeviceId);
MockDevice *pDevice = nullptr;
volatile uint32_t *pTagMemory = nullptr;
HardwareInfo hwInfoHelper = {};
PLATFORM platformHelper = {};
};
} // namespace OCLRT

View File

@ -24,17 +24,17 @@
#include "unit_tests/fixtures/device_fixture.h"
#include "unit_tests/mocks/mock_context.h"
class EnqueueHandlerTest : public DeviceFixture,
class EnqueueHandlerTest : public OCLRT::DeviceFixture,
public testing::Test {
public:
void SetUp() override {
context = new OCLRT::MockContext;
DeviceFixture::SetUp();
context = new OCLRT::MockContext(pDevice);
}
void TearDown() override {
DeviceFixture::TearDown();
context->decRefInternal();
DeviceFixture::TearDown();
}
OCLRT::MockContext *context;
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2017 - 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@ -108,7 +108,7 @@ class ExecutionModelSchedulerTest : public DeviceFixture,
struct ParentKernelCommandQueueFixture : public CommandQueueHwFixture,
testing::Test {
void SetUp() override {
device = DeviceHelper<>::create();
device = MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr);
CommandQueueHwFixture::SetUp(device, 0);
}
void TearDown() override {

View File

@ -48,7 +48,7 @@ class ExecutionModelKernelFixture : public ProgramFromBinaryTest,
temp.assign(pPlatform->getDevice(0)->getDeviceInfo().clVersion);
if (temp.find("OpenCL 1.2") != std::string::npos) {
pDevice = DeviceHelper<>::create();
pDevice = MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr);
return;
}

View File

@ -39,7 +39,7 @@ namespace iOpenCL {
struct SKernelBinaryHeaderCommon;
}
class KernelImageArgTest : public Test<DeviceFixture> {
class KernelImageArgTest : public Test<OCLRT::DeviceFixture> {
public:
KernelImageArgTest() {
}

View File

@ -33,7 +33,7 @@
using namespace OCLRT;
TEST(CommandTest, mapUnmapSubmitWithoutTerminateFlagFlushesCsr) {
std::unique_ptr<Device> device(DeviceHelper<>::create());
std::unique_ptr<Device> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
std::unique_ptr<MockCommandQueue> cmdQ(new MockCommandQueue(nullptr, device.get(), nullptr));
MockCommandStreamReceiver csr;
csr.setMemoryManager(device->getMemoryManager());
@ -51,7 +51,7 @@ TEST(CommandTest, mapUnmapSubmitWithoutTerminateFlagFlushesCsr) {
}
TEST(CommandTest, mapUnmapSubmitWithTerminateFlagAbortsFlush) {
std::unique_ptr<Device> device(DeviceHelper<>::create());
std::unique_ptr<Device> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
std::unique_ptr<MockCommandQueue> cmdQ(new MockCommandQueue(nullptr, device.get(), nullptr));
MockCommandStreamReceiver csr;
csr.setMemoryManager(device->getMemoryManager());
@ -72,7 +72,7 @@ TEST(CommandTest, mapUnmapSubmitWithTerminateFlagAbortsFlush) {
}
TEST(CommandTest, markerSubmitWithoutTerminateFlagFlushesCsr) {
std::unique_ptr<Device> device(DeviceHelper<>::create());
std::unique_ptr<Device> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
std::unique_ptr<MockCommandQueue> cmdQ(new MockCommandQueue(nullptr, device.get(), nullptr));
MockCommandStreamReceiver csr;
csr.setMemoryManager(device->getMemoryManager());
@ -87,7 +87,7 @@ TEST(CommandTest, markerSubmitWithoutTerminateFlagFlushesCsr) {
}
TEST(CommandTest, markerSubmitWithTerminateFlagAbortsFlush) {
std::unique_ptr<Device> device(DeviceHelper<>::create());
std::unique_ptr<Device> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
std::unique_ptr<MockCommandQueue> cmdQ(new MockCommandQueue(nullptr, device.get(), nullptr));
MockCommandStreamReceiver csr;
MockBuffer buffer;

View File

@ -2084,7 +2084,7 @@ TEST(KernelInfoTest, getArgNumByName) {
}
TEST(KernelTest, getInstructionHeapSizeForExecutionModelReturnsZeroForNormalKernel) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
MockKernelWithInternals kernel(*device);
EXPECT_EQ(0u, kernel.mockKernel->getInstructionHeapSizeForExecutionModel());
@ -2107,7 +2107,7 @@ TEST(KernelTest, setKernelArgUsesBuiltinDispatchInfoBuilderIfAvailable) {
mutable std::vector<std::tuple<uint32_t, size_t, const void *>> receivedArgs;
};
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
MockKernelWithInternals kernel(*device);
kernel.kernelInfo.resizeKernelArgInfoAndRegisterParameter(1);
kernel.mockKernel->initialize();
@ -2172,7 +2172,7 @@ TEST(KernelTest, givenKernelWhenDebugFlagToUseMaxSimdForCalculationsIsUsedThenMa
mySysInfo.EUCount = 24;
mySysInfo.SubSliceCount = 3;
mySysInfo.ThreadCount = 24 * 7;
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(&myHwInfo));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&myHwInfo));
MockKernelWithInternals kernel(*device);
kernel.executionEnvironment.LargestCompiledSIMDSize = 32;

View File

@ -120,7 +120,7 @@ TEST(Buffer, givenReadOnlyHostPtrMemoryWhenBufferIsCreatedWithReadOnlyFlagsThenB
memset(memory, 0xAA, MemoryConstants::pageSize);
std::unique_ptr<MockDevice> device(DeviceHelper<>::create(nullptr));
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
::testing::NiceMock<GMockMemoryManagerFailFirstAllocation> *memoryManager = new ::testing::NiceMock<GMockMemoryManagerFailFirstAllocation>;
device->injectMemoryManager(memoryManager);
@ -150,7 +150,7 @@ TEST(Buffer, givenReadOnlyHostPtrMemoryWhenBufferIsCreatedWithReadOnlyFlagsAndSe
memset(memory, 0xAA, MemoryConstants::pageSize);
std::unique_ptr<MockDevice> device(DeviceHelper<>::create(nullptr));
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
::testing::NiceMock<GMockMemoryManagerFailFirstAllocation> *memoryManager = new ::testing::NiceMock<GMockMemoryManagerFailFirstAllocation>;
device->injectMemoryManager(memoryManager);
@ -176,7 +176,7 @@ TEST(Buffer, givenReadOnlyHostPtrMemoryWhenBufferIsCreatedWithKernelWriteFlagThe
memset(memory, 0xAA, MemoryConstants::pageSize);
std::unique_ptr<MockDevice> device(DeviceHelper<>::create(nullptr));
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
::testing::NiceMock<GMockMemoryManagerFailFirstAllocation> *memoryManager = new ::testing::NiceMock<GMockMemoryManagerFailFirstAllocation>;
device->injectMemoryManager(memoryManager);
@ -196,7 +196,7 @@ TEST(Buffer, givenReadOnlyHostPtrMemoryWhenBufferIsCreatedWithKernelWriteFlagThe
}
TEST(Buffer, givenNullPtrWhenBufferIsCreatedWithKernelReadOnlyFlagsThenBufferAllocationFailsAndReturnsNullptr) {
std::unique_ptr<MockDevice> device(DeviceHelper<>::create(nullptr));
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
::testing::NiceMock<GMockMemoryManagerFailFirstAllocation> *memoryManager = new ::testing::NiceMock<GMockMemoryManagerFailFirstAllocation>;
device->injectMemoryManager(memoryManager);

View File

@ -235,7 +235,7 @@ TEST_F(Image2dFromBufferTest, givenUnalignedImageWidthAndNoSpaceInBufferForAlign
}
TEST_F(Image2dFromBufferTest, ExtensionString) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
std::string extensions = caps.deviceExtensions;
size_t found = extensions.find("cl_khr_image2d_from_buffer");

View File

@ -153,7 +153,7 @@ TEST_P(ImageRedescribeTest, givenImageWithMaxSizesWhenItIsRedescribedThenNewImag
cl_image_format imageFormat;
cl_image_desc imageDesc;
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
auto memoryManager = (OsAgnosticMemoryManager *)context.getMemoryManager();

View File

@ -134,7 +134,7 @@ TEST_F(ImageUnmapTest, givenImageWhenEnqueueMapImageIsCalledTwiceThenAllocatedMe
cl_int retVal;
size_t origin[] = {0, 0, 0};
size_t region[] = {0, 0, 0};
std::unique_ptr<MockDevice> device(DeviceHelper<>::create());
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
std::unique_ptr<CommandQueue> commandQueue(CommandQueue::create(&context, device.get(), nullptr, retVal));
commandQueue->enqueueMapImage(image.get(), CL_FALSE, 0, origin, region, nullptr, nullptr, 0, nullptr, nullptr, retVal);
EXPECT_NE(nullptr, image->getAllocatedMapPtr());

View File

@ -390,7 +390,7 @@ TEST_F(Nv12ImageTest, createNV12UVPlaneImageWithOffsetOfUVPlane) {
HWTEST_F(Nv12ImageTest, checkIfPlanesAreWritten) {
KernelBinaryHelper kbHelper(KernelBinaryHelper::BUILT_INS);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create());
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
char hostPtr[16 * 16 * 16];

View File

@ -675,7 +675,7 @@ class MockPrintfHandler : public PrintfHandler {
};
TEST_F(MemoryAllocatorTest, givenStatelessKernelWithPrintfWhenPrintfSurfaceIsCreatedThenPrintfSurfaceIsPatchedWithBaseAddressOffset) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
MockKernelWithInternals kernel(*device);
MockMultiDispatchInfo multiDispatchInfo(kernel.mockKernel);
SPatchAllocateStatelessPrintfSurface printfSurface;
@ -711,7 +711,7 @@ TEST_F(MemoryAllocatorTest, givenStatelessKernelWithPrintfWhenPrintfSurfaceIsCre
}
HWTEST_F(MemoryAllocatorTest, givenStatefulKernelWithPrintfWhenPrintfSurfaceIsCreatedThenPrintfSurfaceIsPatchedWithCpuAddress) {
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
MockKernelWithInternals kernel(*device);
MockMultiDispatchInfo multiDispatchInfo(kernel.mockKernel);
SPatchAllocateStatelessPrintfSurface printfSurface;
@ -753,7 +753,7 @@ TEST_F(MemoryAllocatorTest, given32BitDeviceWhenPrintfSurfaceIsCreatedThen32BitA
DebugManagerStateRestore dbgRestorer;
if (is64bit) {
DebugManager.flags.Force32bitAddressing.set(true);
auto device = std::unique_ptr<Device>(DeviceHelper<>::create(platformDevices[0]));
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
MockKernelWithInternals kernel(*device);
MockMultiDispatchInfo multiDispatchInfo(kernel.mockKernel);
SPatchAllocateStatelessPrintfSurface printfSurface;

View File

@ -71,7 +71,7 @@ MockContext::~MockContext() {
}
MockContext::MockContext() {
device = DeviceHelper<>::create();
device = MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr);
devices.push_back(device);
memoryManager = device->getMemoryManager();
svmAllocsManager = new SVMAllocsManager(memoryManager);

View File

@ -531,7 +531,7 @@ struct DrmCsrVfeTests : ::testing::Test {
};
HWCMDTEST_F(IGFX_GEN8_CORE, DrmCsrVfeTests, givenNonDirtyVfeForDefaultContextWhenLowPriorityIsFlushedThenReprogram) {
std::unique_ptr<MockDevice> device(DeviceHelper<>::create(nullptr));
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto mockCsr = new MyCsr<FamilyType>;
device->resetCommandStreamReceiver(mockCsr);
@ -559,7 +559,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DrmCsrVfeTests, givenNonDirtyVfeForDefaultContextWhe
}
HWCMDTEST_F(IGFX_GEN8_CORE, DrmCsrVfeTests, givenNonDirtyVfeForLowPriorityContextWhenDefaultPriorityIsFlushedThenReprogram) {
std::unique_ptr<MockDevice> device(DeviceHelper<>::create(nullptr));
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto mockCsr = new MyCsr<FamilyType>;
device->resetCommandStreamReceiver(mockCsr);
@ -587,7 +587,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DrmCsrVfeTests, givenNonDirtyVfeForLowPriorityContex
}
HWCMDTEST_F(IGFX_GEN8_CORE, DrmCsrVfeTests, givenNonDirtyVfeForLowPriorityContextWhenLowPriorityIsFlushedThenDontReprogram) {
std::unique_ptr<MockDevice> device(DeviceHelper<>::create(nullptr));
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto mockCsr = new MyCsr<FamilyType>;
device->resetCommandStreamReceiver(mockCsr);
@ -615,7 +615,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DrmCsrVfeTests, givenNonDirtyVfeForLowPriorityContex
}
HWTEST_F(DrmCsrVfeTests, givenNonDirtyVfeForBothPriorityContextWhenFlushedLowWithScratchRequirementThenMakeDefaultDirty) {
std::unique_ptr<MockDevice> device(DeviceHelper<>::create(nullptr));
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto mockCsr = new MyCsr<FamilyType>;
device->resetCommandStreamReceiver(mockCsr);
@ -636,7 +636,7 @@ HWTEST_F(DrmCsrVfeTests, givenNonDirtyVfeForBothPriorityContextWhenFlushedLowWit
}
HWTEST_F(DrmCsrVfeTests, givenNonDirtyVfeForBothPriorityContextWhenFlushedDefaultWithScratchRequirementThenMakeLowDirty) {
std::unique_ptr<MockDevice> device(DeviceHelper<>::create(nullptr));
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
auto mockCsr = new MyCsr<FamilyType>;
device->resetCommandStreamReceiver(mockCsr);
@ -989,7 +989,7 @@ TEST_F(DrmCommandStreamBatchingTests, givenCsrWhenDispatchPolicyIsSetToBatchingT
tCsr->makeResident(*dummyAllocation);
std::unique_ptr<Device> device(DeviceHelper<>::create(nullptr));
std::unique_ptr<Device> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
tCsr->getMemoryManager()->device = device.get();
@ -1044,7 +1044,7 @@ TEST_F(DrmCommandStreamBatchingTests, givenRecordedCommandBufferWhenItIsSubmitte
auto commandBuffer = mm->allocateGraphicsMemory(1024);
auto dummyAllocation = mm->allocateGraphicsMemory(1024);
IndirectHeap cs(commandBuffer);
std::unique_ptr<Device> device(DeviceHelper<>::create(nullptr));
std::unique_ptr<Device> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
tCsr->getMemoryManager()->device = device.get();
tCsr->setTagAllocation(tagAllocation);

View File

@ -429,7 +429,7 @@ class MyOSTime : public OSTime {
};
int MyOSTime::instanceNum = 0;
TEST(EventProfilingTest, givenEventWhenCompleteIsZeroThenCalcProfilingDataSetsEndTimestampInCompleteTimestampAndDoesntCallOsTimeMethods) {
std::unique_ptr<MockDevice> device(DeviceHelper<>::create());
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
MyOSTime::instanceNum = 0;
device->setOSTime(new MyOSTime());
EXPECT_EQ(1, MyOSTime::instanceNum);

View File

@ -33,7 +33,7 @@
using namespace OCLRT;
TEST(PrintfHandlerTest, givenNotPreparedPrintfHandlerWhenGetSurfaceIsCalledThenResultIsNullptr) {
MockDevice *device = DeviceHelper<>::create();
MockDevice *device = MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr);
MockContext context;
SPatchAllocateStatelessPrintfSurface *pPrintfSurface = new SPatchAllocateStatelessPrintfSurface();
pPrintfSurface->DataParamOffset = 0;
@ -59,7 +59,7 @@ TEST(PrintfHandlerTest, givenNotPreparedPrintfHandlerWhenGetSurfaceIsCalledThenR
}
TEST(PrintfHandlerTest, givenPreparedPrintfHandlerWhenGetSurfaceIsCalledThenResultIsNullptr) {
MockDevice *device = DeviceHelper<>::create();
MockDevice *device = MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr);
MockContext context;
SPatchAllocateStatelessPrintfSurface *pPrintfSurface = new SPatchAllocateStatelessPrintfSurface();
pPrintfSurface->DataParamOffset = 0;
@ -88,7 +88,7 @@ TEST(PrintfHandlerTest, givenPreparedPrintfHandlerWhenGetSurfaceIsCalledThenResu
}
TEST(PrintfHandlerTest, givenParentKernelWihoutPrintfAndBlockKernelWithPrintfWhenPrintfHandlerCreateCalledThenResaultIsAnObject) {
std::unique_ptr<MockDevice> device(DeviceHelper<>::create());
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
std::unique_ptr<MockParentKernel> parentKernelWithoutPrintf(MockParentKernel::create(*device.get(), false, false, false, false));
@ -101,7 +101,7 @@ TEST(PrintfHandlerTest, givenParentKernelWihoutPrintfAndBlockKernelWithPrintfWhe
TEST(PrintfHandlerTest, givenParentKernelAndBlockKernelWithoutPrintfWhenPrintfHandlerCreateCalledThenResaultIsNullptr) {
std::unique_ptr<MockDevice> device(DeviceHelper<>::create());
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
std::unique_ptr<MockParentKernel> blockKernelWithoutPrintf(MockParentKernel::create(*device.get(), false, false, false, false, false));
@ -113,7 +113,7 @@ TEST(PrintfHandlerTest, givenParentKernelAndBlockKernelWithoutPrintfWhenPrintfHa
}
TEST(PrintfHandlerTest, givenParentKernelWithPrintfAndBlockKernelWithoutPrintfWhenPrintfHandlerCreateCalledThenResaultIsAnObject) {
std::unique_ptr<MockDevice> device(DeviceHelper<>::create());
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
std::unique_ptr<MockParentKernel> parentKernelWithPrintfBlockKernelWithoutPrintf(MockParentKernel::create(*device.get(), false, false, false, true, false));

View File

@ -31,7 +31,7 @@ extern std::vector<const char *> SourceFileNames;
extern std::vector<const char *> BinaryForSourceFileNames;
extern std::vector<const char *> KernelNames;
class ProgramTests : public DeviceFixture,
class ProgramTests : public OCLRT::DeviceFixture,
public ::testing::Test,
public OCLRT::ContextFixture {

View File

@ -79,7 +79,7 @@ class MockSchedulerKernel : public SchedulerKernel {
TEST(SchedulerKernelTest, getLws) {
MockProgram program;
auto device = unique_ptr<MockDevice>(DeviceHelper<>::create());
auto device = unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
KernelInfo info;
MockSchedulerKernel kernel(&program, info, *device);
@ -89,7 +89,7 @@ TEST(SchedulerKernelTest, getLws) {
TEST(SchedulerKernelTest, getGws) {
MockProgram program;
auto device = unique_ptr<MockDevice>(DeviceHelper<>::create());
auto device = unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
KernelInfo info;
MockSchedulerKernel kernel(&program, info, *device);
@ -105,7 +105,7 @@ TEST(SchedulerKernelTest, getGws) {
TEST(SchedulerKernelTest, setGws) {
MockProgram program;
auto device = unique_ptr<MockDevice>(DeviceHelper<>::create());
auto device = unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
KernelInfo info;
MockSchedulerKernel kernel(&program, info, *device);
@ -118,7 +118,7 @@ TEST(SchedulerKernelTest, setGws) {
TEST(SchedulerKernelTest, getCurbeSize) {
MockProgram program;
auto device = unique_ptr<MockDevice>(DeviceHelper<>::create());
auto device = unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
KernelInfo info;
uint32_t crossTrheadDataSize = 32;
uint32_t dshSize = 48;
@ -139,7 +139,7 @@ TEST(SchedulerKernelTest, getCurbeSize) {
}
TEST(SchedulerKernelTest, setArgsForSchedulerKernel) {
auto device = unique_ptr<MockDevice>(DeviceHelper<>::create());
auto device = unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
MockProgram program;
program.setDevice(device.get());
@ -166,7 +166,7 @@ TEST(SchedulerKernelTest, setArgsForSchedulerKernel) {
}
TEST(SchedulerKernelTest, setArgsForSchedulerKernelWithNullDebugQueue) {
auto device = unique_ptr<MockDevice>(DeviceHelper<>::create());
auto device = unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
MockProgram program;
program.setDevice(device.get());
@ -196,7 +196,7 @@ TEST(SchedulerKernelTest, createKernelReflectionForForcedSchedulerDispatch) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.ForceDispatchScheduler.set(true);
auto device = unique_ptr<MockDevice>(DeviceHelper<>::create());
auto device = unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
MockProgram program;
program.setDevice(device.get());
@ -211,7 +211,7 @@ TEST(SchedulerKernelTest, createKernelReflectionSecondTimeForForcedSchedulerDisp
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.ForceDispatchScheduler.set(true);
auto device = unique_ptr<MockDevice>(DeviceHelper<>::create());
auto device = unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
MockProgram program;
program.setDevice(device.get());
@ -230,7 +230,7 @@ TEST(SchedulerKernelTest, createKernelReflectionForSchedulerDoesNothing) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.ForceDispatchScheduler.set(false);
auto device = unique_ptr<MockDevice>(DeviceHelper<>::create());
auto device = unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
MockProgram program;
program.setDevice(device.get());
@ -243,7 +243,7 @@ TEST(SchedulerKernelTest, createKernelReflectionForSchedulerDoesNothing) {
TEST(SchedulerKernelTest, getCurbeSizeWithNullKernelInfo) {
MockProgram program;
auto device = unique_ptr<MockDevice>(DeviceHelper<>::create());
auto device = unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
KernelInfo info;
info.patchInfo.dataParameterStream = nullptr;
@ -260,7 +260,7 @@ TEST(SchedulerKernelTest, givenForcedSchedulerGwsByDebugVariableWhenSchedulerKer
DebugManager.flags.SchedulerGWS.set(48);
MockProgram program;
auto device = unique_ptr<MockDevice>(DeviceHelper<>::create());
auto device = unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
KernelInfo info;
MockSchedulerKernel kernel(&program, info, *device);

View File

@ -28,7 +28,7 @@
class SchedulerSourceTest : public testing::Test {
public:
void SetUp() override {
pDevice = DeviceHelper<>::create();
pDevice = OCLRT::MockDevice::createWithNewExecutionEnvironment<OCLRT::MockDevice>(nullptr);
}
void TearDown() override {
delete pDevice;

View File

@ -462,7 +462,7 @@ TEST(SourceLevelDebugger, givenKernelDebuggerLibraryNotActiveWhenDeviceIsCreated
DebuggerLibrary::setDebuggerActive(false);
DebuggerLibrary::injectDebuggerLibraryInterceptor(&interceptor);
unique_ptr<MockDevice> device(DeviceHelper<>::create());
unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
EXPECT_EQ(nullptr, device->getSourceLevelDebugger());
EXPECT_FALSE(interceptor.initCalled);