From cbfec76ea8354ba67840a47972942eec1c86777f Mon Sep 17 00:00:00 2001 From: "Sang, Tao" Date: Wed, 16 Apr 2025 10:08:03 -0400 Subject: [PATCH] SWDEV-493275 - Support scratch limit (#37) Support programmatic query and change of scratch limit on AMD devices. Change-Id: Id5da355a77366f97868e462847f3916e87fd2af6 --- include/hip/hip_runtime_api.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/hip/hip_runtime_api.h b/include/hip/hip_runtime_api.h index fb247aa893..4927dc0ce7 100644 --- a/include/hip/hip_runtime_api.h +++ b/include/hip/hip_runtime_api.h @@ -664,8 +664,17 @@ enum hipLimit_t { ///< device. Currently not supported hipLimitMallocHeapSize = 0x02, ///< Limit of heap size in bytes on the current device, should ///< be less than the global memory size on the device + hipExtLimitScratchMin = 0x1000, ///< Minimum allowed value in bytes for scratch limit on this + ///< device. Valid only on Rocm device. This is read only. + hipExtLimitScratchMax = 0x1001, ///< Maximum allowed value in bytes for scratch limit on this + ///< device. Valid only on Rocm device. This is read only. + hipExtLimitScratchCurrent = 0x1002, ///< Current scratch limit threshold in bytes on this + ///< device. Must be between hipExtLimitScratchMin and + ///< hipExtLimitScratchMaxValid values. Valid only on Rocm + ///< device. This can be modified. hipLimitRange ///< Supported limit range }; + /** * Flags that can be used with hipStreamCreateWithFlags. */