SWDEV-504340 - Move cast of cl_mem inside the condition

Change-Id: I9c91f5d945a8d8bd2b2f55e3d11ede66afe4eef7


[ROCm/clr commit: fa63919a63]
This commit is contained in:
Saleel Kudchadker
2024-12-16 17:23:56 +00:00
committed by Branislav Brzak
parent d5b3b0830a
commit fda4ff1f9d
+3 -2
View File
@@ -619,9 +619,10 @@ inline void KernelBlitManager::setArgument(amd::Kernel* kernel, size_t index,
reinterpret_cast<Memory**>(kernel->parameters().values() +
kernel->parameters().memoryObjOffset())[desc.info_.arrayIndex_] = nullptr;
} else {
// convert cl_mem to amd::Memory*, return false if invalid.
amd::Memory* mem = as_amd(*static_cast<const cl_mem*>(value));
if (!writeVAImmediate) {
// convert cl_mem to amd::Memory*, return false if invalid.
amd::Memory* mem = as_amd(*static_cast<const cl_mem*>(value));
reinterpret_cast<amd::Memory**>(kernel->parameters().values() +
kernel->parameters().memoryObjOffset())[desc.info_.arrayIndex_] = mem;
if (dev_mem == nullptr) {