Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpp: add conditional range macros #35

Merged
merged 2 commits into from
Mar 29, 2021

Conversation

AntoineFroger
Copy link

Add the NVTX3_FUNC_RANGE_IF and NVTX3_FUNC_RANGE_IN_IF macros which
are similar to the NVTX3_FUNC_RANGE and NVTX3_FUNC_RANGE_IN macros
except that they only generate a range if the boolean expression
passed as parameter evaluates to true.

Closes #28

Add the `NVTX3_FUNC_RANGE_IF` and `NVTX3_FUNC_RANGE_IN_IF` macros which
are similar to the `NVTX3_FUNC_RANGE` and `NVTX3_FUNC_RANGE_IN` macros
except that they only generate a range if the boolean expression
passed as parameter evaluates to `true`.

Closes NVIDIA#28
@AntoineFroger
Copy link
Author

I tested by compiling a simple piece of code using NVTX3_FUNC_RANGE_IF and NVTX3_FUNC_RANGE_IF_IN when the condition evaluates to both true and false. I profiled the executable with Nsight Systems to validate.

Add comment to clarify #endif

Co-authored-by: Jake Hemstad <jhemstad@nvidia.com>
@jcohen-nvidia
Copy link
Collaborator

Looks good.

@jcohen-nvidia jcohen-nvidia merged commit 2adfc10 into NVIDIA:dev Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants