|
1302 | 1302 | <section id="examples"> |
1303 | 1303 | <h1>Examples<a class="headerlink" href="#examples" title="Link to this heading">#</a></h1> |
1304 | 1304 | <p>This page links to the <code class="docutils literal notranslate"><span class="pre">cuda.bindings</span></code> examples shipped in the |
1305 | | -<a class="extlink-cuda-bindings-examples reference external" href="https://github.com/NVIDIA/cuda-python/tree/7e7d3c14fc4ce848b58a8bf39c90ca1db89ce014/cuda_bindings/examples/">cuda-python repository</a>. |
| 1305 | +<a class="extlink-cuda-bindings-examples reference external" href="https://github.com/NVIDIA/cuda-python/tree/979b65fb2d9b59cc75f6298297b37e35cd1eef17/cuda_bindings/examples/">cuda-python repository</a>. |
1306 | 1306 | Use it as a quick index when you want a runnable sample for a specific API area |
1307 | 1307 | or CUDA feature.</p> |
1308 | 1308 | <section id="introduction"> |
1309 | 1309 | <h2>Introduction<a class="headerlink" href="#introduction" title="Link to this heading">#</a></h2> |
1310 | 1310 | <ul class="simple"> |
1311 | | -<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/7e7d3c14fc4ce848b58a8bf39c90ca1db89ce014/cuda_bindings/examples/0_Introduction/clock_nvrtc.py">clock_nvrtc.py</a> |
| 1311 | +<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/979b65fb2d9b59cc75f6298297b37e35cd1eef17/cuda_bindings/examples/0_Introduction/clock_nvrtc.py">clock_nvrtc.py</a> |
1312 | 1312 | uses NVRTC-compiled CUDA code and the device clock to time a reduction |
1313 | 1313 | kernel.</p></li> |
1314 | | -<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/7e7d3c14fc4ce848b58a8bf39c90ca1db89ce014/cuda_bindings/examples/0_Introduction/simple_cubemap_texture.py">simple_cubemap_texture.py</a> |
| 1314 | +<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/979b65fb2d9b59cc75f6298297b37e35cd1eef17/cuda_bindings/examples/0_Introduction/simple_cubemap_texture.py">simple_cubemap_texture.py</a> |
1315 | 1315 | demonstrates cubemap texture sampling and transformation.</p></li> |
1316 | | -<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/7e7d3c14fc4ce848b58a8bf39c90ca1db89ce014/cuda_bindings/examples/0_Introduction/simple_p2p.py">simple_p2p.py</a> |
| 1316 | +<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/979b65fb2d9b59cc75f6298297b37e35cd1eef17/cuda_bindings/examples/0_Introduction/simple_p2p.py">simple_p2p.py</a> |
1317 | 1317 | shows peer-to-peer memory access and transfers between multiple GPUs.</p></li> |
1318 | | -<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/7e7d3c14fc4ce848b58a8bf39c90ca1db89ce014/cuda_bindings/examples/0_Introduction/simple_zero_copy.py">simple_zero_copy.py</a> |
| 1318 | +<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/979b65fb2d9b59cc75f6298297b37e35cd1eef17/cuda_bindings/examples/0_Introduction/simple_zero_copy.py">simple_zero_copy.py</a> |
1319 | 1319 | uses zero-copy mapped host memory for vector addition.</p></li> |
1320 | | -<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/7e7d3c14fc4ce848b58a8bf39c90ca1db89ce014/cuda_bindings/examples/0_Introduction/system_wide_atomics.py">system_wide_atomics.py</a> |
| 1320 | +<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/979b65fb2d9b59cc75f6298297b37e35cd1eef17/cuda_bindings/examples/0_Introduction/system_wide_atomics.py">system_wide_atomics.py</a> |
1321 | 1321 | demonstrates system-wide atomic operations on managed memory.</p></li> |
1322 | | -<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/7e7d3c14fc4ce848b58a8bf39c90ca1db89ce014/cuda_bindings/examples/0_Introduction/vector_add_drv.py">vector_add_drv.py</a> |
| 1322 | +<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/979b65fb2d9b59cc75f6298297b37e35cd1eef17/cuda_bindings/examples/0_Introduction/vector_add_drv.py">vector_add_drv.py</a> |
1323 | 1323 | uses the CUDA Driver API and unified virtual addressing for vector addition.</p></li> |
1324 | | -<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/7e7d3c14fc4ce848b58a8bf39c90ca1db89ce014/cuda_bindings/examples/0_Introduction/vector_add_mmap.py">vector_add_mmap.py</a> |
| 1324 | +<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/979b65fb2d9b59cc75f6298297b37e35cd1eef17/cuda_bindings/examples/0_Introduction/vector_add_mmap.py">vector_add_mmap.py</a> |
1325 | 1325 | uses virtual memory management APIs such as <code class="docutils literal notranslate"><span class="pre">cuMemCreate</span></code> and |
1326 | 1326 | <code class="docutils literal notranslate"><span class="pre">cuMemMap</span></code> for vector addition.</p></li> |
1327 | 1327 | </ul> |
1328 | 1328 | </section> |
1329 | 1329 | <section id="concepts-and-techniques"> |
1330 | 1330 | <h2>Concepts and techniques<a class="headerlink" href="#concepts-and-techniques" title="Link to this heading">#</a></h2> |
1331 | 1331 | <ul class="simple"> |
1332 | | -<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/7e7d3c14fc4ce848b58a8bf39c90ca1db89ce014/cuda_bindings/examples/2_Concepts_and_Techniques/stream_ordered_allocation.py">stream_ordered_allocation.py</a> |
| 1332 | +<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/979b65fb2d9b59cc75f6298297b37e35cd1eef17/cuda_bindings/examples/2_Concepts_and_Techniques/stream_ordered_allocation.py">stream_ordered_allocation.py</a> |
1333 | 1333 | demonstrates <code class="docutils literal notranslate"><span class="pre">cudaMallocAsync</span></code> and <code class="docutils literal notranslate"><span class="pre">cudaFreeAsync</span></code> together with |
1334 | 1334 | memory-pool release thresholds.</p></li> |
1335 | 1335 | </ul> |
1336 | 1336 | </section> |
1337 | 1337 | <section id="cuda-features"> |
1338 | 1338 | <h2>CUDA features<a class="headerlink" href="#cuda-features" title="Link to this heading">#</a></h2> |
1339 | 1339 | <ul class="simple"> |
1340 | | -<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/7e7d3c14fc4ce848b58a8bf39c90ca1db89ce014/cuda_bindings/examples/3_CUDA_Features/global_to_shmem_async_copy.py">global_to_shmem_async_copy.py</a> |
| 1340 | +<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/979b65fb2d9b59cc75f6298297b37e35cd1eef17/cuda_bindings/examples/3_CUDA_Features/global_to_shmem_async_copy.py">global_to_shmem_async_copy.py</a> |
1341 | 1341 | compares asynchronous global-to-shared-memory copy strategies in matrix |
1342 | 1342 | multiplication kernels.</p></li> |
1343 | | -<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/7e7d3c14fc4ce848b58a8bf39c90ca1db89ce014/cuda_bindings/examples/3_CUDA_Features/simple_cuda_graphs.py">simple_cuda_graphs.py</a> |
| 1343 | +<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/979b65fb2d9b59cc75f6298297b37e35cd1eef17/cuda_bindings/examples/3_CUDA_Features/simple_cuda_graphs.py">simple_cuda_graphs.py</a> |
1344 | 1344 | shows both manual CUDA graph construction and stream-capture-based replay.</p></li> |
1345 | 1345 | </ul> |
1346 | 1346 | </section> |
1347 | 1347 | <section id="libraries-and-tools"> |
1348 | 1348 | <h2>Libraries and tools<a class="headerlink" href="#libraries-and-tools" title="Link to this heading">#</a></h2> |
1349 | 1349 | <ul class="simple"> |
1350 | | -<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/7e7d3c14fc4ce848b58a8bf39c90ca1db89ce014/cuda_bindings/examples/4_CUDA_Libraries/conjugate_gradient_multi_block_cg.py">conjugate_gradient_multi_block_cg.py</a> |
| 1350 | +<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/979b65fb2d9b59cc75f6298297b37e35cd1eef17/cuda_bindings/examples/4_CUDA_Libraries/conjugate_gradient_multi_block_cg.py">conjugate_gradient_multi_block_cg.py</a> |
1351 | 1351 | implements a conjugate-gradient solver with cooperative groups and |
1352 | 1352 | multi-block synchronization.</p></li> |
1353 | | -<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/7e7d3c14fc4ce848b58a8bf39c90ca1db89ce014/cuda_bindings/examples/4_CUDA_Libraries/nvidia_smi.py">nvidia_smi.py</a> |
| 1353 | +<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/979b65fb2d9b59cc75f6298297b37e35cd1eef17/cuda_bindings/examples/4_CUDA_Libraries/nvidia_smi.py">nvidia_smi.py</a> |
1354 | 1354 | uses NVML to implement a Python subset of <code class="docutils literal notranslate"><span class="pre">nvidia-smi</span></code>.</p></li> |
1355 | 1355 | </ul> |
1356 | 1356 | </section> |
1357 | 1357 | <section id="advanced-and-interoperability"> |
1358 | 1358 | <h2>Advanced and interoperability<a class="headerlink" href="#advanced-and-interoperability" title="Link to this heading">#</a></h2> |
1359 | 1359 | <ul class="simple"> |
1360 | | -<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/7e7d3c14fc4ce848b58a8bf39c90ca1db89ce014/cuda_bindings/examples/extra/iso_fd_modelling.py">iso_fd_modelling.py</a> |
| 1360 | +<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/979b65fb2d9b59cc75f6298297b37e35cd1eef17/cuda_bindings/examples/extra/iso_fd_modelling.py">iso_fd_modelling.py</a> |
1361 | 1361 | runs isotropic finite-difference wave propagation across multiple GPUs with |
1362 | 1362 | peer-to-peer halo exchange.</p></li> |
1363 | | -<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/7e7d3c14fc4ce848b58a8bf39c90ca1db89ce014/cuda_bindings/examples/extra/jit_program.py">jit_program.py</a> |
| 1363 | +<li><p><a class="extlink-cuda-bindings-example reference external" href="https://github.com/NVIDIA/cuda-python/blob/979b65fb2d9b59cc75f6298297b37e35cd1eef17/cuda_bindings/examples/extra/jit_program.py">jit_program.py</a> |
1364 | 1364 | JIT-compiles a SAXPY kernel with NVRTC and launches it through the Driver |
1365 | 1365 | API.</p></li> |
1366 | 1366 | </ul> |
|
0 commit comments