mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Fix unit test issues
remove dead store initialize default values in class definition Change-Id: I39abef12104a80df13ace0fb127c4ee24e00b184 Signed-off-by: Jablonski, Mateusz <mateusz.jablonski@intel.com>
This commit is contained in:
@ -50,10 +50,6 @@ struct SimpleArgFixture : public FixtureFactory::IndirectHeapFixture,
|
||||
using KernelFixture::pKernel;
|
||||
using KernelFixture::SetUp;
|
||||
|
||||
SimpleArgFixture()
|
||||
: pDestMemory(nullptr), sizeUserMemory(128 * sizeof(float)) {
|
||||
}
|
||||
|
||||
public:
|
||||
void SetUp() override {
|
||||
DeviceFixture::SetUp();
|
||||
@ -103,10 +99,10 @@ struct SimpleArgFixture : public FixtureFactory::IndirectHeapFixture,
|
||||
DeviceFixture::TearDown();
|
||||
}
|
||||
|
||||
int argVal;
|
||||
void *pDestMemory;
|
||||
void *pExpectedMemory;
|
||||
size_t sizeUserMemory;
|
||||
GraphicsAllocation *outBuffer;
|
||||
int argVal = 0;
|
||||
void *pDestMemory = nullptr;
|
||||
void *pExpectedMemory = nullptr;
|
||||
size_t sizeUserMemory = 128 * sizeof(float);
|
||||
GraphicsAllocation *outBuffer = nullptr;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
@ -62,7 +62,7 @@ struct CommandQueueFixture {
|
||||
ClDevice *device,
|
||||
cl_command_queue_properties properties);
|
||||
|
||||
CommandQueue *pCmdQ;
|
||||
CommandQueue *pCmdQ = nullptr;
|
||||
};
|
||||
|
||||
static const cl_command_queue_properties AllCommandQueueProperties[] = {
|
||||
|
@ -46,10 +46,6 @@ struct EnqueueCopyBufferTest : public CommandEnqueueFixture,
|
||||
public EnqueueCopyBufferHelper,
|
||||
public ::testing::Test {
|
||||
|
||||
EnqueueCopyBufferTest(void)
|
||||
: srcBuffer(nullptr) {
|
||||
}
|
||||
|
||||
void SetUp(void) override {
|
||||
CommandEnqueueFixture::SetUp();
|
||||
|
||||
@ -88,7 +84,7 @@ struct EnqueueCopyBufferTest : public CommandEnqueueFixture,
|
||||
}
|
||||
|
||||
MockContext context;
|
||||
Buffer *srcBuffer;
|
||||
Buffer *dstBuffer;
|
||||
Buffer *srcBuffer = nullptr;
|
||||
Buffer *dstBuffer = nullptr;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
@ -53,10 +53,6 @@ struct EnqueueCopyBufferRectTest : public CommandEnqueueFixture,
|
||||
public EnqueueCopyBufferRectHelper,
|
||||
public ::testing::Test {
|
||||
|
||||
EnqueueCopyBufferRectTest(void) : srcBuffer(nullptr),
|
||||
dstBuffer(nullptr) {
|
||||
}
|
||||
|
||||
struct BufferRect : public BufferDefaults {
|
||||
static const size_t sizeInBytes;
|
||||
};
|
||||
@ -130,8 +126,8 @@ struct EnqueueCopyBufferRectTest : public CommandEnqueueFixture,
|
||||
parseCommands<FamilyType>(*pCmdQ);
|
||||
}
|
||||
|
||||
Buffer *srcBuffer;
|
||||
Buffer *dstBuffer;
|
||||
Buffer *srcBuffer = nullptr;
|
||||
Buffer *dstBuffer = nullptr;
|
||||
|
||||
static const size_t rowPitch = 100;
|
||||
static const size_t slicePitch = 100 * 100;
|
||||
|
@ -20,10 +20,6 @@ namespace NEO {
|
||||
struct EnqueueCopyBufferToImageTest : public CommandEnqueueFixture,
|
||||
public ::testing::Test {
|
||||
|
||||
EnqueueCopyBufferToImageTest() : srcBuffer(nullptr),
|
||||
dstImage(nullptr) {
|
||||
}
|
||||
|
||||
void SetUp() override {
|
||||
CommandEnqueueFixture::SetUp();
|
||||
|
||||
@ -52,18 +48,15 @@ struct EnqueueCopyBufferToImageTest : public CommandEnqueueFixture,
|
||||
parseCommands<FamilyType>(*pCmdQ);
|
||||
}
|
||||
|
||||
MockContext *context;
|
||||
Buffer *srcBuffer;
|
||||
Image *dstImage;
|
||||
MockContext *context = nullptr;
|
||||
Buffer *srcBuffer = nullptr;
|
||||
Image *dstImage = nullptr;
|
||||
};
|
||||
|
||||
struct EnqueueCopyBufferToImageMipMapTest : public CommandEnqueueFixture,
|
||||
public ::testing::Test,
|
||||
public ::testing::WithParamInterface<uint32_t> {
|
||||
|
||||
EnqueueCopyBufferToImageMipMapTest() : srcBuffer(nullptr) {
|
||||
}
|
||||
|
||||
void SetUp(void) override {
|
||||
CommandEnqueueFixture::SetUp();
|
||||
BufferDefaults::context = new MockContext(pClDevice);
|
||||
@ -78,8 +71,8 @@ struct EnqueueCopyBufferToImageMipMapTest : public CommandEnqueueFixture,
|
||||
CommandEnqueueFixture::TearDown();
|
||||
}
|
||||
|
||||
MockContext *context;
|
||||
Buffer *srcBuffer;
|
||||
MockContext *context = nullptr;
|
||||
Buffer *srcBuffer = nullptr;
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
@ -20,10 +20,6 @@ namespace NEO {
|
||||
struct EnqueueCopyImageTest : public CommandEnqueueFixture,
|
||||
public ::testing::Test {
|
||||
|
||||
EnqueueCopyImageTest() : srcImage(nullptr),
|
||||
dstImage(nullptr) {
|
||||
}
|
||||
|
||||
void SetUp(void) override {
|
||||
CommandEnqueueFixture::SetUp();
|
||||
context = new MockContext(pClDevice);
|
||||
@ -49,9 +45,9 @@ struct EnqueueCopyImageTest : public CommandEnqueueFixture,
|
||||
parseCommands<FamilyType>(*pCmdQ);
|
||||
}
|
||||
|
||||
MockContext *context;
|
||||
Image *srcImage;
|
||||
Image *dstImage;
|
||||
MockContext *context = nullptr;
|
||||
Image *srcImage = nullptr;
|
||||
Image *dstImage = nullptr;
|
||||
};
|
||||
|
||||
struct EnqueueCopyImageMipMapTest : public CommandEnqueueFixture,
|
||||
@ -68,6 +64,6 @@ struct EnqueueCopyImageMipMapTest : public CommandEnqueueFixture,
|
||||
CommandEnqueueFixture::TearDown();
|
||||
}
|
||||
|
||||
MockContext *context;
|
||||
MockContext *context = nullptr;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
@ -20,10 +20,6 @@ namespace NEO {
|
||||
struct EnqueueCopyImageToBufferTest : public CommandEnqueueFixture,
|
||||
public ::testing::Test {
|
||||
|
||||
EnqueueCopyImageToBufferTest() : srcImage(nullptr),
|
||||
dstBuffer(nullptr) {
|
||||
}
|
||||
|
||||
void SetUp(void) override {
|
||||
CommandEnqueueFixture::SetUp();
|
||||
BufferDefaults::context = new MockContext(pClDevice);
|
||||
@ -51,18 +47,15 @@ struct EnqueueCopyImageToBufferTest : public CommandEnqueueFixture,
|
||||
parseCommands<FamilyType>(*pCmdQ);
|
||||
}
|
||||
|
||||
MockContext *context;
|
||||
Image *srcImage;
|
||||
Buffer *dstBuffer;
|
||||
MockContext *context = nullptr;
|
||||
Image *srcImage = nullptr;
|
||||
Buffer *dstBuffer = nullptr;
|
||||
};
|
||||
|
||||
struct EnqueueCopyImageToBufferMipMapTest : public CommandEnqueueFixture,
|
||||
public ::testing::Test,
|
||||
public ::testing::WithParamInterface<uint32_t> {
|
||||
|
||||
EnqueueCopyImageToBufferMipMapTest() : dstBuffer(nullptr) {
|
||||
}
|
||||
|
||||
void SetUp(void) override {
|
||||
CommandEnqueueFixture::SetUp();
|
||||
BufferDefaults::context = new MockContext(pClDevice);
|
||||
@ -77,7 +70,7 @@ struct EnqueueCopyImageToBufferMipMapTest : public CommandEnqueueFixture,
|
||||
CommandEnqueueFixture::TearDown();
|
||||
}
|
||||
|
||||
MockContext *context;
|
||||
Buffer *dstBuffer;
|
||||
MockContext *context = nullptr;
|
||||
Buffer *dstBuffer = nullptr;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
@ -15,10 +15,6 @@
|
||||
namespace NEO {
|
||||
|
||||
struct EnqueueFillImageTestFixture : public CommandEnqueueFixture {
|
||||
|
||||
EnqueueFillImageTestFixture() : image(nullptr) {
|
||||
}
|
||||
|
||||
void SetUp(void) override {
|
||||
CommandEnqueueFixture::SetUp();
|
||||
context = new MockContext(pClDevice);
|
||||
@ -40,7 +36,7 @@ struct EnqueueFillImageTestFixture : public CommandEnqueueFixture {
|
||||
parseCommands<FamilyType>(*pCmdQ);
|
||||
}
|
||||
|
||||
MockContext *context;
|
||||
Image *image;
|
||||
MockContext *context = nullptr;
|
||||
Image *image = nullptr;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
@ -18,10 +18,6 @@ namespace NEO {
|
||||
struct EnqueueMapBufferTypeTest : public CommandEnqueueFixture,
|
||||
public ::testing::Test {
|
||||
|
||||
EnqueueMapBufferTypeTest(void)
|
||||
: srcBuffer(nullptr) {
|
||||
}
|
||||
|
||||
void SetUp() override {
|
||||
CommandEnqueueFixture::SetUp();
|
||||
BufferDefaults::context = new MockContext;
|
||||
@ -50,6 +46,6 @@ struct EnqueueMapBufferTypeTest : public CommandEnqueueFixture,
|
||||
parseCommands<FamilyType>(*pCmdQ);
|
||||
}
|
||||
|
||||
Buffer *srcBuffer;
|
||||
Buffer *srcBuffer = nullptr;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
@ -20,11 +20,6 @@ namespace NEO {
|
||||
|
||||
struct EnqueueReadBufferRectTest : public CommandEnqueueFixture,
|
||||
public ::testing::Test {
|
||||
EnqueueReadBufferRectTest(void)
|
||||
: buffer(nullptr),
|
||||
hostPtr(nullptr) {
|
||||
}
|
||||
|
||||
void SetUp() override {
|
||||
CommandEnqueueFixture::SetUp();
|
||||
context.reset(new MockContext(pCmdQ->getDevice().getSpecializedDevice<ClDevice>()));
|
||||
@ -46,8 +41,8 @@ struct EnqueueReadBufferRectTest : public CommandEnqueueFixture,
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
nonZeroCopyBuffer.reset(nullptr);
|
||||
buffer.reset(nullptr);
|
||||
nonZeroCopyBuffer.reset();
|
||||
buffer.reset();
|
||||
::alignedFree(hostPtr);
|
||||
|
||||
context.reset();
|
||||
@ -85,7 +80,7 @@ struct EnqueueReadBufferRectTest : public CommandEnqueueFixture,
|
||||
std::unique_ptr<MockContext> context;
|
||||
std::unique_ptr<Buffer> buffer;
|
||||
std::unique_ptr<Buffer> nonZeroCopyBuffer;
|
||||
void *hostPtr;
|
||||
void *hostPtr = nullptr;
|
||||
|
||||
static const size_t rowPitch = 100;
|
||||
static const size_t slicePitch = 100 * 100;
|
||||
|
@ -22,10 +22,6 @@ struct EnqueueReadImageTest : public CommandEnqueueFixture,
|
||||
typedef CommandQueueHwFixture CommandQueueFixture;
|
||||
using CommandQueueHwFixture::pCmdQ;
|
||||
|
||||
EnqueueReadImageTest() : dstPtr(nullptr),
|
||||
srcImage(nullptr) {
|
||||
}
|
||||
|
||||
void SetUp(void) override {
|
||||
CommandEnqueueFixture::SetUp();
|
||||
|
||||
@ -52,9 +48,9 @@ struct EnqueueReadImageTest : public CommandEnqueueFixture,
|
||||
parseCommands<FamilyType>(*pCmdQ);
|
||||
}
|
||||
|
||||
float *dstPtr;
|
||||
Image *srcImage;
|
||||
MockContext *context;
|
||||
float *dstPtr = nullptr;
|
||||
Image *srcImage = nullptr;
|
||||
MockContext *context = nullptr;
|
||||
};
|
||||
|
||||
struct EnqueueReadImageMipMapTest : public EnqueueReadImageTest,
|
||||
|
@ -21,11 +21,6 @@ namespace NEO {
|
||||
|
||||
struct EnqueueWriteBufferRectTest : public CommandEnqueueFixture,
|
||||
public ::testing::Test {
|
||||
EnqueueWriteBufferRectTest(void)
|
||||
: buffer(nullptr),
|
||||
hostPtr(nullptr) {
|
||||
}
|
||||
|
||||
void SetUp() override {
|
||||
CommandEnqueueFixture::SetUp();
|
||||
context.reset(new MockContext(pClDevice));
|
||||
@ -48,10 +43,10 @@ struct EnqueueWriteBufferRectTest : public CommandEnqueueFixture,
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
buffer.reset(nullptr);
|
||||
nonZeroCopyBuffer.reset(nullptr);
|
||||
buffer.reset();
|
||||
nonZeroCopyBuffer.reset();
|
||||
::alignedFree(hostPtr);
|
||||
context.reset(nullptr);
|
||||
context.reset();
|
||||
CommandEnqueueFixture::TearDown();
|
||||
}
|
||||
|
||||
@ -87,7 +82,7 @@ struct EnqueueWriteBufferRectTest : public CommandEnqueueFixture,
|
||||
std::unique_ptr<Buffer> buffer;
|
||||
std::unique_ptr<Buffer> nonZeroCopyBuffer;
|
||||
|
||||
void *hostPtr;
|
||||
void *hostPtr = nullptr;
|
||||
|
||||
static const size_t rowPitch = 100;
|
||||
static const size_t slicePitch = 100 * 100;
|
||||
|
@ -20,10 +20,6 @@ namespace NEO {
|
||||
struct EnqueueWriteImageTest : public CommandEnqueueFixture,
|
||||
public ::testing::Test {
|
||||
|
||||
EnqueueWriteImageTest() : srcPtr(nullptr),
|
||||
dstImage(nullptr) {
|
||||
}
|
||||
|
||||
void SetUp(void) override {
|
||||
CommandEnqueueFixture::SetUp();
|
||||
|
||||
@ -52,9 +48,9 @@ struct EnqueueWriteImageTest : public CommandEnqueueFixture,
|
||||
parseCommands<FamilyType>(*pCmdQ);
|
||||
}
|
||||
|
||||
float *srcPtr;
|
||||
Image *dstImage;
|
||||
MockContext *context;
|
||||
float *srcPtr = nullptr;
|
||||
Image *dstImage = nullptr;
|
||||
MockContext *context = nullptr;
|
||||
};
|
||||
|
||||
struct EnqueueWriteImageMipMapTest : public EnqueueWriteImageTest,
|
||||
|
@ -13,20 +13,15 @@
|
||||
namespace NEO {
|
||||
|
||||
struct CommandStreamFixture {
|
||||
CommandStreamFixture(void)
|
||||
: pCS(nullptr),
|
||||
pCmdBuffer(nullptr) {
|
||||
}
|
||||
|
||||
void SetUp(CommandQueue *pCmdQ) {
|
||||
pCS = &pCmdQ->getCS(1024);
|
||||
pCmdBuffer = pCS->getCpuBase();
|
||||
}
|
||||
|
||||
virtual void TearDown(void) {
|
||||
virtual void TearDown() {
|
||||
}
|
||||
|
||||
LinearStream *pCS;
|
||||
void *pCmdBuffer;
|
||||
LinearStream *pCS = nullptr;
|
||||
void *pCmdBuffer = nullptr;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
@ -33,9 +33,6 @@ void CL_CALLBACK callbackFunction(const char *providedHint, const void *flags, s
|
||||
struct DriverDiagnosticsTest : public PlatformFixture,
|
||||
public ::testing::Test {
|
||||
using PlatformFixture::SetUp;
|
||||
DriverDiagnosticsTest() : retVal(CL_SUCCESS) {
|
||||
}
|
||||
|
||||
void SetUp() override {
|
||||
PlatformFixture::SetUp();
|
||||
memset(userData, 0, maxHintCounter * DriverDiagnostics::maxHintStringSize);
|
||||
@ -45,9 +42,9 @@ struct DriverDiagnosticsTest : public PlatformFixture,
|
||||
PlatformFixture::TearDown();
|
||||
}
|
||||
|
||||
cl_int retVal;
|
||||
char userData[maxHintCounter * DriverDiagnostics::maxHintStringSize];
|
||||
char expectedHint[DriverDiagnostics::maxHintStringSize];
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
char userData[maxHintCounter * DriverDiagnostics::maxHintStringSize]{};
|
||||
char expectedHint[DriverDiagnostics::maxHintStringSize]{};
|
||||
};
|
||||
|
||||
struct VerboseLevelTest : public DriverDiagnosticsTest,
|
||||
@ -101,10 +98,10 @@ struct PerformanceHintBufferTest : public PerformanceHintTest,
|
||||
alignedFree(address);
|
||||
PerformanceHintTest::TearDown();
|
||||
}
|
||||
bool alignedSize;
|
||||
bool alignedAddress;
|
||||
void *address;
|
||||
Buffer *buffer;
|
||||
bool alignedSize = false;
|
||||
bool alignedAddress = false;
|
||||
void *address = nullptr;
|
||||
Buffer *buffer = nullptr;
|
||||
};
|
||||
|
||||
struct PerformanceHintCommandQueueTest : public PerformanceHintTest,
|
||||
@ -123,11 +120,11 @@ struct PerformanceHintCommandQueueTest : public PerformanceHintTest,
|
||||
delete clDevice;
|
||||
PerformanceHintTest::TearDown();
|
||||
}
|
||||
MockDevice *device;
|
||||
MockClDevice *clDevice;
|
||||
cl_command_queue cmdQ;
|
||||
bool profilingEnabled;
|
||||
bool preemptionSupported;
|
||||
MockDevice *device = nullptr;
|
||||
MockClDevice *clDevice = nullptr;
|
||||
cl_command_queue cmdQ = nullptr;
|
||||
bool profilingEnabled = false;
|
||||
bool preemptionSupported = false;
|
||||
};
|
||||
|
||||
struct PerformanceHintEnqueueTest : public PerformanceHintTest {
|
||||
@ -158,8 +155,8 @@ struct PerformanceHintEnqueueBufferTest : public PerformanceHintEnqueueTest {
|
||||
alignedFree(address);
|
||||
PerformanceHintEnqueueTest::TearDown();
|
||||
}
|
||||
void *address;
|
||||
Buffer *buffer;
|
||||
void *address = nullptr;
|
||||
Buffer *buffer = nullptr;
|
||||
};
|
||||
|
||||
struct PerformanceHintEnqueueReadBufferTest : public PerformanceHintEnqueueBufferTest,
|
||||
@ -173,8 +170,8 @@ struct PerformanceHintEnqueueReadBufferTest : public PerformanceHintEnqueueBuffe
|
||||
void TearDown() override {
|
||||
PerformanceHintEnqueueBufferTest::TearDown();
|
||||
}
|
||||
bool alignedSize;
|
||||
bool alignedAddress;
|
||||
bool alignedSize = false;
|
||||
bool alignedAddress = false;
|
||||
};
|
||||
|
||||
struct PerformanceHintEnqueueImageTest : public PerformanceHintEnqueueTest {
|
||||
@ -192,8 +189,8 @@ struct PerformanceHintEnqueueImageTest : public PerformanceHintEnqueueTest {
|
||||
alignedFree(address);
|
||||
PerformanceHintEnqueueTest::TearDown();
|
||||
}
|
||||
void *address;
|
||||
Image *image;
|
||||
void *address = nullptr;
|
||||
Image *image = nullptr;
|
||||
std::unique_ptr<Image> zeroCopyImage;
|
||||
};
|
||||
|
||||
@ -208,8 +205,8 @@ struct PerformanceHintEnqueueReadImageTest : public PerformanceHintEnqueueImageT
|
||||
void TearDown() override {
|
||||
PerformanceHintEnqueueImageTest::TearDown();
|
||||
}
|
||||
bool alignedSize;
|
||||
bool alignedAddress;
|
||||
bool alignedSize = false;
|
||||
bool alignedAddress = false;
|
||||
};
|
||||
|
||||
struct PerformanceHintEnqueueMapTest : public PerformanceHintEnqueueTest,
|
||||
@ -243,8 +240,8 @@ struct PerformanceHintEnqueueKernelTest : public PerformanceHintEnqueueTest,
|
||||
ProgramFixture::TearDown();
|
||||
PerformanceHintEnqueueTest::TearDown();
|
||||
}
|
||||
Kernel *kernel;
|
||||
size_t globalWorkGroupSize[3];
|
||||
Kernel *kernel = nullptr;
|
||||
size_t globalWorkGroupSize[3]{};
|
||||
};
|
||||
|
||||
struct PerformanceHintEnqueueKernelBadSizeTest : public PerformanceHintEnqueueKernelTest,
|
||||
@ -279,8 +276,8 @@ struct PerformanceHintEnqueueKernelPrintfTest : public PerformanceHintEnqueueTes
|
||||
ProgramFixture::TearDown();
|
||||
PerformanceHintEnqueueTest::TearDown();
|
||||
}
|
||||
Kernel *kernel;
|
||||
size_t globalWorkGroupSize[3];
|
||||
Kernel *kernel = nullptr;
|
||||
size_t globalWorkGroupSize[3]{};
|
||||
};
|
||||
|
||||
struct PerformanceHintKernelTest : public PerformanceHintTest,
|
||||
@ -294,5 +291,5 @@ struct PerformanceHintKernelTest : public PerformanceHintTest,
|
||||
void TearDown() override {
|
||||
PerformanceHintTest::TearDown();
|
||||
}
|
||||
bool zeroSized;
|
||||
bool zeroSized = false;
|
||||
};
|
||||
|
@ -19,5 +19,5 @@ class BuiltInFixture {
|
||||
void SetUp(NEO::Device *pDevice);
|
||||
void TearDown();
|
||||
|
||||
NEO::BuiltIns *pBuiltIns;
|
||||
NEO::BuiltIns *pBuiltIns = nullptr;
|
||||
};
|
||||
|
@ -19,6 +19,6 @@ class ContextFixture {
|
||||
virtual void SetUp(cl_uint numDevices, cl_device_id *pDeviceList);
|
||||
virtual void TearDown();
|
||||
|
||||
MockContext *pContext;
|
||||
MockContext *pContext = nullptr;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
@ -43,15 +43,13 @@ class DeviceQueueFixture {
|
||||
delete pDevQueue;
|
||||
}
|
||||
|
||||
DeviceQueue *pDevQueue;
|
||||
DeviceQueue *pDevQueue = nullptr;
|
||||
};
|
||||
|
||||
class ExecutionModelKernelTest : public ExecutionModelKernelFixture,
|
||||
public CommandQueueHwFixture,
|
||||
public DeviceQueueFixture {
|
||||
public:
|
||||
ExecutionModelKernelTest(){};
|
||||
|
||||
void SetUp() override {
|
||||
DebugManager.flags.EnableTimestampPacket.set(0);
|
||||
ExecutionModelKernelFixture::SetUp();
|
||||
@ -82,8 +80,6 @@ class ExecutionModelSchedulerTest : public DeviceFixture,
|
||||
public CommandQueueHwFixture,
|
||||
public DeviceQueueFixture {
|
||||
public:
|
||||
ExecutionModelSchedulerTest(){};
|
||||
|
||||
void SetUp() override {
|
||||
DeviceFixture::SetUp();
|
||||
CommandQueueHwFixture::SetUp(pClDevice, 0);
|
||||
@ -101,7 +97,7 @@ class ExecutionModelSchedulerTest : public DeviceFixture,
|
||||
DeviceFixture::TearDown();
|
||||
}
|
||||
|
||||
MockParentKernel *parentKernel;
|
||||
MockParentKernel *parentKernel = nullptr;
|
||||
};
|
||||
|
||||
struct ParentKernelCommandQueueFixture : public CommandQueueHwFixture,
|
||||
@ -125,5 +121,5 @@ struct ParentKernelCommandQueueFixture : public CommandQueueHwFixture,
|
||||
return std::make_unique<KernelOperation>(commandStream, *gpgpuCsr.getInternalAllocationStorage());
|
||||
}
|
||||
|
||||
MockClDevice *device;
|
||||
MockClDevice *device = nullptr;
|
||||
};
|
||||
|
@ -50,13 +50,6 @@ struct HelloWorldFixture : public FixtureFactory::IndirectHeapFixture,
|
||||
using IndirectHeapFixture::SetUp;
|
||||
using KernelFixture::pKernel;
|
||||
|
||||
HelloWorldFixture() : pSrcMemory(nullptr),
|
||||
pDestMemory(nullptr),
|
||||
sizeUserMemory(128 * sizeof(float)),
|
||||
kernelFilename("CopyBuffer_simd"),
|
||||
kernelName("CopyBuffer") {
|
||||
}
|
||||
|
||||
public:
|
||||
void SetUp() override {
|
||||
DeviceFixture::SetUp();
|
||||
@ -109,13 +102,13 @@ struct HelloWorldFixture : public FixtureFactory::IndirectHeapFixture,
|
||||
BufferDefaults::context->release();
|
||||
DeviceFixture::TearDown();
|
||||
}
|
||||
Buffer *srcBuffer;
|
||||
Buffer *destBuffer;
|
||||
void *pSrcMemory;
|
||||
void *pDestMemory;
|
||||
size_t sizeUserMemory;
|
||||
const char *kernelFilename;
|
||||
const char *kernelName;
|
||||
Buffer *srcBuffer = nullptr;
|
||||
Buffer *destBuffer = nullptr;
|
||||
void *pSrcMemory = nullptr;
|
||||
void *pDestMemory = nullptr;
|
||||
size_t sizeUserMemory = 128 * sizeof(float);
|
||||
const char *kernelFilename = "CopyBuffer_simd";
|
||||
const char *kernelName = "CopyBuffer";
|
||||
const int srcPattern = 85;
|
||||
const int destPattern = 170;
|
||||
|
||||
|
@ -21,9 +21,9 @@ class PlatformFixture {
|
||||
void SetUp();
|
||||
void TearDown();
|
||||
|
||||
Platform *pPlatform;
|
||||
Platform *pPlatform = nullptr;
|
||||
|
||||
cl_uint num_devices;
|
||||
cl_device_id *devices;
|
||||
cl_uint num_devices = 0u;
|
||||
cl_device_id *devices = nullptr;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
@ -18,10 +18,6 @@ namespace NEO {
|
||||
|
||||
class ProgramFixture {
|
||||
public:
|
||||
ProgramFixture() : pProgram(nullptr),
|
||||
knownSource(nullptr),
|
||||
knownSourceSize(0) {}
|
||||
|
||||
void CreateProgramFromBinary(cl_context context,
|
||||
cl_device_id *pDeviceList,
|
||||
const std::string &binaryFileName,
|
||||
@ -52,8 +48,8 @@ class ProgramFixture {
|
||||
knownSource.reset();
|
||||
}
|
||||
|
||||
MockProgram *pProgram;
|
||||
MockProgram *pProgram = nullptr;
|
||||
std::unique_ptr<char[]> knownSource;
|
||||
size_t knownSourceSize;
|
||||
size_t knownSourceSize = 0u;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
@ -74,9 +74,6 @@ class SimpleArgKernelFixture : public ProgramFixture {
|
||||
|
||||
public:
|
||||
using ProgramFixture::SetUp;
|
||||
SimpleArgKernelFixture()
|
||||
: retVal(CL_SUCCESS), pKernel(nullptr) {
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void SetUp(ClDevice *pDevice) {
|
||||
@ -134,17 +131,14 @@ class SimpleArgKernelFixture : public ProgramFixture {
|
||||
ProgramFixture::TearDown();
|
||||
}
|
||||
|
||||
cl_int retVal;
|
||||
Kernel *pKernel;
|
||||
MockContext *pContext;
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
Kernel *pKernel = nullptr;
|
||||
MockContext *pContext = nullptr;
|
||||
};
|
||||
|
||||
class SimpleArgNonUniformKernelFixture : public ProgramFixture {
|
||||
public:
|
||||
using ProgramFixture::SetUp;
|
||||
SimpleArgNonUniformKernelFixture()
|
||||
: retVal(CL_SUCCESS), kernel(nullptr) {
|
||||
}
|
||||
|
||||
protected:
|
||||
void SetUp(ClDevice *device, Context *context) {
|
||||
@ -186,8 +180,8 @@ class SimpleArgNonUniformKernelFixture : public ProgramFixture {
|
||||
ProgramFixture::TearDown();
|
||||
}
|
||||
|
||||
cl_int retVal;
|
||||
Kernel *kernel;
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
Kernel *kernel = nullptr;
|
||||
};
|
||||
|
||||
class SimpleKernelFixture : public ProgramFixture {
|
||||
@ -250,7 +244,6 @@ class SimpleKernelStatelessFixture : public ProgramFixture {
|
||||
public:
|
||||
DebugManagerStateRestore restorer;
|
||||
using ProgramFixture::SetUp;
|
||||
SimpleKernelStatelessFixture() = default;
|
||||
|
||||
protected:
|
||||
void SetUp(ClDevice *device, Context *context) {
|
||||
|
@ -48,9 +48,9 @@ class TestEnvironment : public ::testing::Environment {
|
||||
virtual std::string &igcGetMockFile();
|
||||
|
||||
protected:
|
||||
OsLibrary *libraryFrontEnd;
|
||||
OsLibrary *libraryIGC;
|
||||
OsLibrary *libraryOS;
|
||||
OsLibrary *libraryFrontEnd = nullptr;
|
||||
OsLibrary *libraryIGC = nullptr;
|
||||
OsLibrary *libraryOS = nullptr;
|
||||
|
||||
std::vector<MockCompilerDebugVars> igcDebugVarStack;
|
||||
std::vector<MockCompilerDebugVars> fclDebugVarStack;
|
||||
@ -58,14 +58,14 @@ class TestEnvironment : public ::testing::Environment {
|
||||
void (*igcSetDebugVarsFPtr)(MockCompilerDebugVars &debugVars);
|
||||
void (*fclSetDebugVarsFptr)(MockCompilerDebugVars &debugVars);
|
||||
|
||||
MockCompilerDebugVars fclDefaultDebugVars;
|
||||
MockCompilerDebugVars igcDefaultDebugVars;
|
||||
HardwareInfo hwInfoDefaultDebugVars;
|
||||
MockCompilerDebugVars fclDefaultDebugVars{};
|
||||
MockCompilerDebugVars igcDefaultDebugVars{};
|
||||
HardwareInfo hwInfoDefaultDebugVars{};
|
||||
|
||||
std::string fclMockFile;
|
||||
std::string igcMockFile;
|
||||
std::string fclMockFile{};
|
||||
std::string igcMockFile{};
|
||||
|
||||
MockCompilerEnableGuard mockCompilerGuard;
|
||||
MockCompilerEnableGuard mockCompilerGuard{};
|
||||
};
|
||||
|
||||
extern TestEnvironment *gEnvironment;
|
||||
|
@ -47,7 +47,7 @@ struct GenericCmdValidator : CmdValidatorWithStaticStorage<GenericCmdValidator<C
|
||||
|
||||
struct NamedValidator {
|
||||
NamedValidator(CmdValidator *validator)
|
||||
: validator(validator), name("Unspecified") {
|
||||
: NamedValidator(validator, "Unspecified") {
|
||||
}
|
||||
|
||||
NamedValidator(CmdValidator *validator, const char *name)
|
||||
@ -69,7 +69,7 @@ struct MatchCmd {
|
||||
}
|
||||
|
||||
MatchCmd(int amount)
|
||||
: amount(amount), matchesAny(false) {
|
||||
: MatchCmd(amount, false) {
|
||||
}
|
||||
|
||||
virtual ~MatchCmd() = default;
|
||||
|
@ -14,17 +14,12 @@ namespace NEO {
|
||||
class CommandQueue;
|
||||
|
||||
struct IndirectHeapFixture {
|
||||
IndirectHeapFixture() : pDSH(nullptr),
|
||||
pIOH(nullptr),
|
||||
pSSH(nullptr) {
|
||||
}
|
||||
|
||||
virtual void SetUp(CommandQueue *pCmdQ);
|
||||
virtual void TearDown() {
|
||||
}
|
||||
|
||||
IndirectHeap *pDSH;
|
||||
IndirectHeap *pIOH;
|
||||
IndirectHeap *pSSH;
|
||||
IndirectHeap *pDSH = nullptr;
|
||||
IndirectHeap *pIOH = nullptr;
|
||||
IndirectHeap *pSSH = nullptr;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
@ -22,10 +22,6 @@ using CreatorFuncT = CIF::ICIF *(*)(CIF::InterfaceId_t intId, CIF::Version_t ver
|
||||
|
||||
template <typename BaseType = CIF::ICIF>
|
||||
struct MockCIF : BaseType {
|
||||
MockCIF()
|
||||
: refCount(1) {
|
||||
}
|
||||
|
||||
void Release() override {
|
||||
auto prev = refCount--;
|
||||
assert(prev >= 1);
|
||||
@ -53,7 +49,7 @@ struct MockCIF : BaseType {
|
||||
return true; // by default : no sub-interface are supported
|
||||
}
|
||||
|
||||
uint32_t refCount;
|
||||
uint32_t refCount = 1u;
|
||||
};
|
||||
|
||||
struct MockCIFMain : MockCIF<CIF::CIFMain> {
|
||||
|
@ -438,9 +438,7 @@ class MockParentKernel : public Kernel {
|
||||
info->childrenKernelsIdOffset.push_back({0, crossThreadOffset});
|
||||
}
|
||||
|
||||
crossThreadOffset += 8;
|
||||
|
||||
assert(crossThreadSize >= crossThreadOffset);
|
||||
UNRECOVERABLE_IF(crossThreadSize < crossThreadOffset + 8);
|
||||
info->crossThreadData = new char[crossThreadSize];
|
||||
|
||||
auto clDevice = device.getSpecializedDevice<ClDevice>();
|
||||
|
@ -19,31 +19,21 @@ namespace NEO {
|
||||
|
||||
class OfflineCompilerTests : public ::testing::Test {
|
||||
public:
|
||||
OfflineCompilerTests() : pOfflineCompiler(nullptr),
|
||||
retVal(CL_SUCCESS) {
|
||||
uniqueHelper = std::make_unique<OclocArgHelper>();
|
||||
// ctor
|
||||
}
|
||||
|
||||
OfflineCompiler *pOfflineCompiler;
|
||||
int retVal;
|
||||
std::unique_ptr<OclocArgHelper> uniqueHelper;
|
||||
OfflineCompiler *pOfflineCompiler = nullptr;
|
||||
int retVal = CL_SUCCESS;
|
||||
std::unique_ptr<OclocArgHelper> uniqueHelper = std::make_unique<OclocArgHelper>();
|
||||
};
|
||||
|
||||
class MultiCommandTests : public ::testing::Test {
|
||||
public:
|
||||
MultiCommandTests() : pMultiCommand(nullptr),
|
||||
retVal(CL_SUCCESS) {
|
||||
uniqueHelper = std::make_unique<OclocArgHelper>();
|
||||
}
|
||||
void createFileWithArgs(const std::vector<std::string> &, int numOfBuild);
|
||||
void deleteFileWithArgs();
|
||||
void deleteOutFileList();
|
||||
MultiCommand *pMultiCommand;
|
||||
MultiCommand *pMultiCommand = nullptr;
|
||||
std::string nameOfFileWithArgs;
|
||||
std::string outFileList;
|
||||
int retVal;
|
||||
std::unique_ptr<OclocArgHelper> uniqueHelper;
|
||||
int retVal = CL_SUCCESS;
|
||||
std::unique_ptr<OclocArgHelper> uniqueHelper = std::make_unique<OclocArgHelper>();
|
||||
};
|
||||
|
||||
void MultiCommandTests::createFileWithArgs(const std::vector<std::string> &singleArgs, int numOfBuild) {
|
||||
|
@ -29,11 +29,6 @@ class ProgramFromBinaryTest : public DeviceFixture,
|
||||
using ContextFixture::SetUp;
|
||||
|
||||
protected:
|
||||
ProgramFromBinaryTest() : BinaryFileName(nullptr),
|
||||
KernelName(nullptr),
|
||||
retVal(CL_SUCCESS) {
|
||||
}
|
||||
|
||||
void SetUp() override {
|
||||
std::tie(BinaryFileName, KernelName) = GetParam();
|
||||
|
||||
@ -60,9 +55,9 @@ class ProgramFromBinaryTest : public DeviceFixture,
|
||||
options = optionsIn;
|
||||
}
|
||||
|
||||
const char *BinaryFileName;
|
||||
const char *KernelName;
|
||||
cl_int retVal;
|
||||
const char *BinaryFileName = nullptr;
|
||||
const char *KernelName = nullptr;
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
std::string options;
|
||||
};
|
||||
|
||||
@ -76,9 +71,6 @@ class ProgramSimpleFixture : public DeviceFixture,
|
||||
using ContextFixture::SetUp;
|
||||
|
||||
public:
|
||||
ProgramSimpleFixture() : retVal(CL_SUCCESS) {
|
||||
}
|
||||
|
||||
void SetUp() override {
|
||||
DeviceFixture::SetUp();
|
||||
|
||||
@ -95,6 +87,6 @@ class ProgramSimpleFixture : public DeviceFixture,
|
||||
}
|
||||
|
||||
protected:
|
||||
cl_int retVal;
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
Reference in New Issue
Block a user