SWDEV-351274 - add proper checks for set attribute
Signed-off-by: sdashmiz <shadi.dashmiz@amd.com>
Change-Id: I9243e6180f3040341396b7159622f2b96e143ac2
[ROCm/clr commit: 39fc6605ec]
Tá an tiomantas seo le fáil i:
tiomanta ag
Shadi Dashmiz
tuismitheoir
1cb6a65b16
tiomantas
44c74209ed
@@ -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;
|
||||
|
||||
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir