Fix tests to read warpSize from device props.

Change-Id: I9583577793afad49f9eb1ee9069bd4c6963a6023
This commit is contained in:
Ben Sander
2016-11-06 04:26:28 -06:00
parent c59fe09a81
commit 7106dc6796
2 changed files with 14 additions and 8 deletions
+9 -5
View File
@@ -45,11 +45,15 @@ int main(int argc, char *argv[])
{ int warpSize, pshift;
hipDeviceProp_t devProp;
hipGetDeviceProperties(&devProp, 0);
if(strncmp(devProp.name,"Fiji",1)==0)
{ warpSize =64;
pshift =6;
}
else {warpSize =32; pshift=5;}
warpSize = devProp.warpSize;
int w = warpSize;
pshift = 0;
while (w >>= 1) ++pshift;
printf ("warpSize=%d pshift=%d\n", warpSize, pshift);
int anycount =0;
int allcount =0;
int Num_Threads_per_Block = 1024;
+5 -3
View File
@@ -48,9 +48,11 @@ int main(int argc, char *argv[])
hipDeviceProp_t devProp;
hipGetDeviceProperties(&devProp, 0);
if(strncmp(devProp.name,"Fiji",1)==0)
{warpSize = 64; pshift =6;}
else {warpSize =32; pshift =5;}
warpSize = devProp.warpSize;
int w = warpSize;
pshift = 0;
while (w >>= 1) ++pshift;
unsigned int Num_Threads_per_Block = 512;
unsigned int Num_Blocks_per_Grid = 1;