resolve conflicts for git pull

Change-Id: Ie353b831e2241bc28042069b6cc7405257e871e1


[ROCm/clr commit: bbb619c732]
This commit is contained in:
pensun
2016-11-09 21:38:43 -06:00
parent ce1b4bdc06
commit daf19a2dbb
3 changed files with 29 additions and 13 deletions
+10
View File
@@ -142,6 +142,16 @@ if(NOT DEFINED COMPILE_HIP_ATP_MARKER)
endif() endif()
add_to_config(_buildInfo COMPILE_HIP_ATP_MARKER) add_to_config(_buildInfo COMPILE_HIP_ATP_MARKER)
# Check if we need to force finegrained system memory allocation
if(NOT DEFINED HIP_COHERENT_HOST_ALLOC)
if(NOT DEFINED ENV{HIP_COHERENT_HOST_ALLOC})
set(HIP_COHERENT_HOST_ALLOC 0)
else()
set(HIP_COHERENT_HOST_ALLOC $ENV{HIP_COHERENT_HOST_ALLOC})
endif()
endif()
add_to_config(_buildInfo HIP_COHERENT_HOST_ALLOC)
############################# #############################
# Build steps # Build steps
############################# #############################
+6
View File
@@ -155,6 +155,12 @@ extern const char *API_COLOR_END;
#endif #endif
// Compile code that force hipHostMalloc only allocates finegrained system memory.
#ifndef HIP_COHERENT_HOST_ALLOC
#define HIP_COHERENT_HOST_ALLOC 0
#endif
// Compile support for trace markers that are displayed on CodeXL GUI at start/stop of each function boundary. // Compile support for trace markers that are displayed on CodeXL GUI at start/stop of each function boundary.
// TODO - currently we print the trace message at the beginning. if we waited, we could also include return codes, and any values returned // TODO - currently we print the trace message at the beginning. if we waited, we could also include return codes, and any values returned
+3 -3
View File
@@ -155,7 +155,7 @@ hipError_t hipHostMalloc(void** ptr, size_t sizeBytes, unsigned int flags)
// am_alloc requires writeable __acc, perhaps could be refactored? // am_alloc requires writeable __acc, perhaps could be refactored?
auto device = ctx->getWriteableDevice(); auto device = ctx->getWriteableDevice();
// If HIP_COHERENT_HOST_ALLOC is defined, we always alloc coherent host system memroy // If HIP_COHERENT_HOST_ALLOC is defined, we always alloc coherent host system memroy
#ifdef HIP_COHERENT_HOST_ALLOC #if HIP_COHERENT_HOST_ALLOC
*ptr = hc::am_alloc(sizeBytes, device->_acc, amHostPinned); *ptr = hc::am_alloc(sizeBytes, device->_acc, amHostPinned);
if(sizeBytes < 1 && (*ptr == NULL)){ if(sizeBytes < 1 && (*ptr == NULL)){
hip_status = hipErrorMemoryAllocation; hip_status = hipErrorMemoryAllocation;
@@ -163,7 +163,7 @@ hipError_t hipHostMalloc(void** ptr, size_t sizeBytes, unsigned int flags)
hc::am_memtracker_update(*ptr, device->_deviceId, amHostCoherent); hc::am_memtracker_update(*ptr, device->_deviceId, amHostCoherent);
} }
tprintf(DB_MEM, " %s: pinned ptr=%p\n", __func__, *ptr); tprintf(DB_MEM, " %s: pinned ptr=%p\n", __func__, *ptr);
#else #else
if((flags == hipHostMallocDefault)|| (flags == hipHostMallocPortable)){ if((flags == hipHostMallocDefault)|| (flags == hipHostMallocPortable)){
*ptr = hc::am_alloc(sizeBytes, device->_acc, amHostPinned); *ptr = hc::am_alloc(sizeBytes, device->_acc, amHostPinned);
if (sizeBytes < 1 && (*ptr == NULL)) { if (sizeBytes < 1 && (*ptr == NULL)) {
@@ -189,7 +189,7 @@ hipError_t hipHostMalloc(void** ptr, size_t sizeBytes, unsigned int flags)
tprintf(DB_MEM, "allocated pinned host ptr=%p on dev=%d, allow access to %d peer(s)\n", *ptr, device->_deviceId, peerCnt); tprintf(DB_MEM, "allocated pinned host ptr=%p on dev=%d, allow access to %d peer(s)\n", *ptr, device->_deviceId, peerCnt);
} }
} }
#endif //HIP_COHERENT_HOST_ALLOC #endif //HIP_COHERENT_HOST_ALLOC
} }
return ihipLogStatus(hip_status); return ihipLogStatus(hip_status);
} }