Skip to content

Commit 1879969

Browse files
committed
cuda-core: apply pre-commit simplification in CPU example
Adopt ruff's SIM117 recommendation by collapsing nested context managers in the CPU strided memory example run path. Made-with: Cursor
1 parent 6a26931 commit 1879969

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

cuda_core/examples/strided_memory_view_cpu.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,8 @@ def _run_example(cpu_prog, cpu_func):
126126

127127
def run():
128128
cpu_prog = _create_cpu_program()
129-
with tempfile.TemporaryDirectory() as temp_dir:
130-
with _compiled_cpu_func(cpu_prog, temp_dir) as cpu_func:
131-
_run_example(cpu_prog, cpu_func)
129+
with tempfile.TemporaryDirectory() as temp_dir, _compiled_cpu_func(cpu_prog, temp_dir) as cpu_func:
130+
_run_example(cpu_prog, cpu_func)
132131

133132

134133
if __name__ == "__main__":

0 commit comments

Comments
 (0)