SWDEV-228443 - Enhancing hip unit tests for Memory Allocation APIs (#2616)
Adding new testcases for hipMalloc3D,hipMalloc3DArray, hipArrayCreate,hipMallocPitch and hipMallocArray APIs Change-Id: Ia2cc8865d605272995aaf703dd26954d11ded2ea
This commit is contained in:
zatwierdzone przez
GitHub
rodzic
79e0466f51
commit
b49e8e9fdf
@@ -71,7 +71,27 @@ THE SOFTWARE.
|
||||
printf("assertion %s at %s:%d \n", #condition, __FILE__, __LINE__); \
|
||||
abort(); \
|
||||
}
|
||||
|
||||
#if HT_NVIDIA
|
||||
#define CTX_CREATE() \
|
||||
hipCtx_t context;\
|
||||
initHipCtx(&context);
|
||||
#define CTX_DESTROY() HIPCHECK(hipCtxDestroy(context));
|
||||
#define ARRAY_DESTROY(array) HIPCHECK(hipArrayDestroy(array));
|
||||
#define HIP_TEX_REFERENCE hipTexRef
|
||||
#define HIP_ARRAY hiparray
|
||||
static void initHipCtx(hipCtx_t *pcontext) {
|
||||
HIPCHECK(hipInit(0));
|
||||
hipDevice_t device;
|
||||
HIPCHECK(hipDeviceGet(&device, 0));
|
||||
HIPCHECK(hipCtxCreate(pcontext, 0, device));
|
||||
}
|
||||
#else
|
||||
#define CTX_CREATE()
|
||||
#define CTX_DESTROY()
|
||||
#define ARRAY_DESTROY(array) HIPCHECK(hipFreeArray(array));
|
||||
#define HIP_TEX_REFERENCE textureReference*
|
||||
#define HIP_ARRAY hipArray*
|
||||
#endif
|
||||
|
||||
|
||||
// Utility Functions
|
||||
|
||||
Reference in New Issue
Block a user