EXSWCPHIPT-113 - Unit tests for hipArray3DCreate for default and surface arrays (#2714)

[ROCm/hip commit: cdd437c9c6]
This commit is contained in:
Finlay
2022-07-11 11:41:32 +01:00
committed by GitHub
parent cf423dbcd3
commit 3c37a4b8dd
6 changed files with 181 additions and 12 deletions
@@ -131,8 +131,16 @@ struct Sizes {
Sizes(unsigned int flag) {
int device;
HIP_CHECK(hipGetDevice(&device));
static_assert(
hipArrayDefault == 0,
"hipArrayDefault is assumed to be equivalent to 0 for the following switch statment");
#if HT_NVIDIA
static_assert(hipArraySurfaceLoadStore == CUDA_ARRAY3D_SURFACE_LDST,
"hipArraySurface is assumed to be equivalent to CUDA_ARRAY3D_SURFACE_LDST for "
"the following switch statment");
#endif
switch (flag) {
case hipArrayDefault: {
case hipArrayDefault: { // 0
hipDeviceProp_t prop;
HIP_CHECK(hipGetDeviceProperties(&prop, device));
max1D = prop.maxTexture1D;
@@ -140,7 +148,7 @@ struct Sizes {
max3D = {prop.maxTexture3D[0], prop.maxTexture3D[1], prop.maxTexture3D[2]};
return;
}
case hipArraySurfaceLoadStore: {
case hipArraySurfaceLoadStore: { // CUDA_ARRAY3D_SURFACE_LDST
int value;
HIP_CHECK(hipDeviceGetAttribute(&value, hipDeviceAttributeMaxSurface1D, device));
max1D = value;