From 8c1b52cf6e7aa90730895f6cd2fb133d764d30a3 Mon Sep 17 00:00:00 2001 From: Ryan Hill Date: Sat, 24 Apr 2021 02:43:06 -0700 Subject: [PATCH] Test disabling profiler --- onnxruntime/core/common/profiler.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/onnxruntime/core/common/profiler.cc b/onnxruntime/core/common/profiler.cc index 173208c8b8..308ccd6b68 100644 --- a/onnxruntime/core/common/profiler.cc +++ b/onnxruntime/core/common/profiler.cc @@ -27,13 +27,14 @@ class DeviceProfiler { (((uintptr_t)(buffer) & ((align)-1)) ? ((buffer) + (align) - ((uintptr_t)(buffer) & ((align)-1))) : (buffer)) #define DUR(s, e) std::lround(static_cast(e - s) / 1000) -class CudaProfiler final: public DeviceProfiler { +class CudaProfiler final : public DeviceProfiler { public: friend class DeviceProfiler; ~CudaProfiler() = default; ORT_DISALLOW_COPY_ASSIGNMENT_AND_MOVE(CudaProfiler); void StartProfiling(TimePoint start_time, int pid, int tid) override; std::vector EndProfiling() override; + private: CudaProfiler() = default; static void CUPTIAPI BufferRequested(uint8_t**, size_t*, size_t*); @@ -133,10 +134,11 @@ std::vector CudaProfiler::EndProfiling() { enabled_.clear(); return events; } -#endif //USE_CUDA +#endif //USE_CUDA DeviceProfiler* DeviceProfiler::GetDeviceProfiler() { -#ifdef USE_CUDA +#if 0 +//#ifdef USE_CUDA static CudaProfiler cuda_profiler; return &cuda_profiler; #else