|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 5 | + <title>Coverage for cuda/core/_context.pxd: 25.00%</title> |
| 6 | + <link rel="icon" sizes="32x32" href="favicon_32_cb_c827f16f.png"> |
| 7 | + <link rel="stylesheet" href="style_cb_4667309f.css" type="text/css"> |
| 8 | + <script type="text/javascript"> |
| 9 | + contexts = { |
| 10 | + "a": "tests/test_green_context.py::TestContextResources::test_green_ctx_resources_reflect_partition|run", |
| 11 | + "b": "tests/test_green_context.py::TestContextResources::test_green_ctx_sm_resources|run", |
| 12 | + "c": "tests/test_green_context.py::TestContextResources::test_stream_resources_match_context|run", |
| 13 | + "d": "tests/test_green_context.py::TestGreenContextKernelLaunch::test_launch_and_verify|run", |
| 14 | + "e": "tests/test_green_context.py::TestGreenContextKernelLaunch::test_two_green_contexts_independent|run", |
| 15 | + "f": "tests/test_green_context.py::TestGreenContextKernelLaunch::test_with_workqueue_resource|run", |
| 16 | + "g": "tests/test_green_context.py::TestGreenContextLifecycle::test_close_while_current_raises|run", |
| 17 | + "h": "tests/test_green_context.py::TestGreenContextLifecycle::test_create_stream_blocking_raises|run", |
| 18 | + "i": "tests/test_green_context.py::TestGreenContextLifecycle::test_create_stream_explicit|run", |
| 19 | + "j": "tests/test_green_context.py::TestGreenContextLifecycle::test_create_stream_on_primary_raises|run", |
| 20 | + "k": "tests/test_green_context.py::TestGreenContextLifecycle::test_set_current_swap_regression|run", |
| 21 | + "l": "tests/test_green_context.py::TestGreenContextLifecycle::test_stream_and_event_track_green_context|run", |
| 22 | + "m": "tests/test_green_context.py::test_context_handle_alias_and_closed_queries|run", |
| 23 | + "n": "tests/test_green_context.py::test_memory_node_updates_preserve_green_context|run", |
| 24 | + "o": "tests/test_green_context.py::test_set_current_rejects_closed_context|run" |
| 25 | +} |
| 26 | + </script> |
| 27 | + <script src="coverage_html_cb_dd2e7eb5.js" defer></script> |
| 28 | +</head> |
| 29 | +<body class="pyfile"> |
| 30 | +<header> |
| 31 | + <div class="content"> |
| 32 | + <h1> |
| 33 | + <span class="text">Coverage for </span><b>cuda<span class="sep">/</span>core<span class="sep">/</span>_context.pxd</b>: |
| 34 | + <span class="pc_cov">25.00%</span> |
| 35 | + </h1> |
| 36 | + <aside id="help_panel_wrapper"> |
| 37 | + <input id="help_panel_state" type="checkbox"> |
| 38 | + <label for="help_panel_state"> |
| 39 | + <img id="keyboard_icon" src="keybd_closed_cb_900cfef5.png" alt="Show/hide keyboard shortcuts"> |
| 40 | + </label> |
| 41 | + <div id="help_panel"> |
| 42 | + <p class="legend">Shortcuts on this page</p> |
| 43 | + <div class="keyhelp"> |
| 44 | + <p> |
| 45 | + <kbd>r</kbd> |
| 46 | + <kbd>m</kbd> |
| 47 | + <kbd>x</kbd> |
| 48 | + toggle line displays |
| 49 | + </p> |
| 50 | + <p> |
| 51 | + <kbd>j</kbd> |
| 52 | + <kbd>k</kbd> |
| 53 | + next/prev highlighted chunk |
| 54 | + </p> |
| 55 | + <p> |
| 56 | + <kbd>0</kbd> (zero) top of page |
| 57 | + </p> |
| 58 | + <p> |
| 59 | + <kbd>1</kbd> (one) first highlighted chunk |
| 60 | + </p> |
| 61 | + <p> |
| 62 | + <kbd>[</kbd> |
| 63 | + <kbd>]</kbd> |
| 64 | + prev/next file |
| 65 | + </p> |
| 66 | + <p> |
| 67 | + <kbd>u</kbd> up to the index |
| 68 | + </p> |
| 69 | + <p> |
| 70 | + <kbd>?</kbd> show/hide this help |
| 71 | + </p> |
| 72 | + </div> |
| 73 | + </div> |
| 74 | + </aside> |
| 75 | + <h2> |
| 76 | + <span class="text">4 statements </span> |
| 77 | + <button type="button" class="run button_toggle_run" value="run" data-shortcut="r" title="Toggle lines run">1<span class="text"> run</span></button> |
| 78 | + <button type="button" class="mis show_mis button_toggle_mis" value="mis" data-shortcut="m" title="Toggle lines missing">3<span class="text"> missing</span></button> |
| 79 | + <button type="button" class="exc show_exc button_toggle_exc" value="exc" data-shortcut="x" title="Toggle lines excluded">0<span class="text"> excluded</span></button> |
| 80 | + </h2> |
| 81 | + <p class="text"> |
| 82 | + <a id="prevFileLink" class="nav" href="z_bb8e88d71740c463_runtime_pyx.html">« prev</a> |
| 83 | + <a id="indexLink" class="nav" href="index.html">^ index</a> |
| 84 | + <a id="nextFileLink" class="nav" href="z_0efdcd0c69c2ddb8__context_pyx.html">» next</a> |
| 85 | + |
| 86 | + <a class="nav" href="https://coverage.readthedocs.io/en/7.16.0">coverage.py v7.16.0</a>, |
| 87 | + created at 2026-08-30 01:29 +0000 |
| 88 | + </p> |
| 89 | + <aside class="hidden"> |
| 90 | + <button type="button" class="button_next_chunk" data-shortcut="j"></button> |
| 91 | + <button type="button" class="button_prev_chunk" data-shortcut="k"></button> |
| 92 | + <button type="button" class="button_top_of_page" data-shortcut="0"></button> |
| 93 | + <button type="button" class="button_first_chunk" data-shortcut="1"></button> |
| 94 | + <button type="button" class="button_prev_file" data-shortcut="["></button> |
| 95 | + <button type="button" class="button_next_file" data-shortcut="]"></button> |
| 96 | + <button type="button" class="button_to_index" data-shortcut="u"></button> |
| 97 | + <button type="button" class="button_show_hide_help" data-shortcut="?"></button> |
| 98 | + </aside> |
| 99 | + </div> |
| 100 | +</header> |
| 101 | +<main id="source"> |
| 102 | + <p class="pln"><span class="n"><a id="t1" href="#t1">1</a></span><span class="t"><span class="txt"># SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.</span> </span><span class="r"></span></p> |
| 103 | + <p class="pln"><span class="n"><a id="t2" href="#t2">2</a></span><span class="t"><span class="txt">#</span> </span><span class="r"></span></p> |
| 104 | + <p class="pln"><span class="n"><a id="t3" href="#t3">3</a></span><span class="t"><span class="txt"># SPDX-License-Identifier: Apache-2.0</span> </span><span class="r"></span></p> |
| 105 | + <p class="pln"><span class="n"><a id="t4" href="#t4">4</a></span><span class="t"><span class="txt"> </span> </span><span class="r"></span></p> |
| 106 | + <p class="pln"><span class="n"><a id="t5" href="#t5">5</a></span><span class="t"><span class="txt">from cuda.core._resource_handles cimport ContextHandle, GreenCtxHandle</span> </span><span class="r"></span></p> |
| 107 | + <p class="pln"><span class="n"><a id="t6" href="#t6">6</a></span><span class="t"><span class="txt"> </span> </span><span class="r"></span></p> |
| 108 | + <p class="pln"><span class="n"><a id="t7" href="#t7">7</a></span><span class="t"><span class="txt">cdef class Context:</span> </span><span class="r"></span></p> |
| 109 | + <p class="pln"><span class="n"><a id="t8" href="#t8">8</a></span><span class="t"><span class="txt"> """Cython declaration for Context class.</span> </span><span class="r"></span></p> |
| 110 | + <p class="pln"><span class="n"><a id="t9" href="#t9">9</a></span><span class="t"><span class="txt"> </span> </span><span class="r"></span></p> |
| 111 | + <p class="pln"><span class="n"><a id="t10" href="#t10">10</a></span><span class="t"><span class="txt"> This class provides access to CUDA contexts. Context objects cannot be</span> </span><span class="r"></span></p> |
| 112 | + <p class="pln"><span class="n"><a id="t11" href="#t11">11</a></span><span class="t"><span class="txt"> instantiated directly - use factory methods or Device/Stream APIs.</span> </span><span class="r"></span></p> |
| 113 | + <p class="pln"><span class="n"><a id="t12" href="#t12">12</a></span><span class="t"><span class="txt"> """</span> </span><span class="r"></span></p> |
| 114 | + <p class="pln"><span class="n"><a id="t13" href="#t13">13</a></span><span class="t"><span class="txt"> </span> </span><span class="r"></span></p> |
| 115 | + <p class="pln"><span class="n"><a id="t14" href="#t14">14</a></span><span class="t"><span class="txt"> cdef:</span> </span><span class="r"></span></p> |
| 116 | + <p class="pln"><span class="n"><a id="t15" href="#t15">15</a></span><span class="t"><span class="txt"> ContextHandle _h_context</span> </span><span class="r"></span></p> |
| 117 | + <p class="pln"><span class="n"><a id="t16" href="#t16">16</a></span><span class="t"><span class="txt"> int _device_id</span> </span><span class="r"></span></p> |
| 118 | + <p class="pln"><span class="n"><a id="t17" href="#t17">17</a></span><span class="t"><span class="txt"> object __weakref__</span> </span><span class="r"></span></p> |
| 119 | + <p class="pln"><span class="n"><a id="t18" href="#t18">18</a></span><span class="t"><span class="txt"> </span> </span><span class="r"></span></p> |
| 120 | + <p class="pln"><span class="n"><a id="t19" href="#t19">19</a></span><span class="t"><span class="txt"> @staticmethod</span> </span><span class="r"></span></p> |
| 121 | + <p class="mis show_mis"><span class="n"><a id="t20" href="#t20">20</a></span><span class="t"><span class="txt"> cdef Context _from_handle(type cls, ContextHandle h_context, int device_id)</span> </span><span class="r"></span></p> |
| 122 | + <p class="pln"><span class="n"><a id="t21" href="#t21">21</a></span><span class="t"><span class="txt"> </span> </span><span class="r"></span></p> |
| 123 | + <p class="pln"><span class="n"><a id="t22" href="#t22">22</a></span><span class="t"><span class="txt"> @staticmethod</span> </span><span class="r"></span></p> |
| 124 | + <p class="mis show_mis"><span class="n"><a id="t23" href="#t23">23</a></span><span class="t"><span class="txt"> cdef Context _from_green_ctx(type cls, GreenCtxHandle h_green_ctx, int device_id)</span> </span><span class="r"></span></p> |
| 125 | + <p class="pln"><span class="n"><a id="t24" href="#t24">24</a></span><span class="t"><span class="txt"> </span> </span><span class="r"></span></p> |
| 126 | + <p class="pln"><span class="n"><a id="t25" href="#t25">25</a></span><span class="t"><span class="txt"> cpdef close(self)</span> </span><span class="r"></span></p> |
| 127 | + <p class="mis show_mis"><span class="n"><a id="t26" href="#t26">26</a></span><span class="t"><span class="txt"> </span> </span><span class="r"></span></p> |
| 128 | + <p class="pln"><span class="n"><a id="t27" href="#t27">27</a></span><span class="t"><span class="txt"> </span> </span><span class="r"></span></p> |
| 129 | + <p class="pln"><span class="n"><a id="t28" href="#t28">28</a></span><span class="t"><span class="txt">cdef inline int Context_check_open(Context self) except -1:</span> </span><span class="r"></span></p> |
| 130 | + <p class="run"><span class="n"><a id="t29" href="#t29">29</a></span><span class="t"><span class="txt"> if not self._h_context:</span> </span><input type="checkbox" id="ctxs29"><span class="r"><label for="ctxs29" class="ctx">15 ctx</label></span><span class="ctxs">1abcdefghijklmno</span></p> |
| 131 | + <p class="pln"><span class="n"><a id="t30" href="#t30">30</a></span><span class="t"><span class="txt"> raise RuntimeError("Context has been closed")</span> </span><span class="r"></span></p> |
| 132 | + <p class="pln"><span class="n"><a id="t31" href="#t31">31</a></span><span class="t"><span class="txt"> return 0</span> </span><span class="r"></span></p> |
| 133 | +</main> |
| 134 | +<footer> |
| 135 | + <div class="content"> |
| 136 | + <p> |
| 137 | + <a class="nav" href="z_bb8e88d71740c463_runtime_pyx.html">« prev</a> |
| 138 | + <a class="nav" href="index.html">^ index</a> |
| 139 | + <a class="nav" href="z_0efdcd0c69c2ddb8__context_pyx.html">» next</a> |
| 140 | + |
| 141 | + <a class="nav" href="https://coverage.readthedocs.io/en/7.16.0">coverage.py v7.16.0</a>, |
| 142 | + created at 2026-08-30 01:29 +0000 |
| 143 | + </p> |
| 144 | + </div> |
| 145 | +</footer> |
| 146 | +</body> |
| 147 | +</html> |
0 commit comments