SWDEV-453422: introduce warp sync tests

The following builtins are tested:

  - __all_sync, __any_sync, __ballot_sync and __activemask
  - __match_any_sync and __match_all_sync
  - __shfl_sync, __shfl_up_sync, __shfl_down_sync, and __shfl_xor_sync

The tests for shfl (all variants) were manually validated on a CUDA setup.

NOTE:

  - Unit_hipVoteSync_All temporarily disabled on Windows (SWDEV-452308).
  - All new tests temporarily disabled on CUDA (SWDEV-453145).

Change-Id: I84b205a88aa24219d199c760793e2f19f0cf8f13
This commit is contained in:
Sameer Sahasrabuddhe
2024-03-21 16:28:33 +05:30
committed by Rakesh Roy
parent 4b6c7b5fcb
commit 53f0a9bd01
18 changed files with 2318 additions and 47 deletions
+15
View File
@@ -170,6 +170,21 @@ static void initHipCtx(hipCtx_t* pcontext) {
#define HIP_ARRAY hipArray_t
#endif
static inline int getWarpSize() {
#if HT_NVIDIA
return 32;
#elif HT_AMD
int device = -1;
int warpSize = -1;
HIP_CHECK(hipGetDevice(&device));
HIP_CHECK(hipDeviceGetAttribute(&warpSize, hipDeviceAttributeWarpSize, device));
return warpSize;
#else
std::cout<<"Have to be either Nvidia or AMD platform, asserting"<<std::endl;
assert(false);
#endif
}
static inline bool IsGfx11() {
#if HT_NVIDIA
return false;