Fix typo: maxThreadsPerMultiProcessor -> MaxSharedMemoryPerMultiprocessor

Device property MaxSharedMemoryPerMultiprocessor set equal to totalGlobalMem (HIP path).
Reason: MaxSharedMemoryPerMultiprocessor should be as the same as group memory size. Group memory will not be paged out, so, the physical memory size = total shared memory size = group region size. NVCC path remains untouched: CUDA's device property MaxSharedMemoryPerMultiprocessor is reported.

hipify is updated as well.


[ROCm/clr commit: 460b501cbb]
Этот коммит содержится в:
Evgeny Mankov
2016-02-12 01:29:20 +03:00
родитель 735d4738ad
Коммит 6add51ef8c
5 изменённых файлов: 66 добавлений и 43 удалений
+17 -2
Просмотреть файл
@@ -342,6 +342,19 @@ hipError_t ihipDevice_t::getProperties(hipDeviceProp_t* prop)
Default compute mode (Multiple threads can use cudaSetDevice() with this device) */
prop->computeMode = 0;
// Get Max Threads Per Multiprocessor
/*
HsaSystemProperties props;
hsaKmtReleaseSystemProperties();
if(HSAKMT_STATUS_SUCCESS == hsaKmtAcquireSystemProperties(&props)) {
HsaNodeProperties node_prop = {0};
if(HSAKMT_STATUS_SUCCESS == hsaKmtGetNodeProperties(node, &node_prop)) {
uint32_t waves_per_cu = node_prop.MaxWavesPerSIMD;
prop-> maxThreadsPerMultiProcessor = prop->warpsize*waves_per_cu;
}
}
*/
// Get memory properties
err = hsa_agent_iterate_regions(_hsa_agent,get_region_info,prop);
@@ -351,9 +364,9 @@ hipError_t ihipDevice_t::getProperties(hipDeviceProp_t* prop)
hsa_region_t *am_region = static_cast<hsa_region_t*> (_acc.get_hsa_am_region());
err = hsa_region_get_info(*am_region, HSA_REGION_INFO_SIZE, &(prop->totalGlobalMem));
DeviceErrorCheck(err);
// maxThreadsPerMultiProcessor should be as the same as group memory size.
// maxSharedMemoryPerMultiProcessor should be as the same as group memory size.
// Group memory will not be paged out, so, the physical memory size is the total shared memory size, and also equal to the group region size.
prop->maxThreadsPerMultiProcessor = prop->totalGlobalMem;
prop->maxSharedMemoryPerMultiProcessor = prop->totalGlobalMem;
// Set feature flags - these are all mandatory for HIP on HCC path:
// Some features are under-development and future revs may support flags that are currently 0.
@@ -841,6 +854,8 @@ hipError_t hipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device)
*pi = prop->pciBusID; break;
case hipDeviceAttributePciDeviceId:
*pi = prop->pciDeviceID; break;
case hipDeviceAttributeMaxSharedMemoryPerMultiprocessor:
*pi = prop->maxSharedMemoryPerMultiProcessor; break;
default:
e = hipErrorInvalidValue; break;
}