Added new device attributes (#1377)

* Added new device attributes

* updated comment

* updated with new device attributes supported
This commit is contained in:
ansurya
2019-09-16 14:01:30 +05:30
committed by Maneesh Gupta
parent 6c7da60e28
commit e2a934f377
10 changed files with 93 additions and 22 deletions
+12 -1
View File
@@ -122,6 +122,10 @@ typedef struct hipDeviceProp_t {
int maxTexture3D[3]; ///< Maximum dimensions (width, height, depth) of 3D images, in image elements
unsigned int* hdpMemFlushCntl; ///< Addres of HDP_MEM_COHERENCY_FLUSH_CNTL register
unsigned int* hdpRegFlushCntl; ///< Addres of HDP_REG_COHERENCY_FLUSH_CNTL register
size_t memPitch; ///<Maximum pitch in bytes allowed by memory copies
size_t textureAlignment; ///<Alignment requirement for textures
int kernelExecTimeoutEnabled; ///<Run time limit for kernels executed on the device
int ECCEnabled; ///<Device has ECC support enabled
} hipDeviceProp_t;
@@ -311,7 +315,14 @@ typedef enum hipDeviceAttribute_t {
hipDeviceAttributeMaxTexture3DDepth, ///< Maximum dimensions depth of 3D images in image elements
hipDeviceAttributeHdpMemFlushCntl, ///< Address of the HDP_MEM_COHERENCY_FLUSH_CNTL register
hipDeviceAttributeHdpRegFlushCntl ///< Address of the HDP_REG_COHERENCY_FLUSH_CNTL register
hipDeviceAttributeHdpRegFlushCntl, ///< Address of the HDP_REG_COHERENCY_FLUSH_CNTL register
hipDeviceAttributeMaxPitch, ///< Maximum pitch in bytes allowed by memory copies
hipDeviceAttributeTextureAlignment, ///<Alignment requirement for textures
hipDeviceAttributeKernelExecTimeout, ///<Run time limit for kernels executed on the device
hipDeviceAttributeCanMapHostMemory, ///<Device can map host memory into device address space
hipDeviceAttributeEccEnabled ///<Device has ECC support enabled
} hipDeviceAttribute_t;
enum hipComputeMode {
@@ -842,6 +842,11 @@ inline static hipError_t hipGetDeviceProperties(hipDeviceProp_t* p_prop, int dev
p_prop->maxTexture3D[1] = cdprop.maxTexture3D[1];
p_prop->maxTexture3D[2] = cdprop.maxTexture3D[2];
p_prop->memPitch = cdprop.memPitch;
p_prop->textureAlignment = cdprop.textureAlignment;
p_prop->kernelExecTimeoutEnabled = cdprop.kernelExecTimeoutEnabled;
p_prop->ECCEnabled = cdprop.ECCEnabled;
return hipCUDAErrorTohipError(cerror);
}
@@ -946,6 +951,21 @@ inline static hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t att
case hipDeviceAttributeMaxTexture3DDepth:
cdattr = cudaDevAttrMaxTexture3DDepth;
break;
case hipDeviceAttributeMaxPitch:
cdattr = cudaDevAttrMaxPitch;
break;
case hipDeviceAttributeTextureAlignment:
cdattr = cudaDevAttrTextureAlignment;
break;
case hipDeviceAttributeKernelExecTimeout:
cdattr = cudaDevAttrKernelExecTimeout;
break;
case hipDeviceAttributeCanMapHostMemory:
cdattr = cudaDevAttrCanMapHostMemory;
break;
case hipDeviceAttributeEccEnabled:
cdattr = cudaDevAttrEccEnabled;
break;
default:
cerror = cudaErrorInvalidValue;
break;