SWDEV-329789 - ported MultiThread Test to catch2 (#2800)

Change-Id: Ic23244ed150c7e35188e30eee70e58438472bd45

[ROCm/hip-tests commit: 5a7d362eef]
이 커밋은 다음에 포함됨:
ROCm CI Service Account 작성하고 GitHub가 2022-07-19 20:09:07 +05:30를 커밋함
1 부모 cc66889e53
커밋 51feb62db0
6 파일이 변경됨
+471

검색과 일치하는 파일 없음

+58
파일 보기
@@ -271,6 +271,64 @@ void launchKernel(K kernel, Dim numBlocks, Dim numThreads, std::uint32_t memPerB
std::forward<Args>(packedArgs)...);
#endif
}
//---
struct Pinned {
static const bool isPinned = true;
static const char* str() { return "Pinned"; };
static void* Alloc(size_t sizeBytes) {
void* p;
HIPCHECK(hipHostMalloc((void**)&p, sizeBytes));
return p;
};
};
//---
struct Unpinned {
static const bool isPinned = false;
static const char* str() { return "Unpinned"; };
static void* Alloc(size_t sizeBytes) {
void* p = malloc(sizeBytes);
HIPASSERT(p);
return p;
};
};
struct Memcpy {
static const char* str() { return "Memcpy"; };
};
struct MemcpyAsync {
static const char* str() { return "MemcpyAsync"; };
};
template <typename C>
struct MemTraits;
template <>
struct MemTraits<Memcpy> {
static void Copy(void* dest, const void* src, size_t sizeBytes, hipMemcpyKind kind,
hipStream_t stream) {
(void)stream;
HIPCHECK(hipMemcpy(dest, src, sizeBytes, kind));
}
};
template <>
struct MemTraits<MemcpyAsync> {
static void Copy(void* dest, const void* src, size_t sizeBytes, hipMemcpyKind kind,
hipStream_t stream) {
HIPCHECK(hipMemcpyAsync(dest, src, sizeBytes, kind, stream));
}
};
} // namespace HipTest