-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue warnings for non-Release builds
A common pitfall when using traccc seems to be that people build it in non-Release mode and then get poor performance. This commit adds a bunch of warning prints to make sure that the code will inform you if you try to run it in non-Release mode.
- Loading branch information
1 parent
e7a03e9
commit fd34bb2
Showing
4 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** TRACCC library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2022 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <iostream> | ||
|
||
#if !defined(TRACCC_BUILD_TYPE_IS_RELEASE) || !defined(NDEBUG) || \ | ||
defined(_DEBUG) | ||
#define TRACCC_OPTIMIZATION_WARNING() \ | ||
do { \ | ||
std::cout \ | ||
<< "WARNING: traccc was built without Release mode, without the " \ | ||
"`NDEBUG` flag, or (on MSVC) with the `_DEBUG` flag. " \ | ||
"Performance is guaranteed to be much lower and compute " \ | ||
"performance results should be considered unreliable!" \ | ||
<< std::endl; \ | ||
} while (false) | ||
#else | ||
#define TRACCC_OPTIMIZATION_WARNING() \ | ||
do { \ | ||
} while (false) | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters