Add fixture with a simple stateless copy kernel

Signed-off-by: Slawomir Milczarek <slawomir.milczarek@intel.com>
This commit is contained in:
Slawomir Milczarek
2020-12-09 10:54:19 +00:00
committed by Compute-Runtime-Automation
parent 408373412d
commit e7772143a2
6 changed files with 65 additions and 4 deletions

View File

@ -265,6 +265,45 @@ class SimpleKernelStatelessFixture : public ProgramFixture {
cl_int retVal = CL_SUCCESS;
};
class StatelessCopyKernelFixture : public ProgramFixture {
public:
DebugManagerStateRestore restorer;
using ProgramFixture::SetUp;
protected:
void SetUp(ClDevice *device, Context *context) {
ProgramFixture::SetUp();
DebugManager.flags.DisableStatelessToStatefulOptimization.set(true);
DebugManager.flags.EnableStatelessToStatefulBufferOffsetOpt.set(false);
CreateProgramFromBinary(
context,
toClDeviceVector(*device),
"stateless_copy_buffer");
ASSERT_NE(nullptr, pProgram);
retVal = pProgram->build(
pProgram->getDevices(),
CompilerOptions::greaterThan4gbBuffersRequired.data(),
false);
ASSERT_EQ(CL_SUCCESS, retVal);
kernel.reset(Kernel::create<MockKernel>(
pProgram,
pProgram->getKernelInfosForKernel("StatelessCopyBuffer"),
&retVal));
ASSERT_NE(nullptr, kernel);
ASSERT_EQ(CL_SUCCESS, retVal);
}
void TearDown() override {
ProgramFixture::TearDown();
}
std::unique_ptr<Kernel> kernel = nullptr;
cl_int retVal = CL_SUCCESS;
};
class BindlessKernelFixture : public ProgramFixture {
public:
using ProgramFixture::SetUp;

View File

@ -326,7 +326,7 @@ TEST_F(KernelDataTest, GivenExecutionEnvironmentNoReqdWorkGroupSizeWhenBuildingT
EXPECT_EQ_VAL(0, pKernelInfo->kernelDescriptor.kernelAttributes.requiredWorkgroupSize[0]);
EXPECT_EQ_VAL(0, pKernelInfo->kernelDescriptor.kernelAttributes.requiredWorkgroupSize[1]);
EXPECT_EQ_VAL(0, pKernelInfo->kernelDescriptor.kernelAttributes.requiredWorkgroupSize[2]);
EXPECT_FALSE(pKernelInfo->hasStatelessAccessToHostMemory);
EXPECT_FALSE(pKernelInfo->hasIndirectStatelessAccess);
}
TEST_F(KernelDataTest, GivenExecutionEnvironmentWhenBuildingThenProgramIsCorrect) {
@ -364,7 +364,7 @@ TEST_F(KernelDataTest, GivenExecutionEnvironmentWhenBuildingThenProgramIsCorrect
EXPECT_EQ(16u, pKernelInfo->kernelDescriptor.kernelAttributes.requiredWorkgroupSize[1]);
EXPECT_EQ(8u, pKernelInfo->kernelDescriptor.kernelAttributes.requiredWorkgroupSize[2]);
EXPECT_TRUE(pKernelInfo->requiresSshForBuffers);
EXPECT_TRUE(pKernelInfo->hasStatelessAccessToHostMemory);
EXPECT_TRUE(pKernelInfo->hasIndirectStatelessAccess);
}
TEST_F(KernelDataTest, GivenExecutionEnvironmentCompiledForGreaterThan4gbBuffersWhenBuildingThenProgramIsCorrect) {

View File

@ -0,0 +1,14 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
__kernel void StatelessCopyBuffer(
const __global uchar* src,
__global uchar* dst)
{
uint id = get_global_id(0);
dst[id] = src[id];
}

View File

@ -0,0 +1,8 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
-cl-intel-greater-than-4GB-buffer-required