SWDEV-363038 - Fix hipGraphKernelNodeSetParams
Fix crash in hipGraphKernelNodeSetParams where paremeters are taken from hipGraphKernelNodeGetParams. Change-Id: I2216f72f4d4de6dd3766343b0d821cb3d35d7853
This commit is contained in:
@@ -685,7 +685,8 @@ class hipGraphKernelNode : public hipGraphNode {
|
||||
}
|
||||
|
||||
void GetParams(hipKernelNodeParams* params) {
|
||||
std::memcpy(params, pKernelParams_, sizeof(hipKernelNodeParams));
|
||||
*params = *pKernelParams_;
|
||||
|
||||
}
|
||||
|
||||
hipError_t SetParams(const hipKernelNodeParams* params) {
|
||||
@@ -695,6 +696,13 @@ class hipGraphKernelNode : public hipGraphNode {
|
||||
ClPrint(amd::LOG_ERROR, amd::LOG_CODE, "[hipGraph] Failed to validateKernelParams");
|
||||
return status;
|
||||
}
|
||||
if (pKernelParams_ && ((pKernelParams_->kernelParams
|
||||
&& pKernelParams_->kernelParams == params->kernelParams)
|
||||
|| (pKernelParams_->extra && pKernelParams_->extra == params->extra))) {
|
||||
// params is copied from pKernelParams_ and then updated, so just copy it back
|
||||
*pKernelParams_ = *params;
|
||||
return status;
|
||||
}
|
||||
freeParams();
|
||||
pKernelParams_ = new hipKernelNodeParams(*params);
|
||||
status = copyParams(params);
|
||||
|
||||
Reference in New Issue
Block a user