added malloc and free device functions
1. Added malloc and free device functions 2. Added test which check malloc and free functions TODO: Need to add support for multiple device. Works only on one device (multi device support id NOT available). Change-Id: Id11fc36463915d6ad46c264d5a20c8feb2d2c17c
This commit is contained in:
@@ -604,6 +604,19 @@ __device__ static inline void* memset(void* ptr, uint8_t val, size_t size)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
extern "C" __device__ void* __hip_hc_malloc(size_t);
|
||||
extern "C" __device__ void* __hip_hc_free(void *ptr);
|
||||
|
||||
__device__ static inline void* malloc(size_t size)
|
||||
{
|
||||
return __hip_hc_malloc(size);
|
||||
}
|
||||
|
||||
__device__ static inline void* free(void *ptr)
|
||||
{
|
||||
return __hip_hc_free(ptr);
|
||||
}
|
||||
|
||||
#define __syncthreads() hc_barrier(CLK_LOCAL_MEM_FENCE)
|
||||
|
||||
#define HIP_KERNEL_NAME(...) __VA_ARGS__
|
||||
|
||||
Reference in New Issue
Block a user