Skip to content

Commit c7ed362

Browse files
Added wrapper for Tracy profiler integration
1 parent ec8ba28 commit c7ed362

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

Common/include/tracy_structure.hpp

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*!
2+
* \file tracy_structure.hpp
3+
* \brief Tracy profiler interface header.
4+
* Provides compatibility macros if the code is built without
5+
* tracy support. Profiling macros are defined here so that
6+
* they can be completely "disabled" when compiling without tracy.
7+
* \note Do not include tracy headers explicitly anywhere, use this header instead.
8+
* \note To enable tracy, define the TRACY_ENABLE macro during compilation.
9+
* \author Divyaprakash
10+
* \version 8.2.0 "Harrier"
11+
*
12+
* SU2 Project Website: https://su2code.github.io
13+
*
14+
* The SU2 Project is maintained by the SU2 Foundation
15+
* (http://su2foundation.org)
16+
*
17+
* Copyright 2012-2025, SU2 Contributors (cf. AUTHORS.md)
18+
*
19+
* SU2 is free software; you can redistribute it and/or
20+
* modify it under the terms of the GNU Lesser General Public
21+
* License as published by the Free Software Foundation; either
22+
* version 2.1 of the License, or (at your option) any later version.
23+
*
24+
* SU2 is distributed in the hope that it will be useful,
25+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
26+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27+
* Lesser General Public License for more details.
28+
*
29+
* You should have received a copy of the GNU Lesser General Public
30+
* License along with SU2. If not, see <http://www.gnu.org/licenses/>.
31+
*/
32+
33+
#pragma once
34+
35+
#ifdef TRACY_ENABLE
36+
# include "tracy/Tracy.hpp"
37+
# define SU2_ZONE_SCOPED ZoneScoped
38+
# define SU2_ZONE_SCOPED_N(name) ZoneScopedN(name)
39+
#else
40+
# define SU2_ZONE_SCOPED
41+
# define SU2_ZONE_SCOPED_N(name)
42+
#endif

SU2_CFD/src/fluid/CDataDrivenFluid.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#define USE_MLPCPP
3232
#endif
3333

34-
#include <tracy/Tracy.hpp>
34+
#include "../../../Common/include/tracy_structure.hpp"
3535

3636
CDataDrivenFluid::CDataDrivenFluid(const CConfig* config, bool display) : CFluidModel() {
3737
rank = SU2_MPI::GetRank();
@@ -307,7 +307,7 @@ void CDataDrivenFluid::ComputeDerivativeNRBC_Prho(su2double P, su2double rho) {
307307

308308

309309
unsigned long CDataDrivenFluid::Predict_MLP(su2double rho, su2double e) {
310-
ZoneScopedN("Predict_MLP");
310+
SU2_ZONE_SCOPED_N("Predict_MLP");
311311
unsigned long exit_code = 0;
312312
/*--- Evaluate MLP collection for the given values for density and energy. ---*/
313313
#ifdef USE_MLPCPP

0 commit comments

Comments
 (0)