SWDEV-351274 - add proper checks for set attribute
Signed-off-by: sdashmiz <shadi.dashmiz@amd.com> Change-Id: I9243e6180f3040341396b7159622f2b96e143ac2
This commit is contained in:
committad av
Shadi Dashmiz
förälder
52a22a1263
incheckning
39fc6605ec
@@ -771,6 +771,15 @@ class hipGraphKernelNode : public hipGraphNode {
|
||||
hipError_t SetAttrParams(hipKernelNodeAttrID attr, const hipKernelNodeAttrValue* params) {
|
||||
// updates kernel attr params
|
||||
if (attr == hipKernelNodeAttributeAccessPolicyWindow) {
|
||||
if (params->accessPolicyWindow.hitRatio > 1) {
|
||||
return hipErrorInvalidValue;
|
||||
}
|
||||
if (params->accessPolicyWindow.missProp == hipAccessPropertyPersisting) {
|
||||
return hipErrorInvalidValue;
|
||||
}
|
||||
if (params->accessPolicyWindow.num_bytes > 0 && params->accessPolicyWindow.hitRatio == 0) {
|
||||
return hipErrorInvalidValue;
|
||||
}
|
||||
kernelAttr_.accessPolicyWindow.base_ptr = params->accessPolicyWindow.base_ptr;
|
||||
kernelAttr_.accessPolicyWindow.hitProp = params->accessPolicyWindow.hitProp;
|
||||
kernelAttr_.accessPolicyWindow.hitRatio = params->accessPolicyWindow.hitRatio;
|
||||
|
||||
Referens i nytt ärende
Block a user