Merge branch 'dev' into lucky

Signed-off-by: coleramos425 <colramos@amd.com>
Tento commit je obsažen v:
coleramos425
2023-01-23 15:28:35 -06:00
rodič 60eca50d02
revize 00c9ff9493
333 změnil soubory, kde provedl 29217 přidání a 35029 odebrání
+14 -1
Zobrazit soubor
@@ -2,6 +2,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
using namespace std;
#define HIP_ASSERT(x) (assert((x)==hipSuccess))
@@ -19,7 +21,7 @@ __global__ void vecCopy(double *a, double *b, double *c, int n,int stride)
void usage()
{
printf("\nUsage: vcopy [n] [blocksize]\n\n");
printf("\nUsage: vcopy [n] [blocksize] {dev}\n\n");
exit(1);
return;
}
@@ -45,13 +47,24 @@ int main( int argc, char* argv[] )
double *d_c;
int stride = 1;
int devId = 0;
if(argc < 3)
usage();
if(argc > 3)
devId = atoi(argv[3]);
n = atoi(argv[1]);
blockSize = atoi(argv[2]);
int numGpuDevices;
HIP_ASSERT(hipGetDeviceCount(&numGpuDevices));
if(devId >= numGpuDevices)
devId = 0;
HIP_ASSERT(hipSetDevice(devId));
printf("vcopy testing on GCD %d\n", devId);
assert(n > 0);
assert(blockSize > 0);