mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Return 0 when Program Scope Global Variables are not supported
clGetDeviceInfo and clGetProgramBuildInfo may return 0 when Program Scope Global Variables are not supported Related-To: NEO-4368 Change-Id: I2c319c53ffa2e02eeb370775023f5d73219cb39e Signed-off-by: Andrzej Swierczynski <andrzej.swierczynski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
853d870d1c
commit
42810f4690
@@ -478,6 +478,38 @@ TEST(GetDeviceInfo, GivenSimultaneousInteropsWhenGettingDeviceInfoThenCorrectVal
|
||||
EXPECT_TRUE(memcmp(value, &device->simultaneousInterops[0], 4u * sizeof(cl_uint)) == 0);
|
||||
}
|
||||
|
||||
TEST(GetDeviceInfo, GivenMaxGlobalVariableSizeWhenGettingDeviceInfoThenCorrectValueIsReturned) {
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||
|
||||
size_t value = 0;
|
||||
size_t size = 0;
|
||||
|
||||
auto retVal = device->getDeviceInfo(CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE, sizeof(size_t), &value, &size);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_EQ(sizeof(size_t), size);
|
||||
if (device->getEnabledClVersion() >= 20) {
|
||||
EXPECT_EQ(value, 65536u);
|
||||
} else {
|
||||
EXPECT_EQ(value, 0u);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(GetDeviceInfo, GivenGlobalVariablePreferredTotalSizeWhenGettingDeviceInfoThenCorrectValueIsReturned) {
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||
|
||||
size_t value = 0;
|
||||
size_t size = 0;
|
||||
|
||||
auto retVal = device->getDeviceInfo(CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE, sizeof(size_t), &value, &size);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_EQ(sizeof(size_t), size);
|
||||
if (device->getEnabledClVersion() >= 20) {
|
||||
EXPECT_EQ(value, static_cast<size_t>(device->getSharedDeviceInfo().maxMemAllocSize));
|
||||
} else {
|
||||
EXPECT_EQ(value, 0u);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(GetDeviceInfo, GivenPreferredInteropsWhenGettingDeviceInfoThenCorrectValueIsReturned) {
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user