diff --git a/hipamd/include/hip/hcc_detail/hip_runtime_api.h b/hipamd/include/hip/hcc_detail/hip_runtime_api.h index 9cfd21c1d2..175fd64d29 100644 --- a/hipamd/include/hip/hcc_detail/hip_runtime_api.h +++ b/hipamd/include/hip/hcc_detail/hip_runtime_api.h @@ -106,6 +106,7 @@ enum hipLimit_t #define hipEventBlockingSync 0x1 ///< Waiting will yield CPU. Power-friendly and usage-friendly but may increase latency. #define hipEventDisableTiming 0x2 ///< Disable event's capability to record timing information. May improve performance. #define hipEventInterprocess 0x4 ///< Event can support IPC. @warning - not supported in HIP. +#define hipEventDisableSystemRelease 0x80000000 /// < Disable the system-scope release that event normally performs when it records. This flag is useful to obtain more precise timings of commands between events. The flag is a no-op on CUDA platforms. //! Flags that can be used with hipHostMalloc diff --git a/hipamd/include/hip/nvcc_detail/hip_runtime_api.h b/hipamd/include/hip/nvcc_detail/hip_runtime_api.h index aad3ffcc44..e9f926b336 100644 --- a/hipamd/include/hip/nvcc_detail/hip_runtime_api.h +++ b/hipamd/include/hip/nvcc_detail/hip_runtime_api.h @@ -58,6 +58,8 @@ hipMemcpyHostToHost #define hipEventBlockingSync cudaEventBlockingSync #define hipEventDisableTiming cudaEventDisableTiming #define hipEventInterprocess cudaEventInterprocess +#define hipEventDisableSystemRelease cudaEventDefault /* no-op on CUDA platform */ + #define hipHostMallocDefault cudaHostAllocDefault #define hipHostMallocPortable cudaHostAllocPortable diff --git a/hipamd/src/hip_hcc.cpp b/hipamd/src/hip_hcc.cpp index 81a2079b5b..e936cf3af3 100644 --- a/hipamd/src/hip_hcc.cpp +++ b/hipamd/src/hip_hcc.cpp @@ -56,6 +56,9 @@ THE SOFTWARE. #define USE_ROCR_1_4 1 #endif +// needs HCC change for hc::no_scope +#define USE_NO_SCOPE 0 + //================================================================================================= //Global variables: //================================================================================================= @@ -364,8 +367,13 @@ void ihipStream_t::locked_recordEvent(hipEvent_t event) LockedAccessor_StreamCrit_t crit(_criticalData); this->ensureHaveQueue(crit); +#if USE_NO_SCOPE + printf ("create_marker, flags = %x\n", event->_flags); + event->_marker = crit->_av.create_marker((event->_flags & hipEventDisableSystemRelease) ? hc::no_scope : hc::system_scope); +#else event->_marker = crit->_av.create_marker(); -} +#endif +}; //=============================================================================