From 35a61e70b6ce656c38880d2d49ae92b500c4da43 Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Thu, 2 Jun 2022 17:00:27 +0530 Subject: [PATCH] SWDEV-331066 - added new API hipDeviceSetLimit (#2710) Change-Id: I0e5d193d5ac3db3acfef60a8c39c5d73c8213f10 --- include/hip/hip_runtime_api.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/include/hip/hip_runtime_api.h b/include/hip/hip_runtime_api.h index 7ba2b9700c..245efd5f84 100644 --- a/include/hip/hip_runtime_api.h +++ b/include/hip/hip_runtime_api.h @@ -547,8 +547,10 @@ typedef struct hipFuncAttributes { } hipFuncAttributes; typedef struct ihipEvent_t* hipEvent_t; enum hipLimit_t { - hipLimitPrintfFifoSize = 0x01, - hipLimitMallocHeapSize = 0x02, + hipLimitStackSize = 0x0, // limit device stack size + hipLimitPrintfFifoSize = 0x01, // limit printf fifo size + hipLimitMallocHeapSize = 0x02, // limit heap size + hipLimitRange // supported limit range }; /** * @addtogroup GlobalDefs More @@ -1263,6 +1265,7 @@ hipError_t hipRuntimeGetVersion(int* runtimeVersion); * @returns #hipSuccess, #hipErrorInavlidDevice */ hipError_t hipDeviceGet(hipDevice_t* device, int ordinal); + /** * @brief Returns the compute capability of the device * @param [out] major @@ -1534,6 +1537,16 @@ hipError_t hipDeviceGetCacheConfig(hipFuncCache_t* cacheConfig); * */ hipError_t hipDeviceGetLimit(size_t* pValue, enum hipLimit_t limit); +/** + * @brief Set Resource limits of current device + * + * @param [in] limit + * @param [in] value + * + * @returns #hipSuccess, #hipErrorUnsupportedLimit, #hipErrorInvalidValue + * + */ +hipError_t hipDeviceSetLimit ( enum hipLimit_t limit, size_t value ); /** * @brief Returns bank width of shared memory for current device *