Skip to content

Commit c7e8fd5

Browse files
committed
Improve formatting of CUDA examples in nav
1 parent 517f760 commit c7e8fd5

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

doc/modules/ROOT/nav.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
** xref:examples.adoc#examples_random[Random Number Generation]
1818
** xref:examples.adoc#examples_cuda[CUDA Device Support]
1919
** xref:examples.adoc#examples_cuda_error_handling[CUDA Error Handling]
20+
*** xref:examples.adoc#examples_cuda_error_handling_with_error_context[With Safe_Numbers Error Context]
21+
*** xref:examples.adoc#examples_cuda_error_handling_without_error_context[Without Safe_Numbers Error Context]
2022
* xref:pretty_printers.adoc[]
2123
* xref:api_reference.adoc[]
2224
** xref:api_reference.adoc#api_namespaces[Namespaces]

doc/modules/ROOT/pages/examples.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,9 @@ Charconv (rt): PASSED
585585
[#examples_cuda_error_handling]
586586
== CUDA Error Handling
587587

588+
[#examples_cuda_error_handling_with_error_context]
589+
=== CUDA Error Handling With Error Context
590+
588591
When a safe_numbers operation overflows on the GPU, the error is captured in managed memory and rethrown with `BOOST_THROW_EXCEPTION` on the host when you call `ctx.synchronize()`.
589592
The `device_error_context` manages a dynamically allocated managed memory buffer; after catching an exception the same context can be reused immediately for new kernel launches.
590593

@@ -610,7 +613,7 @@ result[3] = 41
610613
====
611614

612615
[#examples_cuda_error_handling_without_error_context]
613-
== CUDA Error Handling Without Error Context
616+
=== CUDA Error Handling Without Error Context
614617

615618
This example demonstrates what happens when a safe_numbers overflow occurs on a CUDA device *without* using `device_error_context`.
616619
The overflow triggers a device-side trap that corrupts the CUDA context, making `cudaDeviceSynchronize()` report an unspecified launch failure.

0 commit comments

Comments
 (0)