diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-10-29 14:49:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-29 14:49:26 +0800 |
| commit | f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch) | |
| tree | ea1d61342cd29368e19135000ec2948813096205 /source/core/slang-performance-profiler.h | |
| parent | a729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff) | |
format
* format
* Minor test fixes
* enable checking cpp format in ci
Diffstat (limited to 'source/core/slang-performance-profiler.h')
| -rw-r--r-- | source/core/slang-performance-profiler.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/core/slang-performance-profiler.h b/source/core/slang-performance-profiler.h index 9895793c4..40ace4e6d 100644 --- a/source/core/slang-performance-profiler.h +++ b/source/core/slang-performance-profiler.h @@ -1,11 +1,12 @@ #ifndef SLANG_CORE_PERFORMANCE_PROFILER_H #define SLANG_CORE_PERFORMANCE_PROFILER_H +#include "../core/slang-list.h" +#include "slang-com-helper.h" #include "slang-string.h" + #include <chrono> #include <vector> -#include "slang-com-helper.h" -#include "../core/slang-list.h" namespace Slang { @@ -30,6 +31,7 @@ public: virtual void getResult(StringBuilder& out) = 0; virtual void clear() = 0; virtual void dispose() = 0; + public: static PerformanceProfiler* getProfiler(); }; @@ -47,7 +49,7 @@ struct PerformanceProfilerFuncRAIIContext } }; -struct SlangProfiler: public ISlangProfiler, public RefObject +struct SlangProfiler : public ISlangProfiler, public RefObject { public: SLANG_REF_OBJECT_IUNKNOWN_ALL @@ -57,20 +59,21 @@ public: int invocationCount = 0; std::chrono::nanoseconds duration = std::chrono::nanoseconds::zero(); }; - SlangProfiler(PerformanceProfiler * profiler); + SlangProfiler(PerformanceProfiler* profiler); ISlangUnknown* getInterface(const Guid& guid); virtual SLANG_NO_THROW size_t SLANG_MCALL getEntryCount() override; virtual SLANG_NO_THROW const char* SLANG_MCALL getEntryName(uint32_t index) override; virtual SLANG_NO_THROW long SLANG_MCALL getEntryTimeMS(uint32_t index) override; virtual SLANG_NO_THROW uint32_t SLANG_MCALL getEntryInvocationTimes(uint32_t index) override; + private: List<ProfileInfo> m_profilEntries; }; -#define SLANG_PROFILE PerformanceProfilerFuncRAIIContext _profileContext(__func__) +#define SLANG_PROFILE PerformanceProfilerFuncRAIIContext _profileContext(__func__) #define SLANG_PROFILE_SECTION(s) PerformanceProfilerFuncRAIIContext _profileContext##s(#s) -} +} // namespace Slang #endif |
