SWDEV-493275 - Support scratch limit (#20)
Support programmatic query and change of scratch limit on AMD devices. Change-Id: Id5da355a77366f97868e462847f3916e87fd2af6
This commit is contained in:
@@ -519,6 +519,15 @@ hipError_t hipDeviceGetLimit(size_t* pValue, hipLimit_t limit) {
|
||||
case hipLimitStackSize:
|
||||
*pValue = hip::getCurrentDevice()->devices()[0]->StackSize();
|
||||
break;
|
||||
case hipExtLimitScratchMin:
|
||||
*pValue = hip::getCurrentDevice()->devices()[0]->info().scratchLimitMin;
|
||||
break;
|
||||
case hipExtLimitScratchMax:
|
||||
*pValue = hip::getCurrentDevice()->devices()[0]->info().scratchLimitMax;;
|
||||
break;
|
||||
case hipExtLimitScratchCurrent:
|
||||
*pValue = hip::getCurrentDevice()->devices()[0]->ScratchLimitCurrent();
|
||||
break;
|
||||
default:
|
||||
LogPrintfError("UnsupportedLimit = %d is passed", limit);
|
||||
HIP_RETURN(hipErrorUnsupportedLimit);
|
||||
@@ -601,6 +610,11 @@ hipError_t hipDeviceSetLimit(hipLimit_t limit, size_t value) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
break;
|
||||
case hipExtLimitScratchCurrent:
|
||||
if (!hip::getCurrentDevice()->devices()[0]->UpdateScratchLimitCurrent(value)) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
LogPrintfError("UnsupportedLimit = %d is passed", limit);
|
||||
HIP_RETURN(hipErrorUnsupportedLimit);
|
||||
|
||||
Reference in New Issue
Block a user