mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Add ClDeviceInfo
DeviceInfo contains a subset of ClDeviceInfo values. Related-To: NEO-3938 Change-Id: Idae4fae4d25e1fb3106d8b95294fa70ebc6281df Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
c5454d6cce
commit
5ac8d8e667
@ -67,7 +67,7 @@ TEST_F(clCreateImageTest, GivenNullHostPtrWhenCreatingImageThenImageIsCreatedAnd
|
||||
}
|
||||
|
||||
HWTEST_F(clCreateImageTest, GivenDeviceThatDoesntSupportImagesWhenCreatingTiledImageThenInvalidOperationErrorIsReturned) {
|
||||
auto device = static_cast<MockDevice *>(&pContext->getDevice(0)->getDevice());
|
||||
auto device = static_cast<MockClDevice *>(pContext->getDevice(0));
|
||||
device->deviceInfo.imageSupport = CL_FALSE;
|
||||
cl_bool imageSupportInfo = CL_TRUE;
|
||||
auto status = clGetDeviceInfo(devices[testedRootDeviceIndex], CL_DEVICE_IMAGE_SUPPORT, sizeof(imageSupportInfo), &imageSupportInfo, nullptr);
|
||||
@ -94,7 +94,7 @@ HWTEST_F(clCreateImageTest, GivenDeviceThatDoesntSupportImagesWhenCreatingTiledI
|
||||
}
|
||||
|
||||
HWTEST_F(clCreateImageTest, GivenDeviceThatDoesntSupportImagesWhenCreatingNonTiledImageThenCreate) {
|
||||
auto device = static_cast<MockDevice *>(&pContext->getDevice(0)->getDevice());
|
||||
auto device = static_cast<MockClDevice *>(pContext->getDevice(0));
|
||||
device->deviceInfo.imageSupport = CL_FALSE;
|
||||
cl_bool imageSupportInfo = CL_TRUE;
|
||||
auto status = clGetDeviceInfo(devices[testedRootDeviceIndex], CL_DEVICE_IMAGE_SUPPORT, sizeof(imageSupportInfo), &imageSupportInfo, nullptr);
|
||||
|
@ -169,7 +169,7 @@ TEST(clCreatePipeTest, givenPlatformWithoutDevicesWhenClCreatePipeIsCalledThenDe
|
||||
executionEnvironment->initializeMemoryManager();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
auto device = std::make_unique<ClDevice>(*Device::create<RootDevice>(executionEnvironment, 0u), platform());
|
||||
const DeviceInfo &devInfo = device->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = device->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities == 0) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ class EnqueueReadBufferTest : public api_tests {
|
||||
}
|
||||
};
|
||||
TEST_F(EnqueueReadBufferTest, GivenSvmPtrWhenReadingBufferThenSuccessIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(testedRootDeviceIndex)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(testedRootDeviceIndex)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
auto data = clSVMAlloc(pContext, CL_MEM_READ_WRITE, bufferSize, 64);
|
||||
auto retVal = clEnqueueReadBuffer(pCommandQueue, buffer, CL_TRUE, bufferSize, 0, data, 0, nullptr, nullptr);
|
||||
|
@ -48,7 +48,7 @@ TEST_F(clEnqueueSVMFreeTests, GivenNonZeroNumOfSVMPointersAndNullSVMPointersWhen
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMFreeTests, GivenZeroNumOfSVMPointersAndNonNullSVMPointersWhenFreeingSVMThenInvalidValueErrorIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
EXPECT_NE(nullptr, ptrSvm);
|
||||
@ -101,7 +101,7 @@ TEST_F(clEnqueueSVMFreeTests, GivenZeroNumOfEventsAndNonNullEventListWhenFreeing
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMFreeTests, GivenNonZeroNumOfSVMPointersAndNonNullSVMPointersWhenFreeingSVMThenSuccessIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
EXPECT_NE(nullptr, ptrSvm);
|
||||
@ -124,7 +124,7 @@ TEST_F(clEnqueueSVMFreeTests, GivenNonZeroNumOfSVMPointersAndNonNullSVMPointersW
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMFreeTests, GivenZeroNumOfSVMPointersAndNullSVMPointersWhenFreeingSVMThenSuccessIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
auto retVal = clEnqueueSVMFree(
|
||||
pCommandQueue, // cl_command_queue command_queue
|
||||
|
@ -47,7 +47,7 @@ TEST_F(clEnqueueSVMMapTests, GivenNullSVMPointerWhenMappingSVMThenInvalidValueEr
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMMapTests, GivenRegionSizeZeroWhenMappingSVMThenInvalidValueErrorIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
EXPECT_NE(nullptr, ptrSvm);
|
||||
@ -99,7 +99,7 @@ TEST_F(clEnqueueSVMMapTests, GivenNonNullEventWaitListAndZeroNumEventsWhenMappin
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMMapTests, GivenValidParametersWhenMappingSVMThenSuccessIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
EXPECT_NE(nullptr, ptrSvm);
|
||||
|
@ -47,7 +47,7 @@ TEST_F(clEnqueueSVMMemFillTests, GivenNullSVMPtrWhenFillingSVMMemoryThenInvalidV
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMMemFillTests, GivenRegionSizeZeroWhenFillingSVMMemoryThenInvalidValueErrorIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
EXPECT_NE(nullptr, ptrSvm);
|
||||
@ -99,7 +99,7 @@ TEST_F(clEnqueueSVMMemFillTests, GivenNonNullEventWaitListAndZeroEventsWhenFilli
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMMemFillTests, GivenValidParametersWhenFillingSVMMemoryThenSuccessIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
EXPECT_NE(nullptr, ptrSvm);
|
||||
|
@ -33,7 +33,7 @@ TEST_F(clEnqueueSVMMemcpyTests, GivenInvalidCommandQueueWhenCopyingSVMMemoryThen
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMMemcpyTests, GivenNullDstPtrWhenCopyingSVMMemoryThenInvalidValueErrorIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *pSrcSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
EXPECT_NE(nullptr, pSrcSvm);
|
||||
@ -55,7 +55,7 @@ TEST_F(clEnqueueSVMMemcpyTests, GivenNullDstPtrWhenCopyingSVMMemoryThenInvalidVa
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMMemcpyTests, GivenNullSrcPtrWhenCopyingSVMMemoryThenInvalidValueErrorIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *pDstSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
EXPECT_NE(nullptr, pDstSvm);
|
||||
@ -107,7 +107,7 @@ TEST_F(clEnqueueSVMMemcpyTests, GivenZeroEventsAndNonNullEventListWhenCopyingSVM
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMMemcpyTests, GivenNonZeroSizeWhenCopyingSVMMemoryThenSuccessIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *pDstSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
EXPECT_NE(nullptr, pDstSvm);
|
||||
@ -132,7 +132,7 @@ TEST_F(clEnqueueSVMMemcpyTests, GivenNonZeroSizeWhenCopyingSVMMemoryThenSuccessI
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMMemcpyTests, GivenZeroSizeWhenCopyingSVMMemoryThenSuccessIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *pDstSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
EXPECT_NE(nullptr, pDstSvm);
|
||||
|
@ -50,7 +50,7 @@ TEST_F(clEnqueueSVMMigrateMemTests, GivenNullSvmPointersWhenMigratingSvmThenInva
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMMigrateMemTests, GivenNumSvmPointersIsZeroWhenMigratingSvmThenInvalidValueErrorIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
ASSERT_NE(nullptr, ptrSvm);
|
||||
@ -93,7 +93,7 @@ TEST_F(clEnqueueSVMMigrateMemTests, GivenSvmPointerIsHostPtrWhenMigratingSvmThen
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMMigrateMemTests, GivenNonZeroSizeIsNotContainedWithinAllocationWhenMigratingSvmThenInvalidValueErrorIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
ASSERT_NE(nullptr, ptrSvm);
|
||||
@ -123,7 +123,7 @@ TEST_F(clEnqueueSVMMigrateMemTests, GivenNonZeroSizeIsNotContainedWithinAllocati
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMMigrateMemTests, GivenUnsupportedFlagsWhenMigratingSvmThenInvalidValueErrorIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
ASSERT_NE(nullptr, ptrSvm);
|
||||
@ -176,7 +176,7 @@ TEST_F(clEnqueueSVMMigrateMemTests, GivenNonNullEventWaitListAndZeroNumEventsWhe
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMMigrateMemTests, GivenDifferentContextCommandQueueAndEventsWhenMigratingSvmThenInvalidContextErrorIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
ASSERT_NE(nullptr, ptrSvm);
|
||||
@ -202,7 +202,7 @@ TEST_F(clEnqueueSVMMigrateMemTests, GivenDifferentContextCommandQueueAndEventsWh
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMMigrateMemTests, GivenNullSizesWhenMigratingSvmThenSuccessIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
ASSERT_NE(nullptr, ptrSvm);
|
||||
@ -225,7 +225,7 @@ TEST_F(clEnqueueSVMMigrateMemTests, GivenNullSizesWhenMigratingSvmThenSuccessIsR
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMMigrateMemTests, GivenSizeZeroWhenMigratingSvmThenSuccessIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
ASSERT_NE(nullptr, ptrSvm);
|
||||
@ -249,7 +249,7 @@ TEST_F(clEnqueueSVMMigrateMemTests, GivenSizeZeroWhenMigratingSvmThenSuccessIsRe
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMMigrateMemTests, GivenNonZeroSizeWhenMigratingSvmThenSuccessIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
ASSERT_NE(nullptr, ptrSvm);
|
||||
@ -273,7 +273,7 @@ TEST_F(clEnqueueSVMMigrateMemTests, GivenNonZeroSizeWhenMigratingSvmThenSuccessI
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMMigrateMemTests, GivenSameContextCommandQueueAndEventsWhenMigratingSvmThenSuccessIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
ASSERT_NE(nullptr, ptrSvm);
|
||||
|
@ -65,7 +65,7 @@ TEST_F(clEnqueueSVMUnmapTests, GivenNonNullEventListAndZeroEventsWhenUnmappingSv
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueSVMUnmapTests, GivenValidParametersWhenUnmappingSvmThenSuccessIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
EXPECT_NE(nullptr, ptrSvm);
|
||||
|
@ -16,7 +16,7 @@ struct KernelSubGroupInfoKhrFixture : HelloWorldFixture<HelloWorldFixtureFactory
|
||||
ParentClass::SetUp();
|
||||
MaxSimdSize = static_cast<size_t>(pKernel->getKernelInfo().getMaxSimdSize());
|
||||
ASSERT_GE(MaxSimdSize, 8u);
|
||||
MaxWorkDim = static_cast<size_t>(pDevice->getDeviceInfo().maxWorkItemDimensions);
|
||||
MaxWorkDim = static_cast<size_t>(pClDevice->getDeviceInfo().maxWorkItemDimensions);
|
||||
ASSERT_EQ(MaxWorkDim, 3u);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ struct KernelSubGroupInfoFixture : HelloWorldFixture<HelloWorldFixtureFactory> {
|
||||
pKernel->maxKernelWorkGroupSize = static_cast<uint32_t>(pDevice->getDeviceInfo().maxWorkGroupSize / 2);
|
||||
maxSimdSize = static_cast<size_t>(pKernel->getKernelInfo().getMaxSimdSize());
|
||||
ASSERT_LE(8u, maxSimdSize);
|
||||
maxWorkDim = static_cast<size_t>(pDevice->getDeviceInfo().maxWorkItemDimensions);
|
||||
maxWorkDim = static_cast<size_t>(pClDevice->getDeviceInfo().maxWorkItemDimensions);
|
||||
ASSERT_EQ(3u, maxWorkDim);
|
||||
maxWorkGroupSize = static_cast<size_t>(pKernel->maxKernelWorkGroupSize);
|
||||
ASSERT_GE(1024u, maxWorkGroupSize);
|
||||
@ -91,7 +91,7 @@ INSTANTIATE_TEST_CASE_P(wgs,
|
||||
::testing::ValuesIn(WorkDimensions)));
|
||||
|
||||
TEST_P(KernelSubGroupInfoReturnSizeTest, GivenWorkGroupSizeWhenGettingMaxSubGroupSizeThenReturnIsCalculatedCorrectly) {
|
||||
if (std::string(pDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
WorkSizeParam workSize;
|
||||
size_t workDim;
|
||||
std::tie(workSize, workDim) = GetParam();
|
||||
@ -145,7 +145,7 @@ INSTANTIATE_TEST_CASE_P(wgs,
|
||||
::testing::ValuesIn(WorkDimensions)));
|
||||
|
||||
TEST_P(KernelSubGroupInfoReturnCountTest, GivenWorkGroupSizeWhenGettingSubGroupCountThenReturnIsCalculatedCorrectly) {
|
||||
if (std::string(pDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
WorkSizeParam workSize;
|
||||
size_t workDim;
|
||||
std::tie(workSize, workDim) = GetParam();
|
||||
@ -201,7 +201,7 @@ INSTANTIATE_TEST_CASE_P(sgn,
|
||||
::testing::ValuesIn(WorkDimensions)));
|
||||
|
||||
TEST_P(KernelSubGroupInfoReturnLocalSizeTest, GivenWorkGroupSizeWhenGettingLocalSizeThenReturnIsCalculatedCorrectly) {
|
||||
if (std::string(pDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
size_t subGroupsNum;
|
||||
size_t workDim;
|
||||
std::tie(subGroupsNum, workDim) = GetParam();
|
||||
@ -240,7 +240,7 @@ TEST_P(KernelSubGroupInfoReturnLocalSizeTest, GivenWorkGroupSizeWhenGettingLocal
|
||||
typedef KernelSubGroupInfoParamFixture<WorkSizeParam> KernelSubGroupInfoReturnMaxNumberTest;
|
||||
|
||||
TEST_F(KernelSubGroupInfoReturnMaxNumberTest, GivenWorkGroupSizeWhenGettingMaxNumSubGroupsThenReturnIsCalculatedCorrectly) {
|
||||
if (std::string(pDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
retVal = clGetKernelSubGroupInfo(
|
||||
pKernel,
|
||||
pClDevice,
|
||||
@ -260,7 +260,7 @@ TEST_F(KernelSubGroupInfoReturnMaxNumberTest, GivenWorkGroupSizeWhenGettingMaxNu
|
||||
typedef KernelSubGroupInfoParamFixture<WorkSizeParam> KernelSubGroupInfoReturnCompileNumberTest;
|
||||
|
||||
TEST_F(KernelSubGroupInfoReturnCompileNumberTest, GivenKernelWhenGettingCompileNumSubGroupThenReturnIsCalculatedCorrectly) {
|
||||
if (std::string(pDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
retVal = clGetKernelSubGroupInfo(
|
||||
pKernel,
|
||||
pClDevice,
|
||||
@ -280,7 +280,7 @@ TEST_F(KernelSubGroupInfoReturnCompileNumberTest, GivenKernelWhenGettingCompileN
|
||||
typedef KernelSubGroupInfoParamFixture<WorkSizeParam> KernelSubGroupInfoReturnCompileSizeTest;
|
||||
|
||||
TEST_F(KernelSubGroupInfoReturnCompileSizeTest, GivenKernelWhenGettingCompileSubGroupSizeThenReturnIsCalculatedCorrectly) {
|
||||
if (std::string(pDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
retVal = clGetKernelSubGroupInfo(
|
||||
pKernel,
|
||||
pClDevice,
|
||||
@ -308,7 +308,7 @@ TEST_F(KernelSubGroupInfoReturnCompileSizeTest, GivenKernelWhenGettingCompileSub
|
||||
}
|
||||
|
||||
TEST_F(KernelSubGroupInfoTest, GivenNullKernelWhenGettingSubGroupInfoThenInvalidKernelErrorIsReturned) {
|
||||
if (std::string(pDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
retVal = clGetKernelSubGroupInfo(
|
||||
nullptr,
|
||||
pClDevice,
|
||||
@ -324,7 +324,7 @@ TEST_F(KernelSubGroupInfoTest, GivenNullKernelWhenGettingSubGroupInfoThenInvalid
|
||||
}
|
||||
|
||||
TEST_F(KernelSubGroupInfoTest, GivenNullDeviceWhenGettingSubGroupInfoThenInvalidDeviceErrorIsReturned) {
|
||||
if (std::string(pDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
retVal = clGetKernelSubGroupInfo(
|
||||
pKernel,
|
||||
nullptr,
|
||||
@ -340,7 +340,7 @@ TEST_F(KernelSubGroupInfoTest, GivenNullDeviceWhenGettingSubGroupInfoThenInvalid
|
||||
}
|
||||
|
||||
TEST_F(KernelSubGroupInfoTest, GivenInvalidParamNameWhenGettingSubGroupInfoThenInvalidValueErrorIsReturned) {
|
||||
if (std::string(pDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
retVal = clGetKernelSubGroupInfo(
|
||||
pKernel,
|
||||
pClDevice,
|
||||
@ -376,6 +376,7 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenOpenClVersionLowerThan21WhenGetti
|
||||
if (requireOpenCL21) {
|
||||
DebugManager.flags.ForceOCLVersion.set(20);
|
||||
pDevice->initializeCaps();
|
||||
pClDevice->initializeCaps();
|
||||
|
||||
retVal = clGetKernelSubGroupInfo(
|
||||
pKernel,
|
||||
@ -391,11 +392,12 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenOpenClVersionLowerThan21WhenGetti
|
||||
|
||||
DebugManager.flags.ForceOCLVersion.set(0);
|
||||
pDevice->initializeCaps();
|
||||
pClDevice->initializeCaps();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(KernelSubGroupInfoInputParamsTest, GivenWorkDimZeroWhenGettingSubGroupInfoThenSuccessOrErrorIsCorrectlyReturned) {
|
||||
if (std::string(pDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
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);
|
||||
@ -415,7 +417,7 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenWorkDimZeroWhenGettingSubGroupInf
|
||||
}
|
||||
|
||||
TEST_P(KernelSubGroupInfoInputParamsTest, GivenIndivisibleWorkDimWhenGettingSubGroupInfoThenSuccessOrErrorIsCorrectlyReturned) {
|
||||
if (std::string(pDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
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);
|
||||
@ -439,7 +441,7 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenIndivisibleWorkDimWhenGettingSubG
|
||||
}
|
||||
|
||||
TEST_P(KernelSubGroupInfoInputParamsTest, GivenWorkDimGreaterThanMaxWorkDimWhenGettingSubGroupInfoThenSuccessOrErrorIsCorrectlyReturned) {
|
||||
if (std::string(pDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
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);
|
||||
@ -463,7 +465,7 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenWorkDimGreaterThanMaxWorkDimWhenG
|
||||
}
|
||||
|
||||
TEST_P(KernelSubGroupInfoInputParamsTest, GivenInputValueIsNullWhenGettingSubGroupInfoThenSuccessOrErrorIsCorrectlyReturned) {
|
||||
if (std::string(pDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
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);
|
||||
@ -487,7 +489,7 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenInputValueIsNullWhenGettingSubGro
|
||||
}
|
||||
|
||||
TEST_P(KernelSubGroupInfoInputParamsTest, GivenParamValueSizeZeroWhenGettingSubGroupInfoThenInvalidValueErrorIsReturned) {
|
||||
if (std::string(pDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
|
||||
retVal = clGetKernelSubGroupInfo(
|
||||
pKernel,
|
||||
@ -504,7 +506,7 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenParamValueSizeZeroWhenGettingSubG
|
||||
}
|
||||
|
||||
TEST_P(KernelSubGroupInfoInputParamsTest, GivenUnalignedParamValueSizeWhenGettingSubGroupInfoThenInvalidValueErrorIsReturned) {
|
||||
if (std::string(pDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
size_t workDim = (GetParam() == CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT) ? maxWorkDim : 1;
|
||||
|
||||
retVal = clGetKernelSubGroupInfo(
|
||||
@ -522,7 +524,7 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenUnalignedParamValueSizeWhenGettin
|
||||
}
|
||||
|
||||
TEST_P(KernelSubGroupInfoInputParamsTest, GivenTooLargeParamValueSizeWhenGettingSubGroupInfoThenCorrectRetValIsReturned) {
|
||||
if (std::string(pDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
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;
|
||||
|
||||
@ -542,7 +544,7 @@ TEST_P(KernelSubGroupInfoInputParamsTest, GivenTooLargeParamValueSizeWhenGetting
|
||||
}
|
||||
|
||||
TEST_P(KernelSubGroupInfoInputParamsTest, GivenNullPtrForReturnWhenGettingKernelSubGroupInfoThenSuccessIsReturned) {
|
||||
if (std::string(pDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
if (std::string(pClDevice->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
|
||||
bool requireOutputArray = (GetParam() == CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT);
|
||||
|
||||
retVal = clGetKernelSubGroupInfo(
|
||||
|
@ -82,7 +82,7 @@ TEST_F(clGetMemObjectInfoTests, GivenBufferWithMappedRegionWhenGettingMemObjectI
|
||||
}
|
||||
|
||||
TEST_F(clGetMemObjectInfoTests, GivenBufferCreatedFromSvmPointerWhenGettingMemObjectInfoThenClTrueIsReturned) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
size_t bufferSize = 64;
|
||||
cl_mem buffer = nullptr;
|
||||
|
@ -97,7 +97,7 @@ TEST(clGetSupportedImageFormatsTest, givenPlatformWithoutDevicesWhenClGetSupport
|
||||
executionEnvironment->initializeMemoryManager();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
auto device = std::make_unique<ClDevice>(*Device::create<RootDevice>(executionEnvironment, 0u), platform());
|
||||
const DeviceInfo &devInfo = device->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = device->getDeviceInfo();
|
||||
if (!devInfo.imageSupport) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ TEST_F(clIcdGetPlatformIDsKHRTests, checkDeviceId) {
|
||||
}
|
||||
|
||||
TEST_F(clIcdGetPlatformIDsKHRTests, checkExtensionString) {
|
||||
const DeviceInfo &caps = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &caps = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
EXPECT_NE(std::string::npos, std::string(caps.deviceExtensions).find("cl_khr_icd"));
|
||||
}
|
||||
} // namespace ULT
|
||||
|
@ -99,7 +99,8 @@ TEST_F(clSetKernelArgSVMPointerTests, GivenLocalAddressAndNullArgValueWhenSettin
|
||||
}
|
||||
|
||||
TEST_F(clSetKernelArgSVMPointerTests, GivenInvalidArgValueWhenSettingKernelArgThenInvalidArgValueErrorIsReturned) {
|
||||
pDevice->deviceInfo.sharedSystemMemCapabilities = 0u;
|
||||
pClDevice->deviceInfo.sharedSystemMemCapabilities = 0u;
|
||||
pClDevice->device.deviceInfo.sharedSystemAllocationsSupport = false;
|
||||
void *ptrHost = malloc(256);
|
||||
EXPECT_NE(nullptr, ptrHost);
|
||||
|
||||
@ -114,7 +115,7 @@ TEST_F(clSetKernelArgSVMPointerTests, GivenInvalidArgValueWhenSettingKernelArgTh
|
||||
}
|
||||
|
||||
TEST_F(clSetKernelArgSVMPointerTests, GivenSvmAndNullArgValueWhenSettingKernelArgThenSuccessIsReturned) {
|
||||
const DeviceInfo &devInfo = pDevice->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pClDevice->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
auto retVal = clSetKernelArgSVMPointer(
|
||||
pMockKernel, // cl_kernel kernel
|
||||
@ -126,7 +127,7 @@ TEST_F(clSetKernelArgSVMPointerTests, GivenSvmAndNullArgValueWhenSettingKernelAr
|
||||
}
|
||||
|
||||
TEST_F(clSetKernelArgSVMPointerTests, GivenSvmAndValidArgValueWhenSettingKernelArgThenSuccessIsReturned) {
|
||||
const DeviceInfo &devInfo = pDevice->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pClDevice->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
EXPECT_NE(nullptr, ptrSvm);
|
||||
@ -143,7 +144,7 @@ TEST_F(clSetKernelArgSVMPointerTests, GivenSvmAndValidArgValueWhenSettingKernelA
|
||||
}
|
||||
|
||||
TEST_F(clSetKernelArgSVMPointerTests, GivenSvmAndConstantAddressWhenSettingKernelArgThenSuccessIsReturned) {
|
||||
const DeviceInfo &devInfo = pDevice->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pClDevice->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
EXPECT_NE(nullptr, ptrSvm);
|
||||
@ -162,7 +163,7 @@ TEST_F(clSetKernelArgSVMPointerTests, GivenSvmAndConstantAddressWhenSettingKerne
|
||||
}
|
||||
|
||||
TEST_F(clSetKernelArgSVMPointerTests, GivenSvmAndPointerWithOffsetWhenSettingKernelArgThenSuccessIsReturned) {
|
||||
const DeviceInfo &devInfo = pDevice->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pClDevice->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
size_t offset = 256 / 2;
|
||||
@ -180,8 +181,9 @@ TEST_F(clSetKernelArgSVMPointerTests, GivenSvmAndPointerWithOffsetWhenSettingKer
|
||||
}
|
||||
|
||||
TEST_F(clSetKernelArgSVMPointerTests, GivenSvmAndPointerWithInvalidOffsetWhenSettingKernelArgThenInvalidArgValueErrorIsReturned) {
|
||||
pDevice->deviceInfo.sharedSystemMemCapabilities = 0u;
|
||||
const DeviceInfo &devInfo = pDevice->getDeviceInfo();
|
||||
pClDevice->deviceInfo.sharedSystemMemCapabilities = 0u;
|
||||
pClDevice->device.deviceInfo.sharedSystemAllocationsSupport = false;
|
||||
const ClDeviceInfo &devInfo = pClDevice->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
auto svmData = pContext->getSVMAllocsManager()->getSVMAlloc(ptrSvm);
|
||||
|
@ -22,7 +22,7 @@ class KernelExecInfoFixture : public ApiFixture<> {
|
||||
|
||||
pMockKernel = new MockKernel(pProgram, *pKernelInfo, *pPlatform->getClDevice(testedRootDeviceIndex));
|
||||
ASSERT_EQ(CL_SUCCESS, pMockKernel->initialize());
|
||||
svmCapabilities = pPlatform->getDevice(testedRootDeviceIndex)->getDeviceInfo().svmCapabilities;
|
||||
svmCapabilities = pPlatform->getClDevice(testedRootDeviceIndex)->getDeviceInfo().svmCapabilities;
|
||||
if (svmCapabilities != 0) {
|
||||
ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);
|
||||
EXPECT_NE(nullptr, ptrSvm);
|
||||
|
@ -41,9 +41,8 @@ TEST(clSVMAllocTest, givenPlatformWithoutDevicesWhenClSVMAllocIsCalledThenDevice
|
||||
auto executionEnvironment = platform()->peekExecutionEnvironment();
|
||||
executionEnvironment->initializeMemoryManager();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
auto device = Device::create<RootDevice>(executionEnvironment, 0u);
|
||||
auto clDevice = std::make_unique<ClDevice>(*device, platform());
|
||||
const DeviceInfo &devInfo = device->getDeviceInfo();
|
||||
auto clDevice = std::make_unique<ClDevice>(*Device::create<RootDevice>(executionEnvironment, 0u), platform());
|
||||
const ClDeviceInfo &devInfo = clDevice->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities == 0) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
@ -61,7 +60,7 @@ TEST(clSVMAllocTest, givenPlatformWithoutDevicesWhenClSVMAllocIsCalledThenDevice
|
||||
|
||||
TEST_P(clSVMAllocValidFlagsTests, GivenSvmSupportWhenAllocatingSvmThenSvmIsAllocated) {
|
||||
cl_mem_flags flags = GetParam();
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
//check for svm support
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
//fg svm flag
|
||||
@ -185,7 +184,7 @@ TEST_F(clSVMAllocTests, GivenZeroSizeWhenAllocatingSvmThenSvmIsNotAllocated) {
|
||||
}
|
||||
|
||||
TEST_F(clSVMAllocTests, GivenZeroAlignmentWhenAllocatingSvmThenSvmIsAllocated) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
cl_mem_flags flags = CL_MEM_READ_WRITE;
|
||||
auto SVMPtr = clSVMAlloc(pContext /* cl_context */, flags, 4096 /* Size*/, 0 /* alignment */);
|
||||
@ -195,7 +194,7 @@ TEST_F(clSVMAllocTests, GivenZeroAlignmentWhenAllocatingSvmThenSvmIsAllocated) {
|
||||
}
|
||||
|
||||
TEST_F(clSVMAllocTests, GivenUnalignedSizeAndDefaultAlignmentWhenAllocatingSvmThenSvmIsAllocated) {
|
||||
const DeviceInfo &devInfo = pPlatform->getDevice(0)->getDeviceInfo();
|
||||
const ClDeviceInfo &devInfo = pPlatform->getClDevice(0)->getDeviceInfo();
|
||||
if (devInfo.svmCapabilities != 0) {
|
||||
cl_mem_flags flags = CL_MEM_READ_WRITE;
|
||||
auto SVMPtr = clSVMAlloc(pContext /* cl_context */, flags, 4095 /* Size*/, 0 /* alignment */);
|
||||
|
Reference in New Issue
Block a user