Commit ff84853
authored
Add missing driver & runtime bindings for functions new in CTK 13.1.0 (#1337)
* Add driver bindings for new functions in CTK 13.1
* Add runtime bindings for new functions in CTK 13.1
* Fix UnicodeDecodeError on Windows by using UTF-8 encoding in setup.py
The generate_output function was reading .in files without specifying
UTF-8 encoding, causing UnicodeDecodeError on Windows where Python
defaults to cp1252 encoding. The generated .in files contain UTF-8
characters (smart quotes from CUDA documentation), which cannot be
decoded with cp1252.
This fix adds encoding='utf-8' to all file operations in generate_output
to ensure proper handling of UTF-8 content on all platforms.
* Add Phase 1 unit tests for CUDA 13.1+ graph/node ID functions
Add comprehensive tests for the new graph and node ID getter functions
introduced in CUDA 13.1:
Driver API tests (test_cuda.py):
- test_cuGraphGetId: Tests graph ID retrieval
- test_cuGraphExecGetId: Tests graph execution ID retrieval
- test_cuGraphNodeGetLocalId: Tests node local ID retrieval
- test_cuGraphNodeGetToolsId: Tests node tools ID retrieval
- test_cuGraphNodeGetContainingGraph: Tests containing graph retrieval
Runtime API tests (test_cudart.py):
- test_cudaGraphGetId: Tests graph ID retrieval
- test_cudaGraphExecGetId: Tests graph execution ID retrieval
- test_cudaGraphNodeGetLocalId: Tests node local ID retrieval
- test_cudaGraphNodeGetToolsId: Tests node tools ID retrieval
- test_cudaGraphNodeGetContainingGraph: Tests containing graph retrieval
All tests include:
- Version checks (CUDA 13.1+)
- API availability checks
- Proper resource cleanup
- Validation of return types and uniqueness
- Edge case testing (child graphs)
All 92 tests pass successfully.
* Add Phase 2 unit tests for CUDA 13.1+ resource management functions
Add comprehensive tests for the new resource management functions
introduced in CUDA 13.1:
Driver API tests (test_cuda.py):
- test_cuStreamGetDevResource: Tests getting device resource from stream
Runtime API tests (test_cudart.py):
- test_cudaStreamGetDevResource: Tests getting device resource from stream
- test_cudaDeviceGetDevResource: Tests getting device resource from device
- test_cudaExecutionCtxGetDevResource: Tests getting device resource from execution context
- test_cudaExecutionCtxGetDevice: Tests getting device handle from execution context
- test_cudaExecutionCtxGetId: Tests getting unique ID from execution context
All tests include:
- Version checks (CUDA 13.1+)
- API availability checks
- Proper resource cleanup
- Validation of return types and values
- Execution context handling using cudaDeviceGetExecutionCtx
All 98 tests pass successfully (10 Phase 1 + 6 Phase 2 + 82 existing).
* Add Phase 3 unit tests for CUDA 13.1+ complex resource functions
Add comprehensive tests for the complex resource management and context
functions introduced in CUDA 13.1:
Driver API tests (test_cuda.py):
- test_cuDevSmResourceSplit: Tests splitting SM resource into structured groups
Runtime API tests (test_cudart.py):
- test_cudaDevSmResourceSplit: Tests splitting SM resource into structured groups
- test_cudaDevSmResourceSplitByCount: Tests splitting SM resource by count
- test_cudaDevResourceGenerateDesc: Tests generating resource descriptor
- test_cudaGreenCtxCreate: Tests creating green context with resources
- test_cudaExecutionCtxStreamCreate: Tests creating stream for execution context
- test_cudaGraphConditionalHandleCreate_v2: Tests creating conditional handle with execution context
All tests include:
- Version checks (CUDA 13.1+)
- API availability checks
- Proper resource cleanup
- Validation of return types and values
- Resource splitting and descriptor generation workflows
- Green context creation and stream management
All 105 tests pass successfully (10 Phase 1 + 6 Phase 2 + 7 Phase 3 + 82 existing).
* Remove # Phase 1, 2, 3 comments (they will be more distracting than helpful after this PR is merged).1 parent db6118e commit ff84853
File tree
18 files changed
+3206
-49
lines changed- cuda_bindings
- cuda/bindings
- _bindings
- docs/source/module
- tests
18 files changed
+3206
-49
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1609 | 1609 | | |
1610 | 1610 | | |
1611 | 1611 | | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
1612 | 1637 | | |
1613 | 1638 | | |
1614 | 1639 | | |
| |||
2174 | 2199 | | |
2175 | 2200 | | |
2176 | 2201 | | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
2177 | 2207 | | |
2178 | 2208 | | |
2179 | 2209 | | |
| |||
2204 | 2234 | | |
2205 | 2235 | | |
2206 | 2236 | | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
2207 | 2242 | | |
2208 | 2243 | | |
2209 | 2244 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1186 | 1186 | | |
1187 | 1187 | | |
1188 | 1188 | | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
1189 | 1214 | | |
1190 | 1215 | | |
1191 | 1216 | | |
| |||
1381 | 1406 | | |
1382 | 1407 | | |
1383 | 1408 | | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
1384 | 1414 | | |
1385 | 1415 | | |
1386 | 1416 | | |
| |||
1441 | 1471 | | |
1442 | 1472 | | |
1443 | 1473 | | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
1444 | 1499 | | |
1445 | 1500 | | |
1446 | 1501 | | |
1447 | 1502 | | |
1448 | 1503 | | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
1449 | 1524 | | |
1450 | 1525 | | |
1451 | 1526 | | |
1452 | 1527 | | |
1453 | 1528 | | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
1454 | 1534 | | |
1455 | 1535 | | |
1456 | 1536 | | |
| |||
1461 | 1541 | | |
1462 | 1542 | | |
1463 | 1543 | | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
1464 | 1549 | | |
1465 | 1550 | | |
1466 | 1551 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2150 | 2150 | | |
2151 | 2151 | | |
2152 | 2152 | | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
2153 | 2198 | | |
2154 | 2199 | | |
2155 | 2200 | | |
| |||
2501 | 2546 | | |
2502 | 2547 | | |
2503 | 2548 | | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
2504 | 2558 | | |
2505 | 2559 | | |
2506 | 2560 | | |
| |||
2609 | 2663 | | |
2610 | 2664 | | |
2611 | 2665 | | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
2612 | 2711 | | |
2613 | 2712 | | |
2614 | 2713 | | |
| |||
2618 | 2717 | | |
2619 | 2718 | | |
2620 | 2719 | | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
2621 | 2756 | | |
2622 | 2757 | | |
2623 | 2758 | | |
| |||
2627 | 2762 | | |
2628 | 2763 | | |
2629 | 2764 | | |
| 2765 | + | |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
| 2770 | + | |
| 2771 | + | |
| 2772 | + | |
| 2773 | + | |
2630 | 2774 | | |
2631 | 2775 | | |
2632 | 2776 | | |
| |||
2645 | 2789 | | |
2646 | 2790 | | |
2647 | 2791 | | |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
| 2799 | + | |
| 2800 | + | |
2648 | 2801 | | |
2649 | 2802 | | |
2650 | 2803 | | |
| |||
0 commit comments