Added hipDeviceGetLimit api

1. hipDeviceGetLimit API for HCC path is added
2. Test for hipDeviceGetLimit API is added
3. The feature added only supports querying heap size
4. Corrected indents for malloc and free device functions
5. Removed redundant data structures
6. Added g_heap_malloc_size to store the heap size

Change-Id: If48d1b0ce9270e994f1c542cc283ddbb14746bbb
This commit is contained in:
Aditya Atluri
2016-10-12 19:58:48 -05:00
parent 1f28d992d3
commit 62ec53740c
4 changed files with 80 additions and 45 deletions
+15
View File
@@ -60,6 +60,7 @@ typedef void* hipDeviceptr_t;
typedef struct ihipEvent_t *hipEvent_t;
typedef unsigned hipLimit;
/**
* @addtogroup GlobalDefs More
@@ -97,6 +98,8 @@ typedef struct ihipEvent_t *hipEvent_t;
#define hipDeviceMapHost 0x8
#define hipDeviceLmemResizeToMax 0x16
#define hipLimitMallocHeapSize 0x2
/**
* @warning On AMD devices and recent Nvidia devices, these hints and controls are ignored.
*/
@@ -323,6 +326,18 @@ hipError_t hipDeviceSetCacheConfig ( hipFuncCache cacheConfig );
*/
hipError_t hipDeviceGetCacheConfig ( hipFuncCache *cacheConfig );
/**
* @brief Get Resource limits of current device
*
* @param [out] pValue
* @param [in] limit
*
* @returns #hipSuccess, #hipErrorUnsupportedLimit, #hipErrorInvalidValue
* Note: Currently, only hipLimitMallocHeapSize is available
*
*/
hipError_t hipDeviceGetLimit(size_t *pValue, hipLimit limit);
/**
* @brief Set Cache configuration for a specific function