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 commit: f86f3b3b33]
Este commit está contenido en:
@@ -106,6 +106,7 @@ typedef struct hipDeviceProp_t {
|
||||
size_t maxSharedMemoryPerMultiProcessor; ///< Maximum Shared Memory Per Multiprocessor.
|
||||
int isMultiGpuBoard; ///< 1 if device is on a multi-GPU board, 0 if not.
|
||||
int canMapHostMemory; ///< Check whether HIP can map host memory
|
||||
int gcnArch; ///< AMD GCN Arch Value. Eg: 803, 701
|
||||
} hipDeviceProp_t;
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -758,11 +758,24 @@ hipError_t ihipDevice_t::initProperties(hipDeviceProp_t* prop)
|
||||
prop->isMultiGpuBoard = 0 ? gpuAgentsCount < 2 : 1;
|
||||
|
||||
// Get agent name
|
||||
#if HIP_USE_PRODUCT_NAME
|
||||
|
||||
err = hsa_agent_get_info(_hsaAgent, (hsa_agent_info_t)HSA_AMD_AGENT_INFO_PRODUCT_NAME, &(prop->name));
|
||||
#else
|
||||
err = hsa_agent_get_info(_hsaAgent, HSA_AGENT_INFO_NAME, &(prop->name));
|
||||
#endif
|
||||
char archName[256];
|
||||
err = hsa_agent_get_info(_hsaAgent, HSA_AGENT_INFO_NAME, &archName);
|
||||
|
||||
if(strcmp(archName,"gfx701")==0){
|
||||
prop->gcnArch = 701;
|
||||
}
|
||||
if(strcmp(archName,"gfx801")==0){
|
||||
prop->gcnArch = 801;
|
||||
}
|
||||
if(strcmp(archName,"gfx802")==0){
|
||||
prop->gcnArch = 802;
|
||||
}
|
||||
if(strcmp(archName,"gfx803")==0){
|
||||
prop->gcnArch = 803;
|
||||
}
|
||||
|
||||
DeviceErrorCheck(err);
|
||||
|
||||
// Get agent node
|
||||
|
||||
Referencia en una nueva incidencia
Block a user