Pass only updated spec const values

Change-Id: Idc9720fb700e7ce9745872e08038b31836300a38
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2020-03-19 08:58:12 +01:00
committed by sys_ocldev
parent b546e89f99
commit ab7a846514
9 changed files with 70 additions and 51 deletions

View File

@@ -238,7 +238,6 @@ cl_int Program::setProgramSpecializationConstant(cl_uint specId, size_t specSize
this->specConstantsIds.reset(specConstInfo.idsBuffer.release());
this->specConstantsSizes.reset(specConstInfo.sizesBuffer.release());
this->specConstantsValues.reset(specConstInfo.valuesBuffer.release());
areSpecializationConstantsInitialized = true;
}
@@ -252,7 +251,7 @@ cl_int Program::updateSpecializationConstant(cl_uint specId, size_t specSize, co
if (specConstantsSizes->GetMemory<uint32_t>()[i] == static_cast<uint32_t>(specSize)) {
uint64_t specConstValue = 0u;
memcpy_s(&specConstValue, sizeof(uint64_t), specValue, specSize);
specConstantsValues->GetMemoryWriteable<uint64_t>()[i] = specConstValue;
specConstantsValues[specId] = specConstValue;
return CL_SUCCESS;
} else {
return CL_INVALID_VALUE;