mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Detect read only for arguments with const qualifier.
- This will catch __global const *int allocations as read only. Change-Id: I0d128ba7c31d476d1f144233e1c3dec370f9f550 Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
946243ea85
commit
926c7a2a97
@ -424,6 +424,9 @@ cl_int KernelInfo::resolveKernelInfo() {
|
||||
for (auto qualifierId = 0u; qualifierId < qualifierCount; qualifierId++) {
|
||||
if (strstr(argInfo.typeQualifierStr.c_str(), typeQualifiers[qualifierId].argTypeQualifier) != nullptr) {
|
||||
argInfo.typeQualifier |= typeQualifiers[qualifierId].argTypeQualifierValue;
|
||||
if (argInfo.typeQualifier == CL_KERNEL_ARG_TYPE_CONST) {
|
||||
argInfo.isReadOnly = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -409,6 +409,8 @@ TEST_F(KernelFromBinaryTests, givenArgumentDeclaredAsConstantWhenKernelIsCreated
|
||||
|
||||
auto pKernelInfo = pProgram->getKernelInfo("simple_kernel_6");
|
||||
EXPECT_TRUE(pKernelInfo->kernelArgInfo[1].isReadOnly);
|
||||
pKernelInfo = pProgram->getKernelInfo("simple_kernel_1");
|
||||
EXPECT_TRUE(pKernelInfo->kernelArgInfo[0].isReadOnly);
|
||||
}
|
||||
|
||||
TEST(PatchInfo, Constructor) {
|
||||
|
Reference in New Issue
Block a user