Update atomic functional tests (#262)

* feat: implement function to return number of blocks in grid.

* test: update atomics functional tests
  - Standard atomic tests: `atomic_add`, `atomic_inc`, `fetch_atomic_add`, `fetch_atomic_inc`, and `fetch_compare_and_swap`
  - Bitwise atomic tests:    `atomic_and`, `atomic_or`, `atomic_xor`, fetch_atomic_and`, `fetch_atomic_or`, and `fetch_atomic_xor`
  - Extended atomic tests: `atomic_fetch`, `atomic_set`, and `atomic_swap`

* Added two different address modes for atomics.
* Added all supported data types for atomics tests.


[ROCm/rocshmem commit: 0a4f8a83b9]
This commit is contained in:
Avinash Kethineedi
2025-10-06 11:50:50 -04:00
committed by GitHub
parent ac13b22edc
commit e31b4d42e5
9 changed files with 676 additions and 265 deletions
@@ -62,6 +62,13 @@ TesterArguments::TesterArguments(int argc, char *argv[]) {
} else if (arg == "-x") {
i++;
shmem_context = atoi(argv[i]);
} else if (arg == "-m") {
int atomics_addr_mode = atoi(argv[i]);
if(atomics_addr_mode >= static_cast<int>(AddrMode::PerGrid) &&
atomics_addr_mode <= static_cast<int>(AddrMode::PerBlock)) {
addr_mode = static_cast<AddrMode>(atomics_addr_mode);
}
i++;
} else {
show_usage(argv[0]);
exit(-1);
@@ -141,6 +148,7 @@ void TesterArguments::show_usage(std::string executable_name) {
std::cout << "\t-o <Operation type for the random_access test>\n";
std::cout << "\t-ta <Number of Thread Accessing the communication>\n";
std::cout << "\t-x <shmem context>\n";
std::cout << "\t-m Atomics Address mode\n";
}
void TesterArguments::get_rocshmem_arguments() {