Deprecate hipMallocHost and hipFreeHost.

These will print compiler warnings if used, so we can weed them out
before removing.

Also add a default flags args for hipHostAlloc, in the C++ functioin
headers.  So you can replace hipMallocHost(&ptr, size( with hipHostAlloc(&ptr, size)
Tento commit je obsažen v:
Ben Sander
2016-03-19 22:53:59 -05:00
rodič 52cc2bb75a
revize cea37c3e91
4 změnil soubory, kde provedl 17 přidání a 6 odebrání
+5
Zobrazit soubor
@@ -13,6 +13,11 @@ We have attempted to document known bugs and limitations - in particular the [HI
Stay tuned - the work for many of these features is already in-flight.
Next:
- Deprecate hipDeviceGetProp, replace with hipGetDeviceProp
- Deprecate hipMallocHost (Replace with hipHostAlloc with hipHostAllocDefault as last parameter).
- Deprecate hipFreeHost (Replace with hipHostFree).
## Revision History:
+2 -2
Zobrazit soubor
@@ -670,7 +670,7 @@ hipError_t hipMalloc(void** ptr, size_t size) ;
* @param[in] size Requested memory size
* @return Error code
*/
hipError_t hipMallocHost(void** ptr, size_t size) ;
hipError_t hipMallocHost(void** ptr, size_t size) __attribute__((deprecated("use hipHostAlloc instead"))) ;
/**
* @brief Allocate device accessible page locked host memory
@@ -737,7 +737,7 @@ hipError_t hipFree(void* ptr);
* @param[in] ptr Pointer to memory to be freed
* @return #hipSuccess, #hipErrorMemoryFree
*/
hipError_t hipFreeHost(void* ptr);
hipError_t hipFreeHost(void* ptr) __attribute__((deprecated("use hipHostFree instead"))) ;
+3 -2
Zobrazit soubor
@@ -218,9 +218,10 @@ static inline hipError_t hipMalloc ( T** devPtr, size_t size)
return hipMalloc((void**)devPtr, size);
}
// Provide an override to automatically typecast the pointer type from void**, and also provide a default for the flags.
template<class T>
static inline hipError_t hipMallocHost ( T** ptr, size_t size)
static inline hipError_t hipHostAlloc( T** ptr, size_t size, unsigned int flags = hipHostAllocDefault)
{
return hipMallocHost((void**)ptr, size);
return hipHostAlloc((void**)ptr, size, flags);
}
#endif
+7 -2
Zobrazit soubor
@@ -119,7 +119,7 @@ inline static hipError_t hipFree(void* ptr) {
return hipCUDAErrorTohipError(cudaFree(ptr));
}
inline static hipError_t hipMallocHost(void** ptr, size_t size) {
inline static hipError_t hipMallocHost(void** ptr, size_t size) __attribute__((deprecated("use hipHostAlloc instead"))) {
return hipCUDAErrorTohipError(cudaMallocHost(ptr, size));
}
@@ -143,9 +143,14 @@ inline static hipError_t hipHostUnregister(void* ptr){
return hipCUDAErrorTohipError(cudaHostUnregister(ptr));
}
inline static hipError_t hipFreeHost(void* ptr) {
inline static hipError_t hipFreeHost(void* ptr) __attribute__((deprecated("use hipHostFree instead"))) {
return hipCUDAErrorTohipError(cudaFreeHost(ptr));
}
inline static hipError_t hipHostFree(void* ptr) {
return hipCUDAErrorTohipError(cudaFreeHost(ptr));
}
inline static hipError_t hipSetDevice(int device) {
return hipCUDAErrorTohipError(cudaSetDevice(device));
}