Enable OpenCL 3.0 by default on all devices

Change-Id: Ic5e46177c957896c499b7aa6727af48105b664ac
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2020-10-07 13:37:34 +02:00
committed by sys_ocldev
parent 595f374634
commit 7d0f23bfc9
35 changed files with 1151 additions and 1341 deletions

View File

@ -46,7 +46,7 @@ const RuntimeCapabilityTable EHL::capabilityTable{
PreemptionMode::MidThread, // defaultPreemptionMode
aub_stream::ENGINE_RCS, // defaultEngineType
0, // maxRenderFrequency
12, // clVersionSupport
30, // clVersionSupport
CmdServicesMemTraceVersion::DeviceValues::Ehl, // aubDeviceId
1, // extraQuantityThreadsPerEU
64, // slmSize

View File

@ -47,7 +47,7 @@ const RuntimeCapabilityTable ICLLP::capabilityTable{
PreemptionMode::MidThread, // defaultPreemptionMode
aub_stream::ENGINE_RCS, // defaultEngineType
0, // maxRenderFrequency
21, // clVersionSupport
30, // clVersionSupport
CmdServicesMemTraceVersion::DeviceValues::Icllp, // aubDeviceId
1, // extraQuantityThreadsPerEU
64, // slmSize

View File

@ -46,7 +46,7 @@ const RuntimeCapabilityTable LKF::capabilityTable{
PreemptionMode::MidThread, // defaultPreemptionMode
aub_stream::ENGINE_RCS, // defaultEngineType
0, // maxRenderFrequency
12, // clVersionSupport
30, // clVersionSupport
CmdServicesMemTraceVersion::DeviceValues::Lkf, // aubDeviceId
1, // extraQuantityThreadsPerEU
64, // slmSize

View File

@ -51,7 +51,7 @@ const RuntimeCapabilityTable BDW::capabilityTable{
PreemptionMode::Disabled, // defaultPreemptionMode
aub_stream::ENGINE_RCS, // defaultEngineType
0, // maxRenderFrequency
21, // clVersionSupport
30, // clVersionSupport
CmdServicesMemTraceVersion::DeviceValues::Bdw, // aubDeviceId
0, // extraQuantityThreadsPerEU
64, // slmSize

View File

@ -48,7 +48,7 @@ const RuntimeCapabilityTable BXT::capabilityTable{
PreemptionMode::MidThread, // defaultPreemptionMode
aub_stream::ENGINE_RCS, // defaultEngineType
0, // maxRenderFrequency
12, // clVersionSupport
30, // clVersionSupport
CmdServicesMemTraceVersion::DeviceValues::Bxt, // aubDeviceId
0, // extraQuantityThreadsPerEU
64, // slmSize

View File

@ -43,7 +43,7 @@ const RuntimeCapabilityTable CFL::capabilityTable{
PreemptionMode::MidThread, // defaultPreemptionMode
aub_stream::ENGINE_RCS, // defaultEngineType
0, // maxRenderFrequency
21, // clVersionSupport
30, // clVersionSupport
CmdServicesMemTraceVersion::DeviceValues::Cfl, // aubDeviceId
0, // extraQuantityThreadsPerEU
64, // slmSize

View File

@ -43,7 +43,7 @@ const RuntimeCapabilityTable GLK::capabilityTable{
PreemptionMode::MidThread, // defaultPreemptionMode
aub_stream::ENGINE_RCS, // defaultEngineType
0, // maxRenderFrequency
12, // clVersionSupport
30, // clVersionSupport
CmdServicesMemTraceVersion::DeviceValues::Glk, // aubDeviceId
0, // extraQuantityThreadsPerEU
64, // slmSize

View File

@ -43,7 +43,7 @@ const RuntimeCapabilityTable KBL::capabilityTable{
PreemptionMode::MidThread, // defaultPreemptionMode
aub_stream::ENGINE_RCS, // defaultEngineType
0, // maxRenderFrequency
21, // clVersionSupport
30, // clVersionSupport
CmdServicesMemTraceVersion::DeviceValues::Kbl, // aubDeviceId
0, // extraQuantityThreadsPerEU
64, // slmSize

View File

@ -51,7 +51,7 @@ const RuntimeCapabilityTable SKL::capabilityTable{
PreemptionMode::MidThread, // defaultPreemptionMode
aub_stream::ENGINE_RCS, // defaultEngineType
0, // maxRenderFrequency
21, // clVersionSupport
30, // clVersionSupport
CmdServicesMemTraceVersion::DeviceValues::Skl, // aubDeviceId
0, // extraQuantityThreadsPerEU
64, // slmSize

View File

@ -6,6 +6,7 @@
*/
#include "opencl/test/unit_test/fixtures/hello_world_fixture.h"
#include "opencl/test/unit_test/test_macros/test_checks_ocl.h"
using namespace NEO;
@ -91,7 +92,8 @@ INSTANTIATE_TEST_CASE_P(wgs,
::testing::ValuesIn(WorkDimensions)));
TEST_P(KernelSubGroupInfoReturnSizeTest, GivenWorkGroupSizeWhenGettingMaxSubGroupSizeThenReturnIsCalculatedCorrectly) {
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
WorkSizeParam workSize;
size_t workDim;
std::tie(workSize, workDim) = GetParam();
@ -122,7 +124,6 @@ TEST_P(KernelSubGroupInfoReturnSizeTest, GivenWorkGroupSizeWhenGettingMaxSubGrou
EXPECT_EQ(maxSimdSize, paramValue[0]);
}
}
typedef KernelSubGroupInfoParamFixture<std::tuple<WorkSizeParam, size_t>> KernelSubGroupInfoReturnCountTest;
@ -133,7 +134,8 @@ INSTANTIATE_TEST_CASE_P(wgs,
::testing::ValuesIn(WorkDimensions)));
TEST_P(KernelSubGroupInfoReturnCountTest, GivenWorkGroupSizeWhenGettingSubGroupCountThenReturnIsCalculatedCorrectly) {
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
WorkSizeParam workSize;
size_t workDim;
std::tie(workSize, workDim) = GetParam();
@ -176,7 +178,6 @@ TEST_P(KernelSubGroupInfoReturnCountTest, GivenWorkGroupSizeWhenGettingSubGroupC
EXPECT_EQ((calculatedWGS / maxSimdSize) + 1, paramValue[0]);
}
}
}
static size_t SubGroupsNumbers[] = {0, 1, 10, 12, 21, 33, 67, 99};
@ -189,7 +190,8 @@ INSTANTIATE_TEST_CASE_P(sgn,
::testing::ValuesIn(WorkDimensions)));
TEST_P(KernelSubGroupInfoReturnLocalSizeTest, GivenWorkGroupSizeWhenGettingLocalSizeThenReturnIsCalculatedCorrectly) {
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
size_t subGroupsNum;
size_t workDim;
std::tie(subGroupsNum, workDim) = GetParam();
@ -223,12 +225,12 @@ TEST_P(KernelSubGroupInfoReturnLocalSizeTest, GivenWorkGroupSizeWhenGettingLocal
EXPECT_EQ(workGroupSize ? 1u : 0u, paramValue[2]);
}
}
}
typedef KernelSubGroupInfoParamFixture<WorkSizeParam> KernelSubGroupInfoReturnMaxNumberTest;
TEST_F(KernelSubGroupInfoReturnMaxNumberTest, GivenWorkGroupSizeWhenGettingMaxNumSubGroupsThenReturnIsCalculatedCorrectly) {
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
retVal = clGetKernelSubGroupInfo(
pKernel,
pClDevice,
@ -243,12 +245,12 @@ TEST_F(KernelSubGroupInfoReturnMaxNumberTest, GivenWorkGroupSizeWhenGettingMaxNu
EXPECT_EQ(paramValueSizeRet, sizeof(size_t));
EXPECT_EQ(paramValue[0], Math::divideAndRoundUp(calculatedMaxWorkgroupSize, largestCompiledSIMDSize));
}
}
typedef KernelSubGroupInfoParamFixture<WorkSizeParam> KernelSubGroupInfoReturnCompileNumberTest;
TEST_F(KernelSubGroupInfoReturnCompileNumberTest, GivenKernelWhenGettingCompileNumSubGroupThenReturnIsCalculatedCorrectly) {
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
retVal = clGetKernelSubGroupInfo(
pKernel,
pClDevice,
@ -263,12 +265,12 @@ TEST_F(KernelSubGroupInfoReturnCompileNumberTest, GivenKernelWhenGettingCompileN
EXPECT_EQ(paramValueSizeRet, sizeof(size_t));
EXPECT_EQ(paramValue[0], static_cast<size_t>(pKernel->getKernelInfo().patchInfo.executionEnvironment->CompiledSubGroupsNumber));
}
}
typedef KernelSubGroupInfoParamFixture<WorkSizeParam> KernelSubGroupInfoReturnCompileSizeTest;
TEST_F(KernelSubGroupInfoReturnCompileSizeTest, GivenKernelWhenGettingCompileSubGroupSizeThenReturnIsCalculatedCorrectly) {
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
retVal = clGetKernelSubGroupInfo(
pKernel,
pClDevice,
@ -293,10 +295,10 @@ TEST_F(KernelSubGroupInfoReturnCompileSizeTest, GivenKernelWhenGettingCompileSub
EXPECT_EQ(paramValue[0], requiredSubGroupSize);
}
}
TEST_F(KernelSubGroupInfoTest, GivenNullKernelWhenGettingSubGroupInfoThenInvalidKernelErrorIsReturned) {
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
retVal = clGetKernelSubGroupInfo(
nullptr,
pClDevice,
@ -309,10 +311,10 @@ TEST_F(KernelSubGroupInfoTest, GivenNullKernelWhenGettingSubGroupInfoThenInvalid
EXPECT_EQ(CL_INVALID_KERNEL, retVal);
}
}
TEST_F(KernelSubGroupInfoTest, GivenNullDeviceWhenGettingSubGroupInfoThenInvalidDeviceErrorIsReturned) {
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
retVal = clGetKernelSubGroupInfo(
pKernel,
nullptr,
@ -325,10 +327,10 @@ TEST_F(KernelSubGroupInfoTest, GivenNullDeviceWhenGettingSubGroupInfoThenInvalid
EXPECT_EQ(CL_INVALID_DEVICE, retVal);
}
}
TEST_F(KernelSubGroupInfoTest, GivenInvalidParamNameWhenGettingSubGroupInfoThenInvalidValueErrorIsReturned) {
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
retVal = clGetKernelSubGroupInfo(
pKernel,
pClDevice,
@ -341,7 +343,6 @@ TEST_F(KernelSubGroupInfoTest, GivenInvalidParamNameWhenGettingSubGroupInfoThenI
EXPECT_EQ(CL_INVALID_VALUE, retVal);
}
}
uint32_t /*cl_kernel_sub_group_info*/ KernelSubGroupInfoInputParams[] = {
CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE,
@ -385,7 +386,8 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenOpenClVersionLowerThan21WhenGetti
}
TEST_P(KernelSubGroupInfoInputParamsTest, GivenWorkDimZeroWhenGettingSubGroupInfoThenSuccessOrErrorIsCorrectlyReturned) {
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
bool requireInput = (GetParam() == CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE) ||
(GetParam() == CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE) ||
(GetParam() == CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT);
@ -402,10 +404,10 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenWorkDimZeroWhenGettingSubGroupInf
EXPECT_EQ(requireInput ? CL_INVALID_VALUE : CL_SUCCESS, retVal);
}
}
TEST_P(KernelSubGroupInfoInputParamsTest, GivenIndivisibleWorkDimWhenGettingSubGroupInfoThenSuccessOrErrorIsCorrectlyReturned) {
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
bool requireInput = (GetParam() == CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE) ||
(GetParam() == CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE) ||
(GetParam() == CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT);
@ -426,10 +428,10 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenIndivisibleWorkDimWhenGettingSubG
EXPECT_EQ(requireInput ? CL_INVALID_VALUE : CL_SUCCESS, retVal);
}
}
TEST_P(KernelSubGroupInfoInputParamsTest, GivenWorkDimGreaterThanMaxWorkDimWhenGettingSubGroupInfoThenSuccessOrErrorIsCorrectlyReturned) {
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
bool requireInput = (GetParam() == CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE) ||
(GetParam() == CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE) ||
(GetParam() == CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT);
@ -450,10 +452,10 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenWorkDimGreaterThanMaxWorkDimWhenG
EXPECT_EQ(requireInput ? CL_INVALID_VALUE : CL_SUCCESS, retVal);
}
}
TEST_P(KernelSubGroupInfoInputParamsTest, GivenInputValueIsNullWhenGettingSubGroupInfoThenSuccessOrErrorIsCorrectlyReturned) {
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
bool requireInput = (GetParam() == CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE) ||
(GetParam() == CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE) ||
(GetParam() == CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT);
@ -474,10 +476,9 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenInputValueIsNullWhenGettingSubGro
EXPECT_EQ(requireInput ? CL_INVALID_VALUE : CL_SUCCESS, retVal);
}
}
TEST_P(KernelSubGroupInfoInputParamsTest, GivenParamValueSizeZeroWhenGettingSubGroupInfoThenInvalidValueErrorIsReturned) {
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
retVal = clGetKernelSubGroupInfo(
pKernel,
@ -491,10 +492,10 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenParamValueSizeZeroWhenGettingSubG
EXPECT_EQ(CL_INVALID_VALUE, retVal);
}
}
TEST_P(KernelSubGroupInfoInputParamsTest, GivenUnalignedParamValueSizeWhenGettingSubGroupInfoThenInvalidValueErrorIsReturned) {
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
size_t workDim = (GetParam() == CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT) ? maxWorkDim : 1;
retVal = clGetKernelSubGroupInfo(
@ -509,10 +510,10 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenUnalignedParamValueSizeWhenGettin
EXPECT_EQ(CL_INVALID_VALUE, retVal);
}
}
TEST_P(KernelSubGroupInfoInputParamsTest, GivenTooLargeParamValueSizeWhenGettingSubGroupInfoThenCorrectRetValIsReturned) {
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
bool requireOutputArray = (GetParam() == CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT);
size_t workDim = (GetParam() == CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT) ? maxWorkDim : 1;
@ -529,10 +530,10 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenTooLargeParamValueSizeWhenGetting
EXPECT_EQ(requireOutputArray ? CL_INVALID_VALUE : CL_SUCCESS, retVal);
}
}
TEST_P(KernelSubGroupInfoInputParamsTest, GivenNullPtrForReturnWhenGettingKernelSubGroupInfoThenSuccessIsReturned) {
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
bool requireOutputArray = (GetParam() == CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT);
retVal = clGetKernelSubGroupInfo(
@ -547,5 +548,4 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenNullPtrForReturnWhenGettingKernel
EXPECT_EQ(requireOutputArray ? CL_INVALID_VALUE : CL_SUCCESS, retVal);
}
}
} // namespace ULT

View File

@ -127,8 +127,9 @@ TEST_F(DeviceGetCapsTest, WhenCreatingDeviceThenCapsArePopulatedCorrectly) {
EXPECT_NE(nullptr, caps.vendor);
EXPECT_NE(nullptr, caps.driverVersion);
EXPECT_NE(nullptr, caps.profile);
EXPECT_NE(nullptr, caps.clVersion);
EXPECT_NE(nullptr, caps.clCVersion);
EXPECT_STREQ("OpenCL 3.0 NEO ", caps.clVersion);
auto expectedClCVersion = (device->isOcl21Conformant() ? "OpenCL C 3.0 " : "OpenCL C 1.2 ");
EXPECT_STREQ(expectedClCVersion, caps.clCVersion);
EXPECT_NE(0u, caps.numericClVersion);
EXPECT_GT(caps.openclCAllVersions.size(), 0u);
EXPECT_GT(caps.openclCFeatures.size(), 0u);
@ -1196,9 +1197,7 @@ TEST(DeviceGetCaps, givenDebugFlagToUseCertainWorkgroupSizeWhenDeviceIsCreatedIt
}
TEST(DeviceGetCaps, givenDebugFlagToDisableDeviceEnqueuesWhenCreatingDeviceThenDeviceQueueCapsAreSetCorrectly) {
if (defaultHwInfo->capabilityTable.clVersionSupport == 21) {
GTEST_SKIP();
}
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.ForceDeviceEnqueueSupport.set(0);

View File

@ -483,8 +483,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueHwTest, WhenCreatingDeviceQueueThenDshOff
class DeviceQueueHwWithKernel : public ExecutionModelKernelFixture {
public:
void SetUp() override {
ExecutionModelKernelFixture::SetUp();
REQUIRE_DEVICE_ENQUEUE_OR_SKIP(defaultHwInfo);
ExecutionModelKernelFixture::SetUp();
cl_queue_properties properties[5] = {
CL_QUEUE_PROPERTIES,
CL_QUEUE_ON_DEVICE | CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE,
@ -503,6 +504,10 @@ class DeviceQueueHwWithKernel : public ExecutionModelKernelFixture {
ASSERT_NE(nullptr, devQueue);
}
void TearDown() override {
if (IsSkipped()) {
return;
}
if (devQueue) {
delete devQueue;
}
@ -522,7 +527,6 @@ class DeviceQueueHwWithKernel : public ExecutionModelKernelFixture {
};
HWCMDTEST_P(IGFX_GEN8_CORE, DeviceQueueHwWithKernel, WhenSetiingIUpIndirectStateThenDshIsNotUsed) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
EXPECT_TRUE(pKernel->isParentKernel);
pKernel->createReflectionSurface();
@ -550,10 +554,8 @@ HWCMDTEST_P(IGFX_GEN8_CORE, DeviceQueueHwWithKernel, WhenSetiingIUpIndirectState
alignedFree(ssh->getCpuBase());
delete ssh;
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, DeviceQueueHwWithKernel, WhenSettingUpIndirectStateThenCorrectStartBlockIdIsSet) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
EXPECT_TRUE(pKernel->isParentKernel);
pKernel->createReflectionSurface();
@ -577,12 +579,10 @@ HWCMDTEST_P(IGFX_GEN8_CORE, DeviceQueueHwWithKernel, WhenSettingUpIndirectStateT
alignedFree(ssh->getCpuBase());
delete ssh;
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, DeviceQueueHwWithKernel, WhenSettingUpIndirectStateThenDshValuesAreSetCorrectly) {
using GPGPU_WALKER = typename FamilyType::GPGPU_WALKER;
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
EXPECT_TRUE(pKernel->isParentKernel);
pKernel->createReflectionSurface();
@ -611,13 +611,11 @@ HWCMDTEST_P(IGFX_GEN8_CORE, DeviceQueueHwWithKernel, WhenSettingUpIndirectStateT
delete ssh;
delete devQueueHw;
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, DeviceQueueHwWithKernel, GivenHasBarriersSetWhenCallingSetupIndirectStateThenAllIddHaveBarriersEnabled) {
using GPGPU_WALKER = typename FamilyType::GPGPU_WALKER;
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
pKernel->createReflectionSurface();
MockContext mockContext;
@ -646,7 +644,6 @@ HWCMDTEST_P(IGFX_GEN8_CORE, DeviceQueueHwWithKernel, GivenHasBarriersSetWhenCall
alignedFree(ssh->getCpuBase());
}
}
static const char *binaryFile = "simple_block_kernel";
static const char *KernelNames[] = {"kernel_reflection", "simple_block_kernel"};

View File

@ -38,7 +38,6 @@ typedef ExecutionModelKernelTest ParentKernelEnqueueTest;
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueuedThenDeviceQueueDSHHasCorrectlyFilledInterfaceDesriptorTables) {
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
DeviceQueueHw<FamilyType> *pDevQueueHw = castToObject<DeviceQueueHw<FamilyType>>(pDevQueue);
const size_t globalOffsets[3] = {0, 0, 0};
@ -121,10 +120,8 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueu
EXPECT_EQ(expectedBlockKernelAddress, blockKernelAddress);
}
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlockKernelWithPrivateSurfaceWhenParentKernelIsEnqueuedThenPrivateSurfaceIsMadeResident) {
if (pClDevice->areOcl21FeaturesSupported()) {
size_t offset[3] = {0, 0, 0};
size_t gws[3] = {1, 1, 1};
int32_t executionStamp = 0;
@ -152,10 +149,8 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlockKernelWithPrivate
EXPECT_TRUE(privateSurface->isResident(mockCSR->getOsContext().getContextId()));
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlocksWithPrivateMemoryWhenEnqueueKernelThatIsBlockedByUserEventIsCalledThenPrivateAllocationIsMadeResidentWhenEventUnblocks) {
if (pClDevice->areOcl21FeaturesSupported()) {
size_t offset[3] = {0, 0, 0};
size_t gws[3] = {1, 1, 1};
@ -189,10 +184,8 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlocksWithPrivateMemor
uEvent->setStatus(CL_COMPLETE);
EXPECT_TRUE(csr.isMadeResident(privateAllocation));
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenParentKernelWithBlocksWhenEnqueueKernelIsCalledThenBlockKernelIsaAllocationIsMadeResident) {
if (pClDevice->areOcl21FeaturesSupported()) {
size_t offset[3] = {0, 0, 0};
size_t gws[3] = {1, 1, 1};
@ -207,10 +200,8 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenParentKernelWithBlocks
EXPECT_TRUE(csr.isMadeResident(blockKernelManager->getBlockKernelInfo(blockId)->getGraphicsAllocation()));
}
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlockKernelManagerFilledWithBlocksWhenMakeInternalAllocationsResidentIsCalledThenAllSurfacesAreMadeResident) {
if (pClDevice->areOcl21FeaturesSupported()) {
auto blockKernelManager = pKernel->getProgram()->getBlockKernelManager();
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
csr.storeMakeResidentAllocations = true;
@ -222,10 +213,8 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlockKernelManagerFill
EXPECT_TRUE(csr.isMadeResident(blockKernelManager->getBlockKernelInfo(blockId)->getGraphicsAllocation()));
}
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenParentKernelWithBlocksWhenEnqueueKernelThatIsBlockedByUserEventIsCalledThenBlockKernelIsaAllocationIsMadeResidentWhenEventUnblocks) {
if (pClDevice->areOcl21FeaturesSupported()) {
size_t offset[3] = {0, 0, 0};
size_t gws[3] = {1, 1, 1};
@ -249,12 +238,10 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenParentKernelWithBlocks
EXPECT_TRUE(csr.isMadeResident(blockKernelManager->getBlockKernelInfo(blockId)->getGraphicsAllocation()));
}
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueuedSecondTimeThenDeviceQueueDSHIsResetToInitialOffset) {
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
DeviceQueueHw<FamilyType> *pDevQueueHw = castToObject<DeviceQueueHw<FamilyType>>(pDevQueue);
const size_t globalOffsets[3] = {0, 0, 0};
@ -280,11 +267,8 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueu
size_t executionModelDSHUsedAfterSecond = dsh->getUsed();
EXPECT_EQ(executionModelDSHUsedAfterFirst, executionModelDSHUsedAfterSecond);
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelAndNotUsedSSHWhenEnqueuedThenSSHIsNotReallocated) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
const size_t globalOffsets[3] = {0, 0, 0};
const size_t workItems[3] = {1, 1, 1};
@ -299,15 +283,12 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelAndNotUsed
EXPECT_EQ(ssh, ssh2);
EXPECT_EQ(ssh->getGraphicsAllocation(), ssh2->getGraphicsAllocation());
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueuedThenBlocksSurfaceStatesAreCopied) {
using BINDING_TABLE_STATE = typename FamilyType::BINDING_TABLE_STATE;
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
const size_t globalOffsets[3] = {0, 0, 0};
const size_t workItems[3] = {1, 1, 1};
@ -365,15 +346,12 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueu
delete blockKernel;
}
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueuedThenReflectionSurfaceIsCreated) {
using BINDING_TABLE_STATE = typename FamilyType::BINDING_TABLE_STATE;
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
const size_t globalOffsets[3] = {0, 0, 0};
const size_t workItems[3] = {1, 1, 1};
@ -382,11 +360,8 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueu
EXPECT_NE(nullptr, pKernel->getKernelReflectionSurface());
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenBlockedQueueWhenParentKernelIsEnqueuedThenDeviceQueueIsNotReset) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
const size_t globalOffsets[3] = {0, 0, 0};
const size_t workItems[3] = {1, 1, 1};
cl_queue_properties properties[3] = {0};
@ -406,12 +381,10 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenBlockedQueueWhenParent
EXPECT_FALSE(mockDevQueue.isEMCriticalSectionFree());
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenNonBlockedQueueWhenParentKernelIsEnqueuedThenDeviceQueueDSHAddressIsProgrammedInStateBaseAddressAndDSHIsMadeResident) {
typedef typename FamilyType::STATE_BASE_ADDRESS STATE_BASE_ADDRESS;
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
DeviceQueueHw<FamilyType> *pDevQueueHw = castToObject<DeviceQueueHw<FamilyType>>(pDevQueue);
ASSERT_NE(nullptr, pDevQueueHw);
@ -452,7 +425,6 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenNonBlockedQueueWhenPar
}
EXPECT_TRUE(dshAllocationResident);
}
}
INSTANTIATE_TEST_CASE_P(ParentKernelEnqueueTest,
ParentKernelEnqueueTest,

View File

@ -28,7 +28,6 @@ static const char *KernelNames[] = {"kernel_reflection", "simple_block_kernel"};
typedef ExecutionModelKernelTest ParentKernelDispatchTest;
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenDeviceQueueDSHIsUsed) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
DeviceQueueHw<FamilyType> *pDevQueueHw = castToObject<DeviceQueueHw<FamilyType>>(pDevQueue);
KernelOperation *blockedCommandsData = nullptr;
@ -62,10 +61,8 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenQueue
size_t executionModelDSHUsedAfter = pDevQueueHw->getIndirectHeap(IndirectHeap::DYNAMIC_STATE)->getUsed();
EXPECT_NE(executionModelDSHUsedBefore, executionModelDSHUsedAfter);
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenDynamicStateHeapIsRequestedThenDeviceQueueHeapIsReturned) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
DeviceQueueHw<FamilyType> *pDevQueueHw = castToObject<DeviceQueueHw<FamilyType>>(pDevQueue);
MockMultiDispatchInfo multiDispatchInfo(pKernel);
@ -74,10 +71,8 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenDynam
EXPECT_EQ(ishOfDevQueue, ish);
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenIndirectObjectHeapIsRequestedThenDeviceQueueDSHIsReturned) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
DeviceQueueHw<FamilyType> *pDevQueueHw = castToObject<DeviceQueueHw<FamilyType>>(pDevQueue);
MockMultiDispatchInfo multiDispatchInfo(pKernel);
@ -86,10 +81,8 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenIndir
EXPECT_EQ(dshOfDevQueue, ioh);
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenDefaultCmdQIOHIsNotUsed) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
KernelOperation *blockedCommandsData = nullptr;
const size_t globalOffsets[3] = {0, 0, 0};
const size_t workItems[3] = {1, 1, 1};
@ -114,10 +107,8 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenQueue
auto iohUsed = ioh.getUsed();
EXPECT_EQ(0u, iohUsed);
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenSSHSizeAccountForsBlocksSurfaceStates) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
KernelOperation *blockedCommandsData = nullptr;
const size_t globalOffsets[3] = {0, 0, 0};
const size_t workItems[3] = {1, 1, 1};
@ -145,13 +136,11 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenQueue
EXPECT_LE(minRequiredSize + minRequiredSizeForEM, ssh.getMaxAvailableSpace());
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenQueueIsBlockedThenSSHSizeForParentIsAllocated) {
using BINDING_TABLE_STATE = typename FamilyType::BINDING_TABLE_STATE;
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
auto blockedCommandsData = createBlockedCommandsData(*pCmdQ);
const size_t globalOffsets[3] = {0, 0, 0};
const size_t workItems[3] = {1, 1, 1};
@ -189,7 +178,6 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenQueue
// Total SSH size including EM must be greater then ssh allocated
EXPECT_GT(minRequiredSize + minRequiredSizeForEM, sshUsed);
}
}
INSTANTIATE_TEST_CASE_P(ParentKernelDispatchTest,
ParentKernelDispatchTest,

View File

@ -53,6 +53,8 @@ class ExecutionModelKernelTest : public ExecutionModelKernelFixture,
public DeviceQueueFixture {
public:
void SetUp() override {
REQUIRE_DEVICE_ENQUEUE_OR_SKIP(defaultHwInfo);
DebugManager.flags.EnableTimestampPacket.set(0);
ExecutionModelKernelFixture::SetUp();
CommandQueueHwFixture::SetUp(pClDevice, 0);
@ -60,11 +62,12 @@ class ExecutionModelKernelTest : public ExecutionModelKernelFixture,
}
void TearDown() override {
if (!IsSkipped()) {
DeviceQueueFixture::TearDown();
CommandQueueHwFixture::TearDown();
ExecutionModelKernelFixture::TearDown();
}
}
std::unique_ptr<KernelOperation> createBlockedCommandsData(CommandQueue &commandQueue) {
auto commandStream = new LinearStream();

View File

@ -11,6 +11,7 @@
#include "opencl/test/unit_test/fixtures/platform_fixture.h"
#include "opencl/test/unit_test/mocks/mock_kernel.h"
#include "opencl/test/unit_test/program/program_from_binary.h"
#include "opencl/test/unit_test/test_macros/test_checks_ocl.h"
#include "test.h"
using namespace NEO;
@ -19,17 +20,10 @@ class ExecutionModelKernelFixture : public ProgramFromBinaryTest,
public PlatformFixture {
protected:
void SetUp() override {
REQUIRE_DEVICE_ENQUEUE_OR_SKIP(defaultHwInfo);
PlatformFixture::SetUp();
std::string temp;
temp.assign(pPlatform->getClDevice(0)->getDeviceInfo().clVersion);
if (temp.find("OpenCL 1.2") != std::string::npos) {
pDevice = MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr);
pClDevice = new MockClDevice{pDevice};
return;
}
std::string options("-cl-std=CL2.0");
this->setOptions(options);
ProgramFromBinaryTest::SetUp();
@ -58,17 +52,16 @@ class ExecutionModelKernelFixture : public ProgramFromBinaryTest,
}
void TearDown() override {
if (IsSkipped()) {
return;
}
if (pKernel != nullptr) {
pKernel->release();
}
std::string temp;
temp.assign(pPlatform->getClDevice(0)->getDeviceInfo().clVersion);
ProgramFromBinaryTest::TearDown();
PlatformFixture::TearDown();
if (temp.find("OpenCL 1.2") != std::string::npos) {
if (pDevice != nullptr) {
delete pDevice;
pDevice = nullptr;
@ -78,7 +71,6 @@ class ExecutionModelKernelFixture : public ProgramFromBinaryTest,
pClDevice = nullptr;
}
}
}
Kernel *pKernel = nullptr;
cl_int retVal = CL_SUCCESS;

View File

@ -16,12 +16,6 @@ LKFTEST_F(LkfTest, givenLkfWhenSlmSizeIsRequiredThenReturnCorrectValue) {
EXPECT_EQ(64u, pDevice->getHardwareInfo().capabilityTable.slmSize);
}
LKFTEST_F(LkfTest, givenLKFWhenCheckedOCLVersionThen21IsReported) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_STREQ("OpenCL 1.2 NEO ", caps.clVersion);
EXPECT_STREQ("OpenCL C 1.2 ", caps.clCVersion);
}
LKFTEST_F(LkfTest, givenLKFWhenCheckedSvmSupportThenNoSvmIsReported) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_EQ(caps.svmCapabilities, 0u);

View File

@ -14,13 +14,6 @@ using namespace NEO;
typedef Test<ClDeviceFixture> Gen12LpDeviceCaps;
GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpDeviceWhenQueryingDeviceInfoThenOcl30IsReported) {
const auto &caps = pClDevice->getDeviceInfo();
auto expectedClCVersion = (pClDevice->isOcl21Conformant() ? "OpenCL C 3.0 " : "OpenCL C 1.2 ");
EXPECT_STREQ("OpenCL 3.0 NEO ", caps.clVersion);
EXPECT_STREQ(expectedClCVersion, caps.clCVersion);
}
HWTEST2_F(Gen12LpDeviceCaps, lpSkusDontSupportFP64, IsTGLLP) {
const auto &caps = pClDevice->getDeviceInfo();
std::string extensionString = caps.deviceExtensions;

View File

@ -7,7 +7,6 @@
if(TESTS_BDW)
set(IGDRCL_SRCS_tests_gen8_bdw
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/device_tests_bdw.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_bdw.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_bdw.cpp
)

View File

@ -1,29 +0,0 @@
/*
* Copyright (C) 2018-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/test/unit_test/mocks/mock_device.h"
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
#include "opencl/test/unit_test/mocks/mock_source_level_debugger.h"
#include "test.h"
using namespace NEO;
struct BdwDeviceTest : public ClDeviceFixture,
public ::testing::Test {
void SetUp() override {
ClDeviceFixture::SetUp();
}
void TearDown() override {
ClDeviceFixture::TearDown();
}
};
BDWTEST_F(BdwDeviceTest, givenBdwDeviceWhenAskedForClVersionThenReport21) {
auto version = pClDevice->getEnabledClVersion();
EXPECT_EQ(21u, version);
}

View File

@ -14,12 +14,6 @@ using namespace NEO;
typedef Test<ClDeviceFixture> BdwDeviceCaps;
BDWTEST_F(BdwDeviceCaps, givenBdwDeviceWhenAskedForClVersionThenReport21) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_STREQ("OpenCL 2.1 NEO ", caps.clVersion);
EXPECT_STREQ("OpenCL C 2.0 ", caps.clCVersion);
}
BDWTEST_F(BdwDeviceCaps, skuSpecificCaps) {
const auto &caps = pClDevice->getDeviceInfo();
std::string extensionString = caps.deviceExtensions;

View File

@ -12,11 +12,6 @@ using namespace NEO;
typedef Test<ClDeviceFixture> DeviceTest;
BXTTEST_F(DeviceTest, getEnabledClVersion12Device) {
auto version = pClDevice->getEnabledClVersion();
EXPECT_EQ(12u, version);
}
BXTTEST_F(DeviceTest, givenBxtDeviceWhenAskedForProflingTimerResolutionThen52IsReturned) {
auto resolution = pDevice->getProfilingTimerResolution();
EXPECT_DOUBLE_EQ(52.083, resolution);

View File

@ -12,23 +12,13 @@ using namespace NEO;
typedef Test<ClDeviceFixture> BxtDeviceCaps;
BXTTEST_F(BxtDeviceCaps, reportsOcl12) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_STREQ("OpenCL 1.2 NEO ", caps.clVersion);
EXPECT_STREQ("OpenCL C 1.2 ", caps.clCVersion);
}
BXTTEST_F(BxtDeviceCaps, BxtProfilingTimerResolution) {
const auto &caps = pDevice->getDeviceInfo();
EXPECT_EQ(52u, caps.outProfilingTimerResolution);
}
BXTTEST_F(BxtDeviceCaps, BxtClVersionSupport) {
const auto &caps = pClDevice->getDeviceInfo();
BXTTEST_F(BxtDeviceCaps, givenBxtDeviceWhenAskedFor32BitSupportThenCorrectValuesAreReturned) {
const auto &sharedCaps = pDevice->getDeviceInfo();
EXPECT_STREQ("OpenCL 1.2 NEO ", caps.clVersion);
EXPECT_STREQ("OpenCL C 1.2 ", caps.clCVersion);
auto memoryManager = pDevice->getMemoryManager();
if (is64bit) {
EXPECT_TRUE(memoryManager->peekForce32BitAllocations());

View File

@ -12,12 +12,6 @@ using namespace NEO;
typedef Test<ClDeviceFixture> CflDeviceCaps;
CFLTEST_F(CflDeviceCaps, reportsOcl21) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_STREQ("OpenCL 2.1 NEO ", caps.clVersion);
EXPECT_STREQ("OpenCL C 2.0 ", caps.clCVersion);
}
CFLTEST_F(CflDeviceCaps, GivenCFLWhenCheckftr64KBpagesThenTrue) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
}

View File

@ -21,12 +21,6 @@ GLKTEST_F(Gen9DeviceCaps, givenGlkDeviceWhenAskedForDoubleSupportThenTrueIsRetur
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsFP64);
}
GLKTEST_F(Gen9DeviceCaps, GlkClVersionSupport) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_STREQ("OpenCL 1.2 NEO ", caps.clVersion);
EXPECT_STREQ("OpenCL C 1.2 ", caps.clCVersion);
}
GLKTEST_F(Gen9DeviceCaps, GlkIs32BitOsAllocatorAvailable) {
const auto &caps = pDevice->getDeviceInfo();
auto memoryManager = pDevice->getMemoryManager();

View File

@ -12,12 +12,6 @@ using namespace NEO;
typedef Test<ClDeviceFixture> KblDeviceCaps;
KBLTEST_F(KblDeviceCaps, reportsOcl21) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_STREQ("OpenCL 2.1 NEO ", caps.clVersion);
EXPECT_STREQ("OpenCL C 2.0 ", caps.clCVersion);
}
KBLTEST_F(KblDeviceCaps, GivenKBLWhenCheckftr64KBpagesThenTrue) {
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
}

View File

@ -12,11 +12,6 @@ using namespace NEO;
typedef Test<ClDeviceFixture> DeviceTest;
SKLTEST_F(DeviceTest, getEnabledClVersion21Device) {
auto version = pClDevice->getEnabledClVersion();
EXPECT_EQ(21u, version);
}
SKLTEST_F(DeviceTest, givenSklDeviceWhenAskedForProflingTimerResolutionThen83IsReturned) {
auto resolution = pDevice->getProfilingTimerResolution();
EXPECT_DOUBLE_EQ(83.333, resolution);

View File

@ -12,23 +12,13 @@ using namespace NEO;
typedef Test<ClDeviceFixture> SklDeviceCaps;
SKLTEST_F(SklDeviceCaps, reportsOcl21) {
const auto &caps = pClDevice->getDeviceInfo();
EXPECT_STREQ("OpenCL 2.1 NEO ", caps.clVersion);
EXPECT_STREQ("OpenCL C 2.0 ", caps.clCVersion);
}
SKLTEST_F(SklDeviceCaps, SklProfilingTimerResolution) {
const auto &caps = pDevice->getDeviceInfo();
EXPECT_EQ(83u, caps.outProfilingTimerResolution);
}
SKLTEST_F(SklDeviceCaps, givenSklDeviceWhenAskedFor32BitSupportThenFalseIsReturned) {
const auto &caps = pClDevice->getDeviceInfo();
const auto &sharedCaps = pDevice->getDeviceInfo();
EXPECT_STREQ("OpenCL 2.1 NEO ", caps.clVersion);
EXPECT_STREQ("OpenCL C 2.0 ", caps.clCVersion);
auto memoryManager = pDevice->getMemoryManager();
EXPECT_FALSE(memoryManager->peekForce32BitAllocations());
EXPECT_FALSE(sharedCaps.force32BitAddressess);

View File

@ -29,23 +29,3 @@ GEN9TEST_F(Gen9PlatformCaps, allSkusSupportFP64) {
EXPECT_EQ(std::string::npos, caps.extensions.find(std::string("cl_khr_fp64")));
}
}
GEN9TEST_F(Gen9PlatformCaps, SKLVersion) {
char *paramValue = new char[12];
cl_int retVal = clGetPlatformInfo(pPlatform, CL_PLATFORM_VERSION, 12, paramValue, nullptr);
if (pPlatform->getClDevice(0)->getHardwareInfo().platform.eProductFamily == IGFX_SKYLAKE) {
EXPECT_STREQ(paramValue, "OpenCL 2.1 ");
}
EXPECT_EQ(retVal, CL_SUCCESS);
delete[] paramValue;
}
GEN9TEST_F(Gen9PlatformCaps, BXTVersion) {
char *paramValue = new char[12];
cl_int retVal = clGetPlatformInfo(pPlatform, CL_PLATFORM_VERSION, 12, paramValue, nullptr);
if (pPlatform->getClDevice(0)->getHardwareInfo().platform.eProductFamily == IGFX_BROXTON) {
EXPECT_STREQ(paramValue, "OpenCL 1.2 ");
}
EXPECT_EQ(retVal, CL_SUCCESS);
delete[] paramValue;
}

View File

@ -1057,7 +1057,8 @@ typedef ExecutionModelKernelFixture ParentKernelCommandsFromBinaryTest;
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelCommandsFromBinaryTest, WhenGettingSizeRequiredForExecutionModelForSurfaceStatesThenReturnSizeOfBlocksPlusMaxBindingTableSizeForAllIdtEntriesAndSchedulerSshSize) {
using BINDING_TABLE_STATE = typename FamilyType::BINDING_TABLE_STATE;
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
REQUIRE_DEVICE_ENQUEUE_OR_SKIP(defaultHwInfo);
EXPECT_TRUE(pKernel->isParentKernel);
size_t totalSize = 0;
@ -1088,7 +1089,6 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelCommandsFromBinaryTest, WhenGettingSizeR
EXPECT_EQ(totalSize, HardwareCommandsHelper<FamilyType>::getSshSizeForExecutionModel(*pKernel));
}
}
static const char *binaryFile = "simple_block_kernel";
static const char *KernelNames[] = {"kernel_reflection", "simple_block_kernel"};

View File

@ -37,10 +37,8 @@ typedef ExecutionModelKernelFixture KernelReflectionSurfaceTest;
typedef ExecutionModelKernelTest KernelReflectionSurfaceWithQueueTest;
TEST_P(KernelReflectionSurfaceTest, WhenCreatingKernelThenKernelReflectionSurfaceIsNull) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
EXPECT_EQ(nullptr, pKernel->getKernelReflectionSurface());
}
}
TEST_P(KernelReflectionSurfaceTest, GivenEmptyKernelInfoWhenPassedToGetCurbeParamsThenEmptyVectorIsReturned) {
KernelInfo info;
@ -486,7 +484,6 @@ TEST_P(KernelReflectionSurfaceTest, GivenKernelInfoWithoutLocalMemoryParameterWh
}
TEST_P(KernelReflectionSurfaceTest, WhenGettingCurbeParamsThenReturnedVectorIsSortedIncreasing) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
EXPECT_TRUE(pKernel->isParentKernel);
BlockKernelManager *blockManager = pProgram->getBlockKernelManager();
@ -521,10 +518,8 @@ TEST_P(KernelReflectionSurfaceTest, WhenGettingCurbeParamsThenReturnedVectorIsSo
curbeParamsForBlock.resize(0);
}
}
}
TEST_P(KernelReflectionSurfaceTest, WhenGettingCurbeParamsThenReturnedVectorHasExpectedParamTypes) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
EXPECT_TRUE(pKernel->isParentKernel);
BlockKernelManager *blockManager = pProgram->getBlockKernelManager();
@ -574,10 +569,8 @@ TEST_P(KernelReflectionSurfaceTest, WhenGettingCurbeParamsThenReturnedVectorHasE
curbeParamsForBlock.resize(0);
}
}
}
TEST_P(KernelReflectionSurfaceTest, WhenGettingCurbeParamsThenTokenMaskIsCorrect) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
EXPECT_TRUE(pKernel->isParentKernel);
BlockKernelManager *blockManager = pProgram->getBlockKernelManager();
@ -608,7 +601,6 @@ TEST_P(KernelReflectionSurfaceTest, WhenGettingCurbeParamsThenTokenMaskIsCorrect
curbeParamsForBlock.resize(0);
}
}
}
TEST(KernelReflectionSurfaceTestSingle, GivenNonParentKernelWhenCreatingKernelReflectionSurfaceThenKernelReflectionSurfaceIsNotCreated) {
MockClDevice device{new MockDevice};
@ -755,7 +747,6 @@ TEST(KernelReflectionSurfaceTestSingle, GivenDeviceQueueKernelArgWhenObtainingKe
}
TEST_P(KernelReflectionSurfaceTest, WhenCreatingKernelReflectionSurfaceThenKernelReflectionSurfaceIsCorrect) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
EXPECT_TRUE(pKernel->isParentKernel);
BlockKernelManager *blockManager = pProgram->getBlockKernelManager();
@ -856,7 +847,6 @@ TEST_P(KernelReflectionSurfaceTest, WhenCreatingKernelReflectionSurfaceThenKerne
}
}
}
}
TEST_P(KernelReflectionSurfaceTest, GivenKernelInfoWithArgsWhenPassedToGetCurbeParamsThenProperFirstSshTokenIndexIsReturned) {
@ -1026,10 +1016,6 @@ INSTANTIATE_TEST_CASE_P(KernelReflectionSurfaceTest,
::testing::ValuesIn(KernelNames)));
HWCMDTEST_P(IGFX_GEN8_CORE, KernelReflectionSurfaceWithQueueTest, WhenObtainingKernelReflectionSurfacePatchesThenCurbeIsBlocked) {
REQUIRE_DEVICE_ENQUEUE_OR_SKIP(pPlatform->getClDevice(0));
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
BlockKernelManager *blockManager = pProgram->getBlockKernelManager();
size_t blockCount = blockManager->getCount();
@ -1097,11 +1083,8 @@ HWCMDTEST_P(IGFX_GEN8_CORE, KernelReflectionSurfaceWithQueueTest, WhenObtainingK
}
}
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, KernelReflectionSurfaceWithQueueTest, WhenObtainingKernelReflectionSurfaceThenParentImageAndSamplersParamsAreSet) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
BlockKernelManager *blockManager = pProgram->getBlockKernelManager();
size_t blockCount = blockManager->getCount();
@ -1162,7 +1145,6 @@ HWCMDTEST_P(IGFX_GEN8_CORE, KernelReflectionSurfaceWithQueueTest, WhenObtainingK
}
}
}
}
INSTANTIATE_TEST_CASE_P(KernelReflectionSurfaceWithQueueTest,
KernelReflectionSurfaceWithQueueTest,

View File

@ -193,12 +193,9 @@ TEST(ParentKernelTest, WhenInitializingParentKernelThenPrivateMemoryForBlocksIsA
}
TEST_P(ParentKernelFromBinaryTest, GivenParentKernelWhenGettingInstructionHeapSizeForExecutionModelThenSizeIsGreaterThanZero) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
EXPECT_TRUE(pKernel->isParentKernel);
EXPECT_LT(0u, pKernel->getInstructionHeapSizeForExecutionModel());
}
}
static const char *binaryFile = "simple_block_kernel";
static const char *KernelNames[] = {"simple_block_kernel"};

View File

@ -26,6 +26,7 @@
#include "opencl/test/unit_test/mocks/mock_platform.h"
#include "opencl/test/unit_test/mocks/mock_source_level_debugger.h"
#include "opencl/test/unit_test/mocks/ult_cl_device_factory.h"
#include "opencl/test/unit_test/test_macros/test_checks_ocl.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
@ -96,14 +97,15 @@ TEST_F(PlatformTest, WhenGetClDevicesIsCalledThenExpectedValuesAreReturned) {
}
TEST_F(PlatformTest, givenSupportingCl21WhenGettingExtensionsStringThenSubgroupsIsEnabled) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
pPlatform->initializeWithNewDevices();
auto compilerExtensions = pPlatform->getClDevice(0)->peekCompilerExtensions();
auto isIndependentForwardProgressSupported = pPlatform->getClDevice(0)->getDeviceInfo().independentForwardProgress;
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string(" -cl-ext=-all,+cl")));
if ((std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) &&
isIndependentForwardProgressSupported) {
if (isIndependentForwardProgressSupported) {
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_khr_subgroups")));
}
}

View File

@ -20,6 +20,7 @@
#include "opencl/test/unit_test/mocks/mock_program.h"
#include "opencl/test/unit_test/program/program_from_binary.h"
#include "opencl/test/unit_test/program/program_with_source.h"
#include "opencl/test/unit_test/test_macros/test_checks_ocl.h"
#include "test.h"
#include "gmock/gmock.h"
@ -180,7 +181,8 @@ class ProgramNonUniformTest : public ContextFixture,
};
TEST_F(ProgramNonUniformTest, GivenCl21WhenExecutingKernelWithNonUniformThenEnqueueSucceeds) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
CreateProgramFromBinary(pContext, &device, "kernel_data_param");
auto mockProgram = (MockProgram *)pProgram;
ASSERT_NE(nullptr, mockProgram);
@ -219,10 +221,10 @@ TEST_F(ProgramNonUniformTest, GivenCl21WhenExecutingKernelWithNonUniformThenEnqu
delete pKernel;
}
}
TEST_F(ProgramNonUniformTest, GivenCl20WhenExecutingKernelWithNonUniformThenEnqueueSucceeds) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.0") != std::string::npos) {
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
CreateProgramFromBinary(pContext, &device, "kernel_data_param");
auto mockProgram = pProgram;
ASSERT_NE(nullptr, mockProgram);
@ -246,7 +248,7 @@ TEST_F(ProgramNonUniformTest, GivenCl20WhenExecutingKernelWithNonUniformThenEnqu
ASSERT_NE(nullptr, pKernel);
size_t globalWorkSize[3] = {12, 12, 12};
size_t localWorkSize[3] = {11, 12, 12};
size_t localWorkSize[3] = {11, 12, 1};
retVal = pCmdQ->enqueueKernel(
pKernel,
@ -261,7 +263,6 @@ TEST_F(ProgramNonUniformTest, GivenCl20WhenExecutingKernelWithNonUniformThenEnqu
delete pKernel;
}
}
TEST_F(ProgramNonUniformTest, GivenCl12WhenExecutingKernelWithNonUniformThenInvalidWorkGroupSizeIsReturned) {
CreateProgramFromBinary(pContext, &device, "kernel_data_param");

View File

@ -16,6 +16,7 @@
#include "opencl/test/unit_test/fixtures/run_kernel_fixture.h"
#include "opencl/test/unit_test/mocks/mock_context.h"
#include "opencl/test/unit_test/mocks/mock_program.h"
#include "opencl/test/unit_test/test_macros/test_checks_ocl.h"
#include <vector>
@ -38,6 +39,7 @@ class ProgramWithBlockKernelsTest : public ContextFixture,
device = pPlatform->getClDevice(0);
ContextFixture::SetUp(1, &device);
ProgramFixture::SetUp();
REQUIRE_OCL_21_OR_SKIP(pContext);
}
void TearDown() override {
@ -50,7 +52,6 @@ class ProgramWithBlockKernelsTest : public ContextFixture,
};
TEST_F(ProgramWithBlockKernelsTest, GivenKernelWithBlockKernelsWhenProgramIsBuildingThenKernelInfosHaveCorrectNames) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.") != std::string::npos) {
CreateProgramFromBinary(pContext, &device, "simple_block_kernel", "-cl-std=CL2.0");
auto mockProgram = (MockProgram *)pProgram;
ASSERT_NE(nullptr, mockProgram);
@ -87,14 +88,9 @@ TEST_F(ProgramWithBlockKernelsTest, GivenKernelWithBlockKernelsWhenProgramIsBuil
}
EXPECT_TRUE(blockKernelFound);
} else {
EXPECT_EQ(nullptr, pProgram);
}
}
TEST_F(ProgramWithBlockKernelsTest, GivenKernelWithBlockKernelsWhenProgramIsLinkedThenBlockKernelsAreSeparated) {
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.0") != std::string::npos) {
CreateProgramFromBinary(pContext, &device, "simple_block_kernel", "-cl-std=CL2.0");
const char *buildOptions = "-cl-std=CL2.0";
@ -127,8 +123,6 @@ TEST_F(ProgramWithBlockKernelsTest, GivenKernelWithBlockKernelsWhenProgramIsLink
}
restoreBuiltInBinaryName(nullptr);
delete programLinked;
} else {
EXPECT_EQ(nullptr, pProgram);
}
}
} // namespace NEO