From 0dfcd3e66474ea31dedc5ea67047e482e7d402a3 Mon Sep 17 00:00:00 2001 From: pensun Date: Tue, 29 Nov 2016 11:33:51 -0600 Subject: [PATCH] Change to use produce device name by default Change-Id: Ie2cee2a2e94a08b5874a2f5abee5d1ab6c9fdf47 --- src/hip_hcc.cpp | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/hip_hcc.cpp b/src/hip_hcc.cpp index 36790271de..06402f9a67 100644 --- a/src/hip_hcc.cpp +++ b/src/hip_hcc.cpp @@ -78,7 +78,7 @@ int HIP_WAIT_MODE = 0; int HIP_FORCE_P2P_HOST = 0; int HIP_DENY_PEER_ACCESS = 0; -// Force async copies to actually use the synchronous copy interface. +// Force async copies to actually use the synchronous copy interface. int HIP_FORCE_SYNC_COPY = 0; @@ -86,7 +86,7 @@ int HIP_FORCE_SYNC_COPY = 0; -#define HIP_USE_PRODUCT_NAME 0 +#define HIP_USE_PRODUCT_NAME 1 //#define DISABLE_COPY_EXT 1 @@ -105,7 +105,7 @@ unsigned g_numLogicalThreads; std::atomic g_lastShortTid(1); // Indexed by short-tid: -// +// std::vector g_dbStartTriggers; std::vector g_dbStopTriggers; @@ -133,12 +133,12 @@ void recordApiTrace(std::string *fullStr, const std::string &apiStr) if ((tid < g_dbStartTriggers.size()) && (apiSeqNum >= g_dbStartTriggers[tid].nextTrigger())) { printf ("info: resume profiling at %lu\n", apiSeqNum); - RESUME_PROFILING; + RESUME_PROFILING; g_dbStartTriggers.pop_back(); }; if ((tid < g_dbStopTriggers.size()) && (apiSeqNum >= g_dbStopTriggers[tid].nextTrigger())) { printf ("info: stop profiling at %lu\n", apiSeqNum); - STOP_PROFILING; + STOP_PROFILING; g_dbStopTriggers.pop_back(); }; @@ -211,8 +211,8 @@ hipError_t ihipSynchronize(void) //================================================================================================= ShortTid::ShortTid() : _apiSeqNum(0) -{ - _shortTid = g_lastShortTid.fetch_add(1); +{ + _shortTid = g_lastShortTid.fetch_add(1); if (COMPILE_HIP_DB && HIP_TRACE_API) { std::stringstream tid_ss; @@ -282,7 +282,7 @@ void ihipStream_t::wait(LockedAccessor_StreamCrit_t &crit, bool assertQueueEmpty } else if (HIP_WAIT_MODE == 2) { waitMode = hc::hcWaitModeActive; } - + crit->_av.wait(waitMode); } @@ -455,7 +455,7 @@ bool ihipCtxCriticalBase_t::addPeerWatcher(const ihipCtx_t *thisCtx, i auto match = std::find(_peers.begin(), _peers.end(), peerWatcher); if (match == std::end(_peers)) { // Not already a peer, let's update the list: - tprintf(DB_COPY, "addPeerWatcher. Allocations on %s now visible to peerWatcher %s.\n", + tprintf(DB_COPY, "addPeerWatcher. Allocations on %s now visible to peerWatcher %s.\n", thisCtx->toString().c_str(), peerWatcher->toString().c_str()); _peers.push_back(peerWatcher); recomputePeerAgents(); @@ -473,7 +473,7 @@ bool ihipCtxCriticalBase_t::removePeerWatcher(const ihipCtx_t *thisCtx auto match = std::find(_peers.begin(), _peers.end(), peerWatcher); if (match != std::end(_peers)) { // Found a valid peer, let's remove it. - tprintf(DB_COPY, "removePeerWatcher. Allocations on %s no longer visible to former peerWatcher %s.\n", + tprintf(DB_COPY, "removePeerWatcher. Allocations on %s no longer visible to former peerWatcher %s.\n", thisCtx->toString().c_str(), peerWatcher->toString().c_str()); _peers.remove(peerWatcher); recomputePeerAgents(); @@ -813,7 +813,7 @@ hipError_t ihipDevice_t::initProperties(hipDeviceProp_t* prop) prop->arch.hasFloatAtomicAdd = 0; prop->arch.hasGlobalInt64Atomics = 1; prop->arch.hasSharedInt64Atomics = 1; - prop->arch.hasDoubles = 1; + prop->arch.hasDoubles = 1; prop->arch.hasWarpVote = 1; prop->arch.hasWarpBallot = 1; prop->arch.hasWarpShuffle = 1; @@ -1181,7 +1181,7 @@ std::string HIP_DB_callback(void *var_ptr, const char *envVarString) tokenize(e, '+', &tokens); for (auto t=tokens.begin(); t!= tokens.end(); t++) { for (int i=0; ic_str(), dbName[i]._shortName)) { + if (!strcmp(t->c_str(), dbName[i]._shortName)) { *var_ptr_int |= (1<getDeviceNum(), (*copyDevice)->getDevice()->_hsaAgent.handle); } else { - tprintf (DB_COPY, "P2P. Copy engine (dev:%d agent=0x%lx) can see src and dst.\n", + tprintf (DB_COPY, "P2P. Copy engine (dev:%d agent=0x%lx) can see src and dst.\n", (*copyDevice)->getDeviceNum(), (*copyDevice)->getDevice()->_hsaAgent.handle); } } else { @@ -1789,7 +1789,7 @@ void ihipStream_t::locked_copySync(void* dst, const void* src, size_t sizeBytes, { LockedAccessor_StreamCrit_t crit (_criticalData); tprintf (DB_COPY, "copySync copyDev:%d dst=%p (phys_dev:%d, isDevMem:%d) src=%p(phys_dev:%d, isDevMem:%d) sz=%zu dir=%s forceUnpinnedCopy=%d\n", - copyDevice ? copyDevice->getDeviceNum():-1, + copyDevice ? copyDevice->getDeviceNum():-1, dst, dstPtrInfo._appId, dstPtrInfo._isInDeviceMem, src, srcPtrInfo._appId, srcPtrInfo._isInDeviceMem, sizeBytes, hcMemcpyStr(hcCopyDir), forceUnpinnedCopy); @@ -1846,7 +1846,7 @@ void ihipStream_t::locked_copyAsync(void* dst, const void* src, size_t sizeBytes bool forceUnpinnedCopy; resolveHcMemcpyDirection(kind, &dstPtrInfo, &srcPtrInfo, &hcCopyDir, ©Device, &forceUnpinnedCopy); tprintf (DB_COPY, "copyASync copyDev:%d dst=%p (phys_dev:%d, isDevMem:%d) src=%p(phys_dev:%d, isDevMem:%d) sz=%zu dir=%s forceUnpinnedCopy=%d\n", - copyDevice ? copyDevice->getDeviceNum():-1, + copyDevice ? copyDevice->getDeviceNum():-1, dst, dstPtrInfo._appId, dstPtrInfo._isInDeviceMem, src, srcPtrInfo._appId, srcPtrInfo._isInDeviceMem, sizeBytes, hcMemcpyStr(hcCopyDir), forceUnpinnedCopy);