adding multi-GPU test

[ROCm/roctracer commit: 8280f47327]
This commit is contained in:
Evgeny
2019-12-29 04:09:10 -06:00
rodzic bca4e77df9
commit 383c9722f2
6 zmienionych plików z 30 dodań i 368 usunięć
@@ -84,21 +84,33 @@ int main() {
float* gpuMatrix;
float* gpuTransposeMatrix;
#if HIP_TEST
hipDeviceProp_t devProp;
HIP_CALL(hipGetDeviceProperties(&devProp, 0));
printf("Device name %s\n", devProp.name);
#endif
int i;
int errors;
init_tracing();
#if HIP_TEST
int gpuCount = 1;
#if MGPU_TEST
hipGetDeviceCount(&gpuCount);
printf("Number of GPUs: %d\n", gpuCount);
#endif
iterations *= gpuCount;
#endif
while (iterations-- > 0) {
start_tracing();
#if HIP_TEST
// set GPU
const int devIndex = iterations % gpuCount;
hipSetDevice(devIndex);
hipDeviceProp_t devProp;
HIP_CALL(hipGetDeviceProperties(&devProp, 0));
printf("Device %d name: %s\n", devIndex, devProp.name);
#endif
Matrix = (float*)malloc(NUM * sizeof(float));
TransposeMatrix = (float*)malloc(NUM * sizeof(float));
cpuTransposeMatrix = (float*)malloc(NUM * sizeof(float));