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();
@ -121,7 +123,6 @@ TEST_P(KernelSubGroupInfoReturnSizeTest, GivenWorkGroupSizeWhenGettingMaxSubGrou
EXPECT_EQ(paramValueSizeRet, sizeof(size_t));
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();
@ -175,7 +177,6 @@ TEST_P(KernelSubGroupInfoReturnCountTest, GivenWorkGroupSizeWhenGettingSubGroupC
} else {
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();
@ -222,13 +224,13 @@ TEST_P(KernelSubGroupInfoReturnLocalSizeTest, GivenWorkGroupSizeWhenGettingLocal
if (workDim > 2) {
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,
@ -242,13 +244,13 @@ TEST_F(KernelSubGroupInfoReturnMaxNumberTest, GivenWorkGroupSizeWhenGettingMaxNu
EXPECT_EQ(CL_SUCCESS, retVal);
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,
@ -262,13 +264,13 @@ TEST_F(KernelSubGroupInfoReturnCompileNumberTest, GivenKernelWhenGettingCompileN
EXPECT_EQ(CL_SUCCESS, retVal);
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,
@ -292,11 +294,11 @@ 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,
@ -308,11 +310,11 @@ TEST_F(KernelSubGroupInfoTest, GivenNullKernelWhenGettingSubGroupInfoThenInvalid
nullptr);
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,
@ -324,11 +326,11 @@ TEST_F(KernelSubGroupInfoTest, GivenNullDeviceWhenGettingSubGroupInfoThenInvalid
nullptr);
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,
@ -340,7 +342,6 @@ TEST_F(KernelSubGroupInfoTest, GivenInvalidParamNameWhenGettingSubGroupInfoThenI
nullptr);
EXPECT_EQ(CL_INVALID_VALUE, retVal);
}
}
uint32_t /*cl_kernel_sub_group_info*/ KernelSubGroupInfoInputParams[] = {
@ -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);
@ -401,11 +403,11 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenWorkDimZeroWhenGettingSubGroupInf
nullptr);
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);
@ -425,11 +427,11 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenIndivisibleWorkDimWhenGettingSubG
nullptr);
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);
@ -449,11 +451,11 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenWorkDimGreaterThanMaxWorkDimWhenG
nullptr);
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);
@ -473,11 +475,10 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenInputValueIsNullWhenGettingSubGro
nullptr);
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,
@ -490,11 +491,11 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenParamValueSizeZeroWhenGettingSubG
nullptr);
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(
@ -508,11 +509,11 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenUnalignedParamValueSizeWhenGettin
nullptr);
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;
@ -528,11 +529,11 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenTooLargeParamValueSizeWhenGetting
nullptr);
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(
@ -546,6 +547,5 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenNullPtrForReturnWhenGettingKernel
nullptr);
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();
@ -549,11 +553,9 @@ 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();
@ -576,13 +578,11 @@ 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();
@ -610,14 +610,12 @@ HWCMDTEST_P(IGFX_GEN8_CORE, DeviceQueueHwWithKernel, WhenSettingUpIndirectStateT
alignedFree(ssh->getCpuBase());
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;
@ -645,7 +643,6 @@ HWCMDTEST_P(IGFX_GEN8_CORE, DeviceQueueHwWithKernel, GivenHasBarriersSetWhenCall
}
alignedFree(ssh->getCpuBase());
}
}
static const char *binaryFile = "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};
@ -120,11 +119,9 @@ 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;
@ -151,11 +148,9 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlockKernelWithPrivate
pCmdQ->enqueueKernel(pKernel, 1, offset, gws, gws, 0, nullptr, nullptr);
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};
@ -188,11 +183,9 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlocksWithPrivateMemor
EXPECT_FALSE(csr.isMadeResident(privateAllocation));
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};
@ -206,11 +199,9 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenParentKernelWithBlocks
for (auto blockId = 0u; blockId < blockCount; blockId++) {
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;
@ -221,11 +212,9 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenBlockKernelManagerFill
for (auto blockId = 0u; blockId < blockCount; blockId++) {
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};
@ -248,13 +237,11 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, GivenParentKernelWithBlocks
for (auto blockId = 0u; blockId < blockCount; blockId++) {
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};
@ -279,12 +266,9 @@ 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};
@ -298,7 +282,6 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelAndNotUsed
auto ssh2 = &getIndirectHeap<FamilyType, IndirectHeap::SURFACE_STATE>(*pCmdQ, multiDispatchInfo);
EXPECT_EQ(ssh, ssh2);
EXPECT_EQ(ssh->getGraphicsAllocation(), ssh2->getGraphicsAllocation());
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueuedThenBlocksSurfaceStatesAreCopied) {
@ -306,8 +289,6 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueu
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};
@ -364,7 +345,6 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueu
delete blockKernel;
}
}
}
HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueuedThenReflectionSurfaceIsCreated) {
@ -372,8 +352,6 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueu
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};
@ -381,12 +359,9 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenParentKernelWhenEnqueu
pCmdQ->enqueueKernel(pKernel, 1, globalOffsets, workItems, workItems, 0, nullptr, nullptr);
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};
@ -405,13 +380,11 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenBlockedQueueWhenParent
pCmdQ->enqueueKernel(pKernel, 1, globalOffsets, workItems, workItems, 1, &eventBlocking, nullptr);
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);
@ -451,7 +424,6 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelEnqueueTest, givenNonBlockedQueueWhenPar
}
}
EXPECT_TRUE(dshAllocationResident);
}
}
INSTANTIATE_TEST_CASE_P(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;
@ -61,11 +60,9 @@ 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);
@ -73,11 +70,9 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenDynam
auto ishOfDevQueue = pDevQueueHw->getIndirectHeap(IndirectHeap::DYNAMIC_STATE);
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);
@ -85,11 +80,9 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenIndir
auto dshOfDevQueue = pDevQueueHw->getIndirectHeap(IndirectHeap::DYNAMIC_STATE);
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};
@ -113,11 +106,9 @@ 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};
@ -144,14 +135,12 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenQueue
size_t minRequiredSizeForEM = HardwareCommandsHelper<FamilyType>::getSshSizeForExecutionModel(*pKernel);
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};
@ -188,7 +177,6 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelDispatchTest, givenParentKernelWhenQueue
EXPECT_GE(minRequiredSize, sshUsed);
// Total SSH size including EM must be greater then ssh allocated
EXPECT_GT(minRequiredSize + minRequiredSizeForEM, sshUsed);
}
}
INSTANTIATE_TEST_CASE_P(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;
@ -1087,7 +1088,6 @@ HWCMDTEST_P(IGFX_GEN8_CORE, ParentKernelCommandsFromBinaryTest, WhenGettingSizeR
totalSize = alignUp(totalSize, BINDING_TABLE_STATE::SURFACESTATEPOINTER_ALIGN_SIZE);
EXPECT_EQ(totalSize, HardwareCommandsHelper<FamilyType>::getSshSizeForExecutionModel(*pKernel));
}
}
static const char *binaryFile = "simple_block_kernel";

