-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Zimmerman, Kevin
authored and
Zimmerman, Kevin
committed
Jun 23, 2023
1 parent
81130fd
commit b1f91e0
Showing
4 changed files
with
97 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use std::thread::{self, sleep}; | ||
use std::time::Duration; | ||
|
||
use nvtx::{range_end, range_start}; | ||
|
||
/// Create an arbitrary concurrency range on the NVTX layer. </br> | ||
/// This program should be ran from a profiling application like NVIDIA Nsight | ||
/// Systems! | ||
fn main() { | ||
let id = thread::spawn(|| { | ||
let id = range_start!("My Range"); | ||
sleep(Duration::from_millis(100)); // Expensive operation here | ||
id | ||
}) | ||
.join() | ||
.unwrap(); | ||
|
||
range_end!(id); | ||
} |
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
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