Skip to content

Commit ad446b2

Browse files
authored
Merge branch 'main' into nvml-example
2 parents c0d2b32 + e20ef78 commit ad446b2

28 files changed

+3137
-250
lines changed

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ guide for package-specific conventions and workflows.
2323
(search), `read_file`, `list_dir`, `glob_file_search`, `apply_patch`,
2424
`todo_write/update_plan`. Use `cmd`/`run_terminal_cmd` only when no listed
2525
tool can perform the action.
26+
- If `pixi` is available for this repo, prefer `pixi run ...` or the matching
27+
`pixi` task over invoking raw `python`, `pytest`, `pip`, or similar tools
28+
directly so commands run in the repository-managed environment.
29+
- When extracting or transforming JSON in shell workflows, prefer `jq` over
30+
one-off Python parsing. For `gh` commands that return JSON, prefer the
31+
built-in `--jq` flag instead of piping the output into `python`.
2632
- When multiple tool calls can be parallelized (e.g., todo updates with other
2733
actions, file searches, reading files), make these tool calls in parallel
2834
instead of sequential. Avoid single calls that might not yield a useful

cuda_bindings/cuda/bindings/_internal/utils.pyx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,14 @@ cdef int get_nested_resource_ptr(nested_resource[ResT] &in_out_ptr, object obj,
120120
nested_ptr.reset(nested_vec, True)
121121
for i, obj_i in enumerate(obj):
122122
if ResT is char:
123-
obj_i_bytes = (<str?>(obj_i)).encode()
123+
obj_i_type = type(obj_i)
124+
if obj_i_type is str:
125+
obj_i_bytes = obj_i.encode("utf-8")
126+
elif obj_i_type is bytes:
127+
obj_i_bytes = obj_i
128+
else:
129+
raise TypeError(
130+
f"Expected str or bytes, got {obj_i_type.__name__}")
124131
str_len = <size_t>(len(obj_i_bytes)) + 1 # including null termination
125132
deref(nested_res_vec)[i].resize(str_len)
126133
obj_i_ptr = <char*>(obj_i_bytes)

cuda_bindings/cuda/bindings/nvml.pyx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27471,3 +27471,9 @@ cpdef str vgpu_type_get_name(unsigned int vgpu_type_id):
2747127471
__status__ = nvmlVgpuTypeGetName(<nvmlVgpuTypeId_t>vgpu_type_id, vgpu_type_name, <unsigned int*>size)
2747227472
check_status(__status__)
2747327473
return cpython.PyUnicode_FromStringAndSize(vgpu_type_name, size[0])
27474+
27475+
27476+
# Cleanup some docstrings that don't parse as rst.
27477+
device_get_virtualization_mode.__doc__ = device_get_virtualization_mode.__doc__.replace("NVML_GPU_VIRTUALIZATION_?", "``NVML_GPU_VIRTUALIZATION_?``")
27478+
device_set_virtualization_mode.__doc__ = device_set_virtualization_mode.__doc__.replace("NVML_GPU_VIRTUALIZATION_?", "``NVML_GPU_VIRTUALIZATION_?``")
27479+
GpmMetricId.GPM_METRIC_DRAM_BW_UTIL.__doc__ = "Percentage of DRAM bw used vs theoretical maximum. ``0.0 - 100.0 *\u200d/``."

cuda_bindings/docs/source/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ CUDA Python API Reference
1616
module/nvvm
1717
module/nvfatbin
1818
module/cufile
19+
module/nvml
1920
module/utils

cuda_bindings/docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
"sphinx.ext.napoleon",
3838
"sphinx.ext.intersphinx",
3939
"myst_nb",
40-
"enum_tools.autoenum",
4140
"sphinx_copybutton",
4241
"release_toc",
4342
"release_date",
43+
"enum_documenter",
4444
]
4545

4646
nb_execution_mode = "off"

0 commit comments

Comments
 (0)