Skip to content

Commit 57a9b19

Browse files
committed
update multi-gpu example
1 parent 5349bd1 commit 57a9b19

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

cuda_core/examples/simple_multi_gpu_example.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,8 @@
3434
}
3535
"""
3636
arch0 = "".join(f"{i}" for i in dev0.compute_capability)
37-
prog_add = Program(code_add, code_type="c++")
38-
mod_add = prog_add.compile(
39-
"cubin",
40-
options=(
41-
"-std=c++17",
42-
"-arch=sm_" + arch0,
43-
),
44-
)
37+
prog_add = Program(code_add, code_type="c++", options={"std": "c++17", "arch": f"sm_{arch0}"})
38+
mod_add = prog_add.compile("cubin")
4539
ker_add = mod_add.get_kernel("vector_add")
4640

4741
# Set GPU 1
@@ -63,14 +57,8 @@
6357
}
6458
"""
6559
arch1 = "".join(f"{i}" for i in dev1.compute_capability)
66-
prog_sub = Program(code_sub, code_type="c++")
67-
mod_sub = prog_sub.compile(
68-
"cubin",
69-
options=(
70-
"-std=c++17",
71-
"-arch=sm_" + arch1,
72-
),
73-
)
60+
prog_sub = Program(code_sub, code_type="c++", options={"std": "c++17", "arch": f"sm_{arch0}"})
61+
mod_sub = prog_sub.compile("cubin")
7462
ker_sub = mod_sub.get_kernel("vector_sub")
7563

7664

0 commit comments

Comments
 (0)