EXSWCPHIPT-112 - Unit test for hipMalloc3DArray for default and surface arrays (#2713)

[ROCm/hip commit: c0deb17bbc]
이 커밋은 다음에 포함됨:
Finlay
2022-07-11 07:49:05 +01:00
커밋한 사람 GitHub
부모 06c39848d8
커밋 d58953d4e9
4개의 변경된 파일과 302개의 추가작업 그리고 184개의 파일을 삭제
+36
파일 보기
@@ -122,3 +122,39 @@ inline size_t getFreeMem() {
HIP_CHECK(hipMemGetInfo(&free, &total));
return free;
}
struct Sizes {
int max1D;
std::array<int, 2> max2D;
std::array<int, 3> max3D;
Sizes(unsigned int flag) {
int device;
HIP_CHECK(hipGetDevice(&device));
switch (flag) {
case hipArrayDefault: {
hipDeviceProp_t prop;
HIP_CHECK(hipGetDeviceProperties(&prop, device));
max1D = prop.maxTexture1D;
max2D = {prop.maxTexture2D[0], prop.maxTexture2D[1]};
max3D = {prop.maxTexture3D[0], prop.maxTexture3D[1], prop.maxTexture3D[2]};
return;
}
case hipArraySurfaceLoadStore: {
int value;
HIP_CHECK(hipDeviceGetAttribute(&value, hipDeviceAttributeMaxSurface1D, device));
max1D = value;
HIP_CHECK(hipDeviceGetAttribute(&value, hipDeviceAttributeMaxSurface2D, device));
max2D = {value, value};
HIP_CHECK(hipDeviceGetAttribute(&value, hipDeviceAttributeMaxSurface3D, device));
max3D = {value, value, value};
return;
}
default: {
INFO("Array flag not supported");
REQUIRE(false);
return;
}
}
}
};