SWDEV-356551 - Add support for device attributes.

Change-Id: Ic0f2b9cb510b027e0b8d1b3fb6d984e0d2600b15


[ROCm/hipother commit: 5f582f5615]
Este commit está contenido en:
Jaydeep Patel
2022-09-22 09:24:16 +00:00
cometido por Jaydeepkumar Patel
padre a6bd98310e
commit 65104e694f
@@ -1929,6 +1929,33 @@ inline static hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t att
case hipDeviceAttributeDirectManagedMemAccessFromHost:
cdattr = cudaDevAttrDirectManagedMemAccessFromHost;
break;
case hipDeviceAttributeGlobalL1CacheSupported:
cdattr = cudaDevAttrGlobalL1CacheSupported;
break;
case hipDeviceAttributeMaxBlocksPerMultiProcessor:
cdattr = cudaDevAttrMaxBlocksPerMultiprocessor;
break;
case hipDeviceAttributeMultiGpuBoardGroupID:
cdattr = cudaDevAttrMultiGpuBoardGroupID;
break;
case hipDeviceAttributeReservedSharedMemPerBlock:
cdattr = cudaDevAttrReservedSharedMemoryPerBlock;
break;
case hipDeviceAttributeSingleToDoublePrecisionPerfRatio:
cdattr = cudaDevAttrSingleToDoublePrecisionPerfRatio;
break;
case hipDeviceAttributeStreamPrioritiesSupported:
cdattr = cudaDevAttrStreamPrioritiesSupported;
break;
case hipDeviceAttributeSurfaceAlignment:
cdattr = cudaDevAttrSurfaceAlignment;
break;
case hipDeviceAttributeTccDriver:
cdattr = cudaDevAttrTccDriver;
break;
case hipDeviceAttributeUnifiedAddressing:
cdattr = cudaDevAttrUnifiedAddressing;
break;
#if CUDA_VERSION >= CUDA_11020
case hipDeviceAttributeMemoryPoolsSupported:
cdattr = cudaDevAttrMemoryPoolsSupported;
@@ -1938,6 +1965,21 @@ inline static hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t att
return hipCUResultTohipError(cuDeviceGetAttribute(pi,
CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED,
device));
case hipDeviceAttributeAccessPolicyMaxWindowSize:
cdattr = cudaDevAttrMaxAccessPolicyWindowSize;
break;
case hipDeviceAttributeAsyncEngineCount:
cdattr = cudaDevAttrAsyncEngineCount;
break;
case hipDeviceAttributeCanUseHostPointerForRegisteredMem:
cdattr = cudaDevAttrCanUseHostPointerForRegisteredMem;
break;
case hipDeviceAttributeComputePreemptionSupported:
cdattr = cudaDevAttrComputePreemptionSupported;
break;
case hipDeviceAttributeHostNativeAtomicSupported:
cdattr = cudaDevAttrHostNativeAtomicSupported;
break;
default:
return hipCUDAErrorTohipError(cudaErrorInvalidValue);
}