[hip] Move _criticalData of ihipStream_t class to private section and use criticalData() to access it (#1177)

This commit is contained in:
Aryan Salmanpour
2019-07-03 20:42:19 -04:00
zatwierdzone przez Maneesh Gupta
rodzic 502a734ebf
commit 999f45fc11
3 zmienionych plików z 4 dodań i 6 usunięć
+2 -2
Wyświetl plik
@@ -1038,7 +1038,7 @@ void ihipCtx_t::locked_syncDefaultStream(bool waitOnSelf, bool syncHost) {
}
} else {
if (waitThisStream) {
LockedAccessor_StreamCrit_t streamCrit(stream->_criticalData);
LockedAccessor_StreamCrit_t streamCrit(stream->criticalData());
// The last marker will provide appropriate visibility:
if (!streamCrit->_av.get_is_empty()) {
@@ -1056,7 +1056,7 @@ void ihipCtx_t::locked_syncDefaultStream(bool waitOnSelf, bool syncHost) {
// Enqueue a barrier to wait on all the barriers we sent above:
if (!HIP_SYNC_NULL_STREAM && !depOps.empty()) {
LockedAccessor_StreamCrit_t defaultStreamCrit(_defaultStream->_criticalData);
LockedAccessor_StreamCrit_t defaultStreamCrit(_defaultStream->criticalData());
tprintf(DB_SYNC, " null-stream wait on %zu non-empty streams. sync_host=%d\n",
depOps.size(), syncHost);
hc::completion_future defaultCf = defaultStreamCrit->_av.create_blocking_marker(
+1 -3
Wyświetl plik
@@ -609,12 +609,10 @@ class ihipStream_t {
void addSymbolPtrToTracker(hc::accelerator& acc, void* ptr, size_t sizeBytes);
public: // TODO - move private
private: // Data
// Critical Data - MUST be accessed through LockedAccessor_StreamCrit_t
ihipStreamCritical_t _criticalData;
private: // Data
std::mutex _hasQueueLock;
ihipCtx_t* _ctx; // parent context that owns this stream.
+1 -1
Wyświetl plik
@@ -246,7 +246,7 @@ hipError_t hipStreamGetPriority(hipStream_t stream, int* priority) {
#if defined(__HCC__) && (__hcc_minor__ < 3)
*priority = 0;
#else
LockedAccessor_StreamCrit_t crit(stream->_criticalData);
LockedAccessor_StreamCrit_t crit(stream->criticalData());
*priority = crit->_av.get_queue_priority();
#endif
return ihipLogStatus(hipSuccess);