Added new device attributes (#1377)
* Added new device attributes * updated comment * updated with new device attributes supported
Este cometimento está contido em:
cometido por
Maneesh Gupta
ascendente
6c7da60e28
cometimento
e2a934f377
@@ -311,6 +311,21 @@ hipError_t ihipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device
|
||||
case hipDeviceAttributeCooperativeMultiDeviceLaunch:
|
||||
*pi = prop->cooperativeMultiDeviceLaunch;
|
||||
break;
|
||||
case hipDeviceAttributeMaxPitch:
|
||||
*pi = prop->memPitch;
|
||||
break;
|
||||
case hipDeviceAttributeTextureAlignment:
|
||||
*pi = prop->textureAlignment;
|
||||
break;
|
||||
case hipDeviceAttributeKernelExecTimeout:
|
||||
*pi = prop->kernelExecTimeoutEnabled;
|
||||
break;
|
||||
case hipDeviceAttributeCanMapHostMemory:
|
||||
*pi = prop->canMapHostMemory;
|
||||
break;
|
||||
case hipDeviceAttributeEccEnabled:
|
||||
*pi = prop->ECCEnabled;
|
||||
break;
|
||||
default:
|
||||
e = hipErrorInvalidValue;
|
||||
break;
|
||||
|
||||
@@ -734,7 +734,6 @@ hipError_t ihipDevice_t::initProperties(hipDeviceProp_t* prop) {
|
||||
err = hsa_agent_get_info(_hsaAgent, HSA_AGENT_INFO_NAME, &archName);
|
||||
|
||||
prop->gcnArch = atoi(archName + 3);
|
||||
|
||||
DeviceErrorCheck(err);
|
||||
|
||||
// Get agent node
|
||||
@@ -912,6 +911,22 @@ hipError_t ihipDevice_t::initProperties(hipDeviceProp_t* prop) {
|
||||
prop->hdpMemFlushCntl = hdpinfo.HDP_MEM_FLUSH_CNTL;
|
||||
prop->hdpRegFlushCntl = hdpinfo.HDP_REG_FLUSH_CNTL;
|
||||
|
||||
prop->memPitch = INT_MAX; //Maximum pitch in bytes allowed by memory copies (hardcoded 128 bytes in hipMallocPitch)
|
||||
prop->textureAlignment = 0; //Alignment requirement for textures
|
||||
prop->kernelExecTimeoutEnabled = 0; //no run time limit for running kernels on device
|
||||
|
||||
hsa_isa_t isa;
|
||||
err = hsa_agent_get_info(_hsaAgent, (hsa_agent_info_t)HSA_AGENT_INFO_ISA, &isa);
|
||||
DeviceErrorCheck(err);
|
||||
std::size_t isa_sz = 0u;
|
||||
hsa_isa_get_info_alt(isa, HSA_ISA_INFO_NAME_LENGTH, &isa_sz);
|
||||
std::string isa_name(isa_sz, '\0');
|
||||
hsa_isa_get_info_alt(isa, HSA_ISA_INFO_NAME, &isa_name.front());
|
||||
if (isa_name.find("sram-ecc") != std::string::npos)
|
||||
prop->ECCEnabled = 1; //Device has ECC support Enabled
|
||||
else
|
||||
prop->ECCEnabled = 0; //Device has ECC support disabled
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
|
||||
Criar uma nova questão referindo esta
Bloquear um utilizador