added new field to hipDeviceProp_t structure gcnArch.

1. It is an integer containing gfx values 701, 801, 802, 803
2. On NV path, it is zero

Change-Id: I2b4c7f48981d0214d8c6b1905d2cc85b16203419


[ROCm/hip-tests commit: af22699ec6]
Esse commit está contido em:
Aditya Atluri
2017-03-07 11:24:32 -06:00
commit e2b0e9c8ea
@@ -32,7 +32,7 @@ THE SOFTWARE.
}\
}
/*
/*
* Square each element in the array A and write to array C.
*/
template <typename T>
@@ -58,16 +58,18 @@ int main(int argc, char *argv[])
hipDeviceProp_t props;
CHECK(hipGetDeviceProperties(&props, 0/*deviceID*/));
printf ("info: running on device %s\n", props.name);
#ifdef __HIP_PLATFORM_HCC__
printf ("info: architecture on AMD GPU device is: %d\n",props.gcnArch);
#endif
printf ("info: allocate host mem (%6.2f MB)\n", 2*Nbytes/1024.0/1024.0);
A_h = (float*)malloc(Nbytes);
CHECK(A_h == 0 ? hipErrorMemoryAllocation : hipSuccess );
C_h = (float*)malloc(Nbytes);
CHECK(C_h == 0 ? hipErrorMemoryAllocation : hipSuccess );
// Fill with Phi + i
for (size_t i=0; i<N; i++)
for (size_t i=0; i<N; i++)
{
A_h[i] = 1.618f + i;
A_h[i] = 1.618f + i;
}
printf ("info: allocate device mem (%6.2f MB)\n", 2*Nbytes/1024.0/1024.0);