Avoid double mapping of devices to hostMalloc buffer

[ROCm/clr commit: ad11972f47]
이 커밋은 다음에 포함됨:
Rahul Garg가 2019-03-25 23:07:05 +05:30를 커밋했습니다
1 부모 817e064745
커밋 21d7bbab11
1 파일이 변경됨
+8 -4
+8 -4
파일 보기
@@ -339,15 +339,19 @@ hipError_t hipHostMalloc(void** ptr, size_t sizeBytes, unsigned int flags) {
hip_status = hipErrorInvalidValue;
} else {
auto device = ctx->getWriteableDevice();
#if (__hcc_workweek__ >= 19115)
//Avoid mapping host pinned memory to all devices by HCC
unsigned amFlags = amHostUnmapped;
#else
unsigned amFlags = 0;
#endif
if (flags & hipHostMallocCoherent) {
amFlags = amHostCoherent;
amFlags |= amHostCoherent;
} else if (flags & hipHostMallocNonCoherent) {
amFlags = amHostNonCoherent;
amFlags |= amHostNonCoherent;
} else {
// depends on env variables:
amFlags = HIP_HOST_COHERENT ? amHostCoherent : amHostNonCoherent;
amFlags |= HIP_HOST_COHERENT ? amHostCoherent : amHostNonCoherent;
}