Added hipMemset2DAsync support

This commit is contained in:
Rahul Garg
2018-04-17 18:27:27 +05:30
parent 33ada06de9
commit 3cfb9c0d40
4 changed files with 167 additions and 1 deletions
+21
View File
@@ -50,6 +50,13 @@ THE SOFTWARE.
#define HIP_LAUNCH_PARAM_BUFFER_SIZE ((void*)0x02)
#define HIP_LAUNCH_PARAM_END ((void*)0x03)
#ifdef __cplusplus
#define __dparm(x) \
= x
#else
#define __dparm(x)
#endif
// Structure definitions:
#ifdef __cplusplus
extern "C" {
@@ -1436,6 +1443,20 @@ hipError_t hipMemsetAsync(void* dst, int value, size_t sizeBytes, hipStream_t st
hipError_t hipMemset2D(void* dst, size_t pitch, int value, size_t width, size_t height);
/**
* @brief Fills asynchronously the memory area pointed to by dst with the constant value.
*
* @param[in] dst Pointer to device memory
* @param[in] pitch - data size in bytes
* @param[in] value - constant value to be set
* @param[in] width
* @param[in] height
* @param[in] stream
* @return #hipSuccess, #hipErrorInvalidValue, #hipErrorMemoryFree
*/
hipError_t hipMemset2DAsync(void* dst, size_t pitch, int value, size_t width, size_t height,hipStream_t stream __dparm(0));
/**
* @brief Query memory info.
* Return snapshot of free memory, and total allocatable memory on the device.
@@ -625,6 +625,14 @@ inline static hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, s
return hipCUResultTohipError(cuMemsetD8(dest, value, sizeBytes));
}
inline static hipError_t hipMemset2D(void* dst, size_t pitch, int value, size_t width, size_t height) {
return hipCUDAErrorTohipError(cudaMemset2D(dst, pitch, value, width, height));
}
inline static hipError_t hipMemset2DAsync(void* dst, size_t pitch, int value, size_t width, size_t height, hipStream_t stream __dparm(0)) {
return hipCUDAErrorTohipError(cudaMemset2DAsync(dst, pitch, value, width, height, stream));
}
inline static hipError_t hipGetDeviceProperties(hipDeviceProp_t* p_prop, int device) {
struct cudaDeviceProp cdprop;
cudaError_t cerror;