Profiling utilities for the Physics-Based Animation Toolkit (PBAT)
More...
#include "PhysicsBasedAnimationToolkitExport.h"
#include <map>
#include <string>
#include <string_view>
#include <type_traits>
Go to the source code of this file.
|
namespace | pbat |
| The main namespace of the library.
|
|
Profiling utilities for the Physics-Based Animation Toolkit (PBAT)
- Author
- Quoc-Minh Ton-That (tonth.nosp@m.at.q.nosp@m.uocmi.nosp@m.nh@g.nosp@m.mail..nosp@m.com)
- Date
- 2025-02-10
- Copyright
- Copyright (c) 2025
◆ PBAT_PROFILE_CUDA_HOST_SCOPE_END
#define PBAT_PROFILE_CUDA_HOST_SCOPE_END |
( |
| var | ) |
|
This macro is used to end a scope with the Tracy profiler in a CUDA host function. The variable var refers to the stored scope context.
◆ PBAT_PROFILE_CUDA_HOST_SCOPE_START [1/2]
#define PBAT_PROFILE_CUDA_HOST_SCOPE_START |
( |
| var | ) |
|
This macro is used to profile a scope with the Tracy profiler in a CUDA host function. The variable var is used to store the scope context.
◆ PBAT_PROFILE_CUDA_HOST_SCOPE_START [2/2]
#define PBAT_PROFILE_CUDA_HOST_SCOPE_START |
( |
| var, |
|
|
| name ) |
This macro is used to profile a scope with the Tracy profiler in a CUDA host function. The variable var is used to store the scope context.
◆ PBAT_PROFILE_NAMED_SCOPE
#define PBAT_PROFILE_NAMED_SCOPE |
( |
| name | ) |
|
This macro is used to profile a named scope with name name with the Tracy profiler.
◆ PBAT_PROFILE_SCOPE
#define PBAT_PROFILE_SCOPE |
This macro is used to profile a scope with the Tracy profiler.
◆ BeginFrame()
PBAT_API void pbat::profiling::BeginFrame |
( |
std::string_view | name | ) |
|
Begin a profiling frame with the given name.
- Precondition
- The frame name's length must not exceed 256 characters
- Parameters
-
◆ EndFrame()
PBAT_API void pbat::profiling::EndFrame |
( |
std::string_view | name | ) |
|
End the current profiling frame.
- Precondition
- The frame name's length must not exceed 256 characters
- Parameters
-
◆ IsConnectedToServer()
PBAT_API bool pbat::profiling::IsConnectedToServer |
( |
| ) |
|
Check if PBAT's Tracy client is connected to the Tracy profiler server.
- Returns
- true if connected, false otherwise
◆ Profile()
template<class Func, class... Args>
std::invoke_result_t< Func, Args... > pbat::profiling::Profile |
( |
std::string const & | zoneName, |
|
|
Func && | f, |
|
|
Args &&... | args ) |
Profile a function as a Tracy named zone.
- Template Parameters
-
Func | Type of the function to profile |
Args | Types of the arguments to the function |
- Parameters
-
zoneName | Name of the zone |
f | Function to profile |
args | Arguments to the function |
- Returns
- Result of the function
- Note
- This function is only available if the Tracy profiler is enabled