mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-23 11:42:31 +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
@@ -550,6 +550,7 @@ TEST_P(ProgramFromBinaryTest, GivenGlobalVariableTotalSizeSetWhenGettingBuildGlo
|
||||
paramValueSize,
|
||||
paramValue,
|
||||
¶mValueSizeRet);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_EQ(paramValueSizeRet, sizeof(globalVarSize));
|
||||
EXPECT_EQ(globalVarSize, 0u);
|
||||
@@ -557,7 +558,12 @@ TEST_P(ProgramFromBinaryTest, GivenGlobalVariableTotalSizeSetWhenGettingBuildGlo
|
||||
// Set GlobalVariableTotalSize as 1024
|
||||
CreateProgramFromBinary(pContext, &device, BinaryFileName);
|
||||
MockProgram *p = pProgram;
|
||||
p->SetGlobalVariableTotalSize(1024u);
|
||||
ProgramInfo programInfo;
|
||||
|
||||
char constantData[1024] = {};
|
||||
programInfo.globalVariables.initData = constantData;
|
||||
programInfo.globalVariables.size = sizeof(constantData);
|
||||
p->processProgramInfo(programInfo);
|
||||
|
||||
// get build info once again
|
||||
retVal = pProgram->getBuildInfo(
|
||||
@@ -568,7 +574,11 @@ TEST_P(ProgramFromBinaryTest, GivenGlobalVariableTotalSizeSetWhenGettingBuildGlo
|
||||
¶mValueSizeRet);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_EQ(paramValueSizeRet, sizeof(globalVarSize));
|
||||
EXPECT_EQ(globalVarSize, 1024u);
|
||||
if (castToObject<ClDevice>(pClDevice)->getEnabledClVersion() >= 20) {
|
||||
EXPECT_EQ(globalVarSize, 1024u);
|
||||
} else {
|
||||
EXPECT_EQ(globalVarSize, 0u);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_P(ProgramFromBinaryTest, givenProgramWhenItIsBeingBuildThenItContainsGraphicsAllocationInKernelInfo) {
|
||||
|
||||
Reference in New Issue
Block a user