Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
"The first is to limit when we start and stop profiling in the program. In Python, we can do this with `cupyx.profiler.profile()`, which give us a Python context manager. Any CUDA code used during scope will be included in the profile.\n",
"\n",
"```\n",
"not_in_the profile()\n",
"not_in_the_profile()\n",
"with cpx.profiler.profile():\n",
" in_the_profile()\n",
"not_in_the_profile()\n",
Expand All @@ -227,7 +227,7 @@
"We can also annotate specific regions of our code, which will show up in the profiler. We can even add categories, domains, and colors to these regions, and they can be nested. To add these annotations, we use `nvtx.annnotate()`, another Python context manager, this time from a library called NVTX.\n",
"\n",
"```\n",
"with nvtx.annotate(\"Loop\")\n",
"with nvtx.annotate(\"Loop\"):\n",
" for i in range(20):\n",
" with nvtx.annotate(f\"Step {i}\"):\n",
" pass\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
"The first is to limit when we start and stop profiling in the program. In Python, we can do this with `cupyx.profiler.profile()`, which give us a Python context manager. Any CUDA code used during scope will be included in the profile.\n",
"\n",
"```\n",
"not_in_the profile()\n",
"not_in_the_profile():\n",
"with cpx.profiler.profile():\n",
" in_the_profile()\n",
"not_in_the_profile()\n",
Expand All @@ -225,7 +225,7 @@
"We can also annotate specific regions of our code, which will show up in the profiler. We can even add categories, domains, and colors to these regions, and they can be nested. To add these annotations, we use `nvtx.annnotate()`, another Python context manager, this time from a library called NVTX.\n",
"\n",
"```\n",
"with nvtx.annotate(\"Loop\")\n",
"with nvtx.annotate(\"Loop\"):\n",
" for i in range(20):\n",
" with nvtx.annotate(f\"Step {i}\"):\n",
" pass\n",
Expand Down

Large diffs are not rendered by default.

Loading
Loading