PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
Loading...
Searching...
No Matches
Profiling.h File Reference

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.

Namespaces

namespace  pbat
 The main namespace of the library.
 

Macros

#define PBAT_PROFILE_SCOPE
 
#define PBAT_PROFILE_NAMED_SCOPE(name)
 
#define PBAT_PROFILE_CUDA_HOST_SCOPE_START(var)
 
#define PBAT_PROFILE_CUDA_HOST_SCOPE_START(var, name)
 
#define PBAT_PROFILE_CUDA_HOST_SCOPE_END(var)
 

Functions

void pbat::profiling::BeginFrame (std::string_view name)
 Begin a profiling frame with the given name.
 
void pbat::profiling::EndFrame (std::string_view name)
 End the current profiling frame.
 
bool pbat::profiling::IsConnectedToServer ()
 Check if PBAT's Tracy client is connected to the Tracy profiler server.
 
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.
 

Detailed Description

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

Macro Definition Documentation

◆ 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.

Function Documentation

◆ 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
nameFrame name

◆ 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
nameFrame name

◆ 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
FuncType of the function to profile
ArgsTypes of the arguments to the function
Parameters
zoneNameName of the zone
fFunction to profile
argsArguments to the function
Returns
Result of the function
Note
This function is only available if the Tracy profiler is enabled