Move common code to shared directory

Change-Id: I5f604de01e06d35cc1e045fffdd4a26d88ffca8c
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2020-10-06 11:54:04 +02:00
committed by sys_ocldev
parent caa212dcf3
commit 47f5867e8f
20 changed files with 48 additions and 48 deletions

View File

@ -885,7 +885,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DispatchWalkerTest, GivenMultipleKernelsWhenDispatch
// create Indirect DSH heap
auto &indirectHeap = pCmdQ->getIndirectHeap(IndirectHeap::DYNAMIC_STATE, 8192);
indirectHeap.align(HardwareCommandsHelper<FamilyType>::alignInterfaceDescriptorData);
indirectHeap.align(EncodeStates<FamilyType>::alignInterfaceDescriptorData);
auto dshBeforeMultiDisptach = indirectHeap.getUsed();
HardwareInterface<FamilyType>::dispatchWalker(

View File

@ -6,6 +6,7 @@
*/
#include "shared/source/helpers/pause_on_gpu_properties.h"
#include "shared/source/helpers/preamble.h"
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
@ -461,7 +462,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueKernelTest, givenSecondEnqueueWithTheSameScra
MockKernelWithInternals mockKernel(*pClDevice);
mockKernel.kernelInfo.patchInfo.mediavfestate = &mediaVFEstate;
auto sizeToProgram = Kernel::getScratchSizeValueToProgramMediaVfeState(scratchSize);
auto sizeToProgram = PreambleHelper<FamilyType>::getScratchSizeValueToProgramMediaVfeState(scratchSize);
pCmdQ->enqueueKernel(mockKernel.mockKernel, 1, off, gws, nullptr, 0, nullptr, nullptr);
hwParser.parseCommands<FamilyType>(*pCmdQ);

View File

@ -27,8 +27,8 @@
using namespace NEO;
struct TestParam2 {
cl_uint ScratchSize;
} TestParamTable2[] = {{1024}, {2048}, {4096}, {8192}, {16384}};
uint32_t scratchSize;
} TestParamTable2[] = {{1024u}, {2048u}, {4096u}, {8192u}, {16384u}};
struct TestParam {
cl_uint globalWorkSizeX;
@ -308,20 +308,20 @@ HWCMDTEST_P(IGFX_GEN8_CORE, EnqueueScratchSpaceTests, GivenKernelRequiringScratc
EXPECT_TRUE(csr.getAllocationsForReuse().peekIsEmpty());
SPatchMediaVFEState mediaVFEstate;
auto scratchSize = GetParam().ScratchSize;
auto scratchSize = GetParam().scratchSize;
mediaVFEstate.PerThreadScratchSpace = scratchSize;
MockKernelWithInternals mockKernel(*pClDevice);
mockKernel.kernelInfo.patchInfo.mediavfestate = &mediaVFEstate;
auto sizeToProgram = (scratchSize / MemoryConstants::kiloByte);
auto bitValue = 0u;
uint32_t sizeToProgram = (scratchSize / static_cast<uint32_t>(MemoryConstants::kiloByte));
uint32_t bitValue = 0u;
while (sizeToProgram >>= 1) {
bitValue++;
}
auto valueToProgram = Kernel::getScratchSizeValueToProgramMediaVfeState(scratchSize);
auto valueToProgram = PreambleHelper<FamilyType>::getScratchSizeValueToProgramMediaVfeState(scratchSize);
EXPECT_EQ(bitValue, valueToProgram);
enqueueKernel<FamilyType>(mockKernel);
@ -443,20 +443,20 @@ HWTEST_P(EnqueueKernelWithScratch, GivenKernelRequiringScratchWhenItIsEnqueuedWi
pDevice->resetCommandStreamReceiver(mockCsr);
SPatchMediaVFEState mediaVFEstate;
auto scratchSize = 1024;
uint32_t scratchSize = 1024u;
mediaVFEstate.PerThreadScratchSpace = scratchSize;
MockKernelWithInternals mockKernel(*pClDevice);
mockKernel.kernelInfo.patchInfo.mediavfestate = &mediaVFEstate;
auto sizeToProgram = (scratchSize / MemoryConstants::kiloByte);
auto bitValue = 0u;
uint32_t sizeToProgram = (scratchSize / static_cast<uint32_t>(MemoryConstants::kiloByte));
uint32_t bitValue = 0u;
while (sizeToProgram >>= 1) {
bitValue++;
}
auto valueToProgram = Kernel::getScratchSizeValueToProgramMediaVfeState(scratchSize);
auto valueToProgram = PreambleHelper<FamilyType>::getScratchSizeValueToProgramMediaVfeState(scratchSize);
EXPECT_EQ(bitValue, valueToProgram);
enqueueKernel<FamilyType, false>(mockKernel);

View File

@ -7,6 +7,7 @@
#include "opencl/test/unit_test/helpers/hardware_commands_helper_tests.h"
#include "shared/source/command_container/command_encoder.h"
#include "shared/source/helpers/basic_math.h"
#include "shared/source/helpers/engine_node_helper.h"
#include "shared/source/memory_manager/unified_memory_manager.h"
@ -321,7 +322,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, WhenAllocatingIndirectStateRes
auto usedBeforeIOH = ioh.getUsed();
auto usedBeforeSSH = ssh.getUsed();
dsh.align(HardwareCommandsHelper<FamilyType>::alignInterfaceDescriptorData);
dsh.align(EncodeStates<FamilyType>::alignInterfaceDescriptorData);
size_t IDToffset = dsh.getUsed();
dsh.getSpace(sizeof(INTERFACE_DESCRIPTOR_DATA));
@ -535,7 +536,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, whenSendingIndirectStateThenKe
auto &ioh = cmdQ.getIndirectHeap(IndirectHeap::INDIRECT_OBJECT, 8192);
auto &ssh = cmdQ.getIndirectHeap(IndirectHeap::SURFACE_STATE, 8192);
dsh.align(HardwareCommandsHelper<FamilyType>::alignInterfaceDescriptorData);
dsh.align(EncodeStates<FamilyType>::alignInterfaceDescriptorData);
size_t IDToffset = dsh.getUsed();
dsh.getSpace(sizeof(INTERFACE_DESCRIPTOR_DATA));