SWDEV-528142 - add error check for KernelParameters::capture (#276)
* SWDEV-528142 - add error check for KernelParameters::capture * Update kernel.cpp --------- Co-authored-by: victzhan <victzhan@amd.com>
This commit is contained in:
@@ -282,6 +282,11 @@ address KernelParameters::capture(device::VirtualDevice& vDev, uint64_t lclMemSi
|
|||||||
} else if (desc.type_ == T_SAMPLER) {
|
} else if (desc.type_ == T_SAMPLER) {
|
||||||
Sampler* samplerArg = samplerObjects_[desc.info_.arrayIndex_];
|
Sampler* samplerArg = samplerObjects_[desc.info_.arrayIndex_];
|
||||||
if (samplerArg != nullptr) {
|
if (samplerArg != nullptr) {
|
||||||
|
device::Sampler* deviceSampler = samplerArg->getDeviceSampler(device);
|
||||||
|
if (!deviceSampler) {
|
||||||
|
*error = CL_INVALID_CONTEXT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
samplerArg->retain();
|
samplerArg->retain();
|
||||||
// todo: It's uint64_t type
|
// todo: It's uint64_t type
|
||||||
*reinterpret_cast<uintptr_t*>(mem + desc.offset_) = static_cast<uintptr_t>(
|
*reinterpret_cast<uintptr_t*>(mem + desc.offset_) = static_cast<uintptr_t>(
|
||||||
|
|||||||
Reference in New Issue
Block a user