Merge pull request #970 from mangupta/swdev-172995

hipExtMallocWithFlags implementation

[ROCm/hip commit: 30b5c02ec4]
This commit is contained in:
Maneesh Gupta
2019-03-25 07:46:53 +00:00
committato da GitHub
2 ha cambiato i file con 54 aggiunte e 0 eliminazioni
@@ -177,6 +177,8 @@ enum hipLimit_t {
0x80000000 ///< Allocate non-coherent memory. Overrides HIP_COHERENT_HOST_ALLOC for specific
///< allocation.
#define hipDeviceMallocDefault 0x0
#define hipDeviceMallocFinegrained 0x1 ///< Memory is allocated in fine grained region of device.
//! Flags that can be used with hipHostRegister
#define hipHostRegisterDefault 0x0 ///< Memory is Mapped and Portable
@@ -1055,6 +1057,22 @@ hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void
*/
hipError_t hipMalloc(void** ptr, size_t size);
/**
* @brief Allocate memory on the default accelerator
*
* @param[out] ptr Pointer to the allocated memory
* @param[in] size Requested memory size
* @param[in] flags Type of memory allocation
*
* If size is 0, no memory is allocated, *ptr returns nullptr, and hipSuccess is returned.
*
* @return #hipSuccess, #hipErrorMemoryAllocation, #hipErrorInvalidValue (bad context, null *ptr)
*
* @see hipMallocPitch, hipFree, hipMallocArray, hipFreeArray, hipMalloc3D, hipMalloc3DArray,
* hipHostFree, hipHostMalloc
*/
hipError_t hipExtMallocWithFlags(void** ptr, size_t sizeBytes, unsigned int flags);
/**
* @brief Allocate pinned host memory [Deprecated]
*