Use C++ iota function to reset buffers and use its values for verification

* Update functional test script to include new tests
This commit is contained in:
avinashkethineedi
2024-10-14 23:49:40 +00:00
والد e981f61693
کامیت 18a1bdd0ac
8فایلهای تغییر یافته به همراه161 افزوده شده و 56 حذف شده
@@ -59,7 +59,7 @@ Tester::Tester(TesterArguments args) : args(args) {
_shmem_context = args.shmem_context;
CHECK_HIP(hipGetDevice(&device_id));
CHECK_HIP(hipGetDeviceProperties(&deviceProps, device_id));
num_warps = args.wg_size / deviceProps.warpSize;
num_warps = (args.wg_size - 1) / deviceProps.warpSize + 1;
CHECK_HIP(hipStreamCreate(&stream));
CHECK_HIP(hipEventCreate(&start_event));
CHECK_HIP(hipEventCreate(&stop_event));
@@ -76,6 +76,11 @@ Tester::~Tester() {
std::vector<Tester*> Tester::create(TesterArguments args) {
int rank = args.myid;
std::vector<Tester*> testers;
hipDeviceProp_t deviceProps;
int device_id, numWarps;
CHECK_HIP(hipGetDevice(&device_id));
CHECK_HIP(hipGetDeviceProperties(&deviceProps, device_id));
numWarps = (args.wg_size - 1) / deviceProps.warpSize + 1;
if (rank == 0) std::cout << "*** Creating Test: ";
@@ -510,7 +515,7 @@ std::vector<Tester*> Tester::create(TesterArguments args) {
return testers;
case WAVEGetTestType:
if (rank == 0) {
if (args.num_wgs > 1 || args.wg_size / 64 > 1)
if (args.num_wgs > 1 || numWarps > 1)
std::cout << "Tiled Blocking WAVE level Gets***" << std::endl;
else std::cout << "Blocking WAVE level Gets***" << std::endl;
}
@@ -518,7 +523,7 @@ std::vector<Tester*> Tester::create(TesterArguments args) {
return testers;
case WAVEGetNBITestType:
if (rank == 0) {
if (args.num_wgs > 1 || args.wg_size / 64 > 1)
if (args.num_wgs > 1 || numWarps > 1)
std::cout << "Tiled Non-Blocking WAVE level Gets***" << std::endl;
else std::cout << "Non-Blocking WAVE level Gets***" << std::endl;
}
@@ -526,7 +531,7 @@ std::vector<Tester*> Tester::create(TesterArguments args) {
return testers;
case WAVEPutTestType:
if (rank == 0) {
if (args.num_wgs > 1 || args.wg_size / 64 > 1)
if (args.num_wgs > 1 || numWarps > 1)
std::cout << "Tiled Blocking WAVE level Puts***" << std::endl;
else std::cout << "Blocking WAVE level Puts***" << std::endl;
}
@@ -534,7 +539,7 @@ std::vector<Tester*> Tester::create(TesterArguments args) {
return testers;
case WAVEPutNBITestType:
if (rank == 0) {
if (args.num_wgs > 1 || args.wg_size / 64 > 1)
if (args.num_wgs > 1 || numWarps > 1)
std::cout << "Tiled Non-Blocking WAVE level Puts***" << std::endl;
else std::cout << "Non-Blocking WAVE level Puts***" << std::endl;
}
@@ -612,10 +617,32 @@ void Tester::execute() {
// data validation
verifyResults(size);
/**
* Adjust size for *_wg and *_wave functions
*/
uint64_t size_ = size;
TestType type = (TestType)args.algorithm;
switch (type) {
case WAVEGetTestType:
case WAVEGetNBITestType:
case WAVEPutTestType:
case WAVEPutNBITestType:
size_ *= (args.num_wgs * num_warps);
break;
case WGGetTestType:
case WGGetNBITestType:
case WGPutTestType:
case WGPutNBITestType:
size_ *= args.num_wgs;
break;
default:
break;
}
barrier();
if (_type != TeamCtxInfraTestType) {
print(size);
print(size_);
}
}
}
@@ -707,8 +734,10 @@ uint64_t Tester::gpuCyclesToMicroseconds(uint64_t cycles) {
uint64_t Tester::timerAvgInMicroseconds() {
uint64_t sum = 0;
//TODO: Modify the calcuation for the Tiled version of puts and gets at
// wavefront level (bpotter/avinash)
/**
* TODO: (bpotter/avinash) Modify the calcuation for the Tiled version of
* puts and gets at wavefront level
*/
for (int i = 0; i < args.num_wgs; i++) {
sum += gpuCyclesToMicroseconds(timer[i]);
}