SWDEV-425830 - Add pcie atomic query in atomic tests

Add code to query pcie-atomics in atomic tests.
If pcie-atomics is not supported, skip the tests.
Enable the tests for Nvidia GPUs as well.

Change-Id: I7bfc8600511d78d8c73ab526f9846cd268651278
This commit is contained in:
taosang2
2023-12-20 14:32:58 -05:00
committed by Tao Sang
parent bffc913f8c
commit fafcad9162
7 changed files with 49 additions and 21 deletions
@@ -74,6 +74,13 @@ __global__ void sum_neighbor_locations(char* a, unsigned int num_devices,
* - HIP_VERSION >= 5.7
*/
TEST_CASE("test_svm_byte_granularity") {
int pcieAtomic = 0;
HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0));
if (!pcieAtomic) {
fprintf(stderr, "Device doesn't support pcie atomic, Skipped\n");
REQUIRE(true);
return;
}
const int num_elements = 2048;
int num_devices = 0;
HIP_CHECK(hipGetDeviceCount(&num_devices));