View File

@ -37,9 +37,7 @@ 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) {
@ -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();
@ -520,11 +517,9 @@ TEST_P(KernelReflectionSurfaceTest, WhenGettingCurbeParamsThenReturnedVectorIsSo
EXPECT_EQ(curbeParamsForBlock.size() - pBlockInfo->kernelArgInfo.size(), firstSSHTokenIndex);
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();
@ -573,11 +568,9 @@ TEST_P(KernelReflectionSurfaceTest, WhenGettingCurbeParamsThenReturnedVectorHasE
EXPECT_EQ(curbeParamsForBlock.size() - pBlockInfo->kernelArgInfo.size(), firstSSHTokenIndex);
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();
@ -607,7 +600,6 @@ TEST_P(KernelReflectionSurfaceTest, WhenGettingCurbeParamsThenTokenMaskIsCorrect
curbeParamsForBlock.resize(0);
}
}
}
TEST(KernelReflectionSurfaceTestSingle, GivenNonParentKernelWhenCreatingKernelReflectionSurfaceThenKernelReflectionSurfaceIsNotCreated) {
@ -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();
@ -855,7 +846,6 @@ TEST_P(KernelReflectionSurfaceTest, WhenCreatingKernelReflectionSurfaceThenKerne
EXPECT_NE_VAL(0u, kernelData->m_data[j].m_parameterType);
}
}
}
}
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();
@ -1096,12 +1082,9 @@ 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();
@ -1161,7 +1144,6 @@ HWCMDTEST_P(IGFX_GEN8_CORE, KernelReflectionSurfaceWithQueueTest, WhenObtainingK
}
}
}
}
}
INSTANTIATE_TEST_CASE_P(KernelReflectionSurfaceWithQueueTest,

View File

@ -193,11 +193,8 @@ 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";

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);
@ -218,11 +220,11 @@ TEST_F(ProgramNonUniformTest, GivenCl21WhenExecutingKernelWithNonUniformThenEnqu
EXPECT_EQ(CL_SUCCESS, retVal);
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,
@ -260,7 +262,6 @@ TEST_F(ProgramNonUniformTest, GivenCl20WhenExecutingKernelWithNonUniformThenEnqu
EXPECT_EQ(CL_SUCCESS, retVal);
delete pKernel;
}
}
TEST_F(ProgramNonUniformTest, GivenCl12WhenExecutingKernelWithNonUniformThenInvalidWorkGroupSizeIsReturned) {

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