Separate struct EnqueueOperation declaration and implementation

Change-Id: I537660867a1c98f957280237c14b7a1554fce3db
This commit is contained in:
Zdanowicz, Zbigniew
2018-04-09 16:39:32 +02:00
committed by sys_ocldev
parent 2374b27bf5
commit e51cb6bd0b
15 changed files with 169 additions and 201 deletions

View File

@ -109,7 +109,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueFillBuffer) {
auto usedAfterIOH = ioh.getUsed();
auto usedAfterSSH = ssh.getUsed();
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_FILL_BUFFER>::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo);
auto expectedSizeDSH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredDSH(multiDispatchInfo);
auto expectedSizeIOH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredIOH(multiDispatchInfo);
auto expectedSizeSSH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredSSH(multiDispatchInfo);
@ -160,7 +160,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueCopyBuffer) {
auto usedAfterIOH = ioh.getUsed();
auto usedAfterSSH = ssh.getUsed();
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_COPY_BUFFER>::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo);
auto expectedSizeDSH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredDSH(multiDispatchInfo);
auto expectedSizeIOH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredIOH(multiDispatchInfo);
auto expectedSizeSSH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredSSH(multiDispatchInfo);
@ -212,7 +212,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueReadBufferNonBlocking) {
auto usedAfterIOH = ioh.getUsed();
auto usedAfterSSH = ssh.getUsed();
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_READ_BUFFER>::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo);
auto expectedSizeDSH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredDSH(multiDispatchInfo);
auto expectedSizeIOH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredIOH(multiDispatchInfo);
auto expectedSizeSSH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredSSH(multiDispatchInfo);
@ -265,7 +265,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueReadBufferBlocking) {
auto usedAfterIOH = ioh.getUsed();
auto usedAfterSSH = ssh.getUsed();
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_READ_BUFFER>::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo);
auto expectedSizeDSH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredDSH(multiDispatchInfo);
auto expectedSizeIOH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredIOH(multiDispatchInfo);
auto expectedSizeSSH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredSSH(multiDispatchInfo);
@ -318,7 +318,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueWriteBufferNonBlocking) {
auto usedAfterIOH = ioh.getUsed();
auto usedAfterSSH = ssh.getUsed();
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_WRITE_BUFFER>::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo);
auto expectedSizeDSH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredDSH(multiDispatchInfo);
auto expectedSizeIOH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredIOH(multiDispatchInfo);
auto expectedSizeSSH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredSSH(multiDispatchInfo);
@ -368,7 +368,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueWriteBufferBlocking) {
auto usedAfterIOH = ioh.getUsed();
auto usedAfterSSH = ssh.getUsed();
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_WRITE_BUFFER>::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(false, false, *pCmdQ, multiDispatchInfo);
auto expectedSizeDSH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredDSH(multiDispatchInfo);
auto expectedSizeIOH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredIOH(multiDispatchInfo);
auto expectedSizeSSH = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredSSH(multiDispatchInfo);
@ -406,7 +406,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueKernelHelloWorld) {
auto iohAfter = pIOH->getUsed();
auto sshAfter = pSSH->getUsed();
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_NDRANGE_KERNEL>::getSizeRequiredCS(false, false, *pCmdQ, nullptr);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_NDRANGE_KERNEL, false, false, *pCmdQ, nullptr);
auto expectedSizeDSH = KernelCommandsHelper<FamilyType>::getSizeRequiredDSH(*KernelFixture::pKernel);
auto expectedSizeIOH = KernelCommandsHelper<FamilyType>::getSizeRequiredIOH(*KernelFixture::pKernel, workSize[0]);
auto expectedSizeSSH = KernelCommandsHelper<FamilyType>::getSizeRequiredSSH(*KernelFixture::pKernel);
@ -445,7 +445,7 @@ HWTEST_F(GetSizeRequiredBufferTest, enqueueKernelSimpleArg) {
auto iohAfter = pIOH->getUsed();
auto sshAfter = pSSH->getUsed();
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_NDRANGE_KERNEL>::getSizeRequiredCS(false, false, *pCmdQ, nullptr);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_NDRANGE_KERNEL, false, false, *pCmdQ, nullptr);
auto expectedSizeDSH = KernelCommandsHelper<FamilyType>::getSizeRequiredDSH(*KernelFixture::pKernel);
auto expectedSizeIOH = KernelCommandsHelper<FamilyType>::getSizeRequiredIOH(*KernelFixture::pKernel, workSize[0]);
auto expectedSizeSSH = KernelCommandsHelper<FamilyType>::getSizeRequiredSSH(*KernelFixture::pKernel);

View File

@ -102,7 +102,7 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueCopyImage) {
auto usedAfterIOH = ioh.getUsed();
auto usedAfterSSH = ssh.getUsed();
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_COPY_IMAGE>::getSizeRequiredCS(false, false, *pCmdQ, kernel);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_COPY_IMAGE, false, false, *pCmdQ, kernel);
auto expectedSizeDSH = KernelCommandsHelper<FamilyType>::getSizeRequiredDSH(*kernel);
auto expectedSizeIOH = KernelCommandsHelper<FamilyType>::getSizeRequiredIOH(*kernel);
auto expectedSizeSSH = KernelCommandsHelper<FamilyType>::getSizeRequiredSSH(*kernel);
@ -150,7 +150,7 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueCopyReadAndWriteImage) {
auto usedAfterIOH = ioh.getUsed();
auto usedAfterSSH = ssh.getUsed();
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_COPY_IMAGE>::getSizeRequiredCS(false, false, *pCmdQ, kernel.get());
auto expectedSizeCS = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_COPY_IMAGE, false, false, *pCmdQ, kernel.get());
auto expectedSizeDSH = KernelCommandsHelper<FamilyType>::getSizeRequiredDSH(*kernel.get());
auto expectedSizeIOH = KernelCommandsHelper<FamilyType>::getSizeRequiredIOH(*kernel.get());
auto expectedSizeSSH = KernelCommandsHelper<FamilyType>::getSizeRequiredSSH(*kernel.get());
@ -206,7 +206,7 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueReadImageNonBlocking) {
auto usedAfterIOH = ioh.getUsed();
auto usedAfterSSH = ssh.getUsed();
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_READ_IMAGE>::getSizeRequiredCS(false, false, *pCmdQ, kernel);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_READ_IMAGE, false, false, *pCmdQ, kernel);
auto expectedSizeDSH = KernelCommandsHelper<FamilyType>::getSizeRequiredDSH(*kernel);
auto expectedSizeIOH = KernelCommandsHelper<FamilyType>::getSizeRequiredIOH(*kernel);
auto expectedSizeSSH = KernelCommandsHelper<FamilyType>::getSizeRequiredSSH(*kernel);
@ -260,7 +260,7 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueReadImageBlocking) {
auto usedAfterIOH = ioh.getUsed();
auto usedAfterSSH = ssh.getUsed();
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_READ_IMAGE>::getSizeRequiredCS(false, false, *pCmdQ, kernel);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_READ_IMAGE, false, false, *pCmdQ, kernel);
auto expectedSizeDSH = KernelCommandsHelper<FamilyType>::getSizeRequiredDSH(*kernel);
auto expectedSizeIOH = KernelCommandsHelper<FamilyType>::getSizeRequiredIOH(*kernel);
auto expectedSizeSSH = KernelCommandsHelper<FamilyType>::getSizeRequiredSSH(*kernel);
@ -314,7 +314,7 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueWriteImageNonBlocking) {
auto usedAfterIOH = ioh.getUsed();
auto usedAfterSSH = ssh.getUsed();
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_WRITE_IMAGE>::getSizeRequiredCS(false, false, *pCmdQ, kernel);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_WRITE_IMAGE, false, false, *pCmdQ, kernel);
auto expectedSizeDSH = KernelCommandsHelper<FamilyType>::getSizeRequiredDSH(*kernel);
auto expectedSizeIOH = KernelCommandsHelper<FamilyType>::getSizeRequiredIOH(*kernel);
auto expectedSizeSSH = KernelCommandsHelper<FamilyType>::getSizeRequiredSSH(*kernel);
@ -368,7 +368,7 @@ HWTEST_F(GetSizeRequiredImageTest, enqueueWriteImageBlocking) {
auto usedAfterIOH = ioh.getUsed();
auto usedAfterSSH = ssh.getUsed();
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_WRITE_IMAGE>::getSizeRequiredCS(false, false, *pCmdQ, kernel);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_WRITE_IMAGE, false, false, *pCmdQ, kernel);
auto expectedSizeDSH = KernelCommandsHelper<FamilyType>::getSizeRequiredDSH(*kernel);
auto expectedSizeIOH = KernelCommandsHelper<FamilyType>::getSizeRequiredIOH(*kernel);
auto expectedSizeSSH = KernelCommandsHelper<FamilyType>::getSizeRequiredSSH(*kernel);

View File

@ -222,13 +222,13 @@ HWTEST_F(ParentKernelCommandStreamFixture, GivenDispatchInfoWithParentKernelWhen
DispatchInfo dispatchInfo(mockParentKernel, 1, Vec3<size_t>{24, 1, 1}, Vec3<size_t>{24, 1, 1}, Vec3<size_t>{0, 0, 0});
MultiDispatchInfo multiDispatchInfo;
size_t size = EnqueueOperation<FamilyType, CL_COMMAND_NDRANGE_KERNEL>::getSizeRequiredCS(false, false, *pCmdQ, mockParentKernel);
size_t size = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_NDRANGE_KERNEL, false, false, *pCmdQ, mockParentKernel);
size_t numOfKernels = MemoryConstants::pageSize / size;
size_t rest = MemoryConstants::pageSize - (numOfKernels * size);
SchedulerKernel &scheduler = BuiltIns::getInstance().getSchedulerKernel(*mockParentKernel->getContext());
size_t schedulerSize = EnqueueOperation<FamilyType, CL_COMMAND_NDRANGE_KERNEL>::getSizeRequiredCS(false, false, *pCmdQ, &scheduler);
size_t schedulerSize = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_NDRANGE_KERNEL, false, false, *pCmdQ, &scheduler);
while (rest >= schedulerSize) {
numOfKernels++;

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"),
@ -96,12 +96,12 @@ HWTEST_F(ProfilingTests, GIVENCommandQueueWithProfilingAndForWorkloadWithKernelW
uint64_t requiredSize = 2 * sizeof(PIPE_CONTROL) + 2 * sizeof(MI_STORE_REGISTER_MEM) + sizeof(GPGPU_WALKER) + KernelCommandsHelper<FamilyType>::getSizeRequiredCS();
auto &commandStreamNDRangeKernel = getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*pCmdQ, true, false, nullptr);
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_NDRANGE_KERNEL>::getSizeRequiredCS(true, false, *pCmdQ, nullptr);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_NDRANGE_KERNEL, true, false, *pCmdQ, nullptr);
EXPECT_GE(expectedSizeCS, requiredSize);
EXPECT_GE(commandStreamNDRangeKernel.getAvailableSpace(), requiredSize);
auto &commandStreamTask = getCommandStream<FamilyType, CL_COMMAND_TASK>(*pCmdQ, true, false, nullptr);
expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_TASK>::getSizeRequiredCS(true, false, *pCmdQ, nullptr);
expectedSizeCS = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_TASK, true, false, *pCmdQ, nullptr);
EXPECT_GE(expectedSizeCS, requiredSize);
EXPECT_GE(commandStreamTask.getAvailableSpace(), requiredSize);
}
@ -114,12 +114,12 @@ HWTEST_F(ProfilingTests, GIVENCommandQueueWithProfilingAndForWorkloadWithNoKerne
uint64_t requiredSize = 2 * sizeof(PIPE_CONTROL) + 4 * sizeof(MI_STORE_REGISTER_MEM);
auto &commandStreamMigrateMemObjects = getCommandStream<FamilyType, CL_COMMAND_MIGRATE_MEM_OBJECTS>(*pCmdQ, true, false, nullptr);
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_MIGRATE_MEM_OBJECTS>::getSizeRequiredCS(true, false, *pCmdQ, nullptr);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_MIGRATE_MEM_OBJECTS, true, false, *pCmdQ, nullptr);
EXPECT_GE(expectedSizeCS, requiredSize);
EXPECT_GE(commandStreamMigrateMemObjects.getAvailableSpace(), requiredSize);
auto &commandStreamMarker = getCommandStream<FamilyType, CL_COMMAND_MARKER>(*pCmdQ, true, false, nullptr);
expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_MARKER>::getSizeRequiredCS(true, false, *pCmdQ, nullptr);
expectedSizeCS = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_MARKER, true, false, *pCmdQ, nullptr);
EXPECT_GE(expectedSizeCS, requiredSize);
EXPECT_GE(commandStreamMarker.getAvailableSpace(), requiredSize);
}
@ -138,7 +138,7 @@ HWTEST_F(ProfilingTests, GIVENCommandQueueWithProfilingAndForWorkloadWithTwoKern
MultiDispatchInfo multiDispatchInfo(dispatchInfo);
multiDispatchInfo.push(dispatchInfo);
auto &commandStreamTask = getCommandStream<FamilyType, CL_COMMAND_TASK>(*pCmdQ, true, false, nullptr);
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_TASK>::getTotalSizeRequiredCS(true, false, *pCmdQ, multiDispatchInfo);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(true, false, *pCmdQ, multiDispatchInfo);
EXPECT_GE(expectedSizeCS, requiredSize);
EXPECT_GE(commandStreamTask.getAvailableSpace(), requiredSize);
}
@ -462,12 +462,12 @@ HWTEST_F(ProfilingWithPerfCountersTests, GIVENCommandQueueWithProfilingPerfCount
requiredSize += 2 * sizeof(PIPE_CONTROL) + 3 * sizeof(MI_STORE_REGISTER_MEM) + OCLRT::INSTR_GENERAL_PURPOSE_COUNTERS_COUNT * sizeof(MI_STORE_REGISTER_MEM) + sizeof(MI_REPORT_PERF_COUNT) + pCmdQ->getPerfCountersUserRegistersNumber() * sizeof(MI_STORE_REGISTER_MEM);
auto &commandStreamNDRangeKernel = getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*pCmdQ, true, true, nullptr);
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_NDRANGE_KERNEL>::getSizeRequiredCS(true, true, *pCmdQ, nullptr);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_NDRANGE_KERNEL, true, true, *pCmdQ, nullptr);
EXPECT_GE(expectedSizeCS, requiredSize);
EXPECT_GE(commandStreamNDRangeKernel.getAvailableSpace(), requiredSize);
auto &commandStreamTask = getCommandStream<FamilyType, CL_COMMAND_TASK>(*pCmdQ, true, true, nullptr);
expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_TASK>::getSizeRequiredCS(true, true, *pCmdQ, nullptr);
expectedSizeCS = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_TASK, true, true, *pCmdQ, nullptr);
EXPECT_GE(expectedSizeCS, requiredSize);
EXPECT_GE(commandStreamTask.getAvailableSpace(), requiredSize);
bool retVal = false;
@ -487,12 +487,12 @@ HWTEST_F(ProfilingWithPerfCountersTests, GIVENCommandQueueWithProfilingPerfCount
uint64_t requiredSize = 2 * sizeof(PIPE_CONTROL) + 4 * sizeof(MI_STORE_REGISTER_MEM);
auto &commandStreamMigrateMemObjects = getCommandStream<FamilyType, CL_COMMAND_MIGRATE_MEM_OBJECTS>(*pCmdQ, true, true, nullptr);
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_MIGRATE_MEM_OBJECTS>::getSizeRequiredCS(true, true, *pCmdQ, nullptr);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_MIGRATE_MEM_OBJECTS, true, true, *pCmdQ, nullptr);
EXPECT_GE(expectedSizeCS, requiredSize);
EXPECT_GE(commandStreamMigrateMemObjects.getAvailableSpace(), requiredSize);
auto &commandStreamMarker = getCommandStream<FamilyType, CL_COMMAND_MARKER>(*pCmdQ, true, true, nullptr);
expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_MARKER>::getSizeRequiredCS(true, true, *pCmdQ, nullptr);
expectedSizeCS = EnqueueOperation<FamilyType>::getSizeRequiredCS(CL_COMMAND_MARKER, true, true, *pCmdQ, nullptr);
EXPECT_GE(expectedSizeCS, requiredSize);
EXPECT_GE(commandStreamMarker.getAvailableSpace(), requiredSize);
@ -521,7 +521,7 @@ HWTEST_F(ProfilingWithPerfCountersTests, GIVENCommandQueueWithProfilingPerfCount
MultiDispatchInfo multiDispatchInfo(dispatchInfo);
multiDispatchInfo.push(dispatchInfo);
auto &commandStreamTask = getCommandStream<FamilyType, CL_COMMAND_TASK>(*pCmdQ, true, true, nullptr);
auto expectedSizeCS = EnqueueOperation<FamilyType, CL_COMMAND_TASK>::getTotalSizeRequiredCS(true, true, *pCmdQ, multiDispatchInfo);
auto expectedSizeCS = EnqueueOperation<FamilyType>::getTotalSizeRequiredCS(true, true, *pCmdQ, multiDispatchInfo);
EXPECT_GE(expectedSizeCS, requiredSize);
EXPECT_GE(commandStreamTask.getAvailableSpace(), requiredSize);