Skip to content

Commit 61c30e2

Browse files
committed
Bindings for sync_device() and sync_all_devices()
1 parent f37e46e commit 61c30e2

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

docs/reference.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,8 @@ Low-level bits
620620
.. autofunction:: thread_count
621621
.. autofunction:: set_thread_count
622622
.. autofunction:: sync_thread
623+
.. autofunction:: sync_device
624+
.. autofunction:: sync_all_devices
623625
.. autofunction:: flush_kernel_cache
624626
.. autofunction:: flush_malloc_cache
625627
.. autofunction:: expand_threshold

src/python/docstr.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7130,6 +7130,16 @@
71307130
then you have found a bug. Please report it on the project's
71317131
`GitHub issue tracker <https://github.com/mitsuba-renderer/drjit>`__.
71327132

7133+
7134+
.. topic:: sync_device
7135+
7136+
Wait for all computation on the current device to finish.
7137+
7138+
.. topic:: sync_all_devices
7139+
7140+
Wait for all computation on *all devices* to finish.
7141+
7142+
71337143
.. topic:: flush_malloc_cache
71347144

71357145
Free the memory allocation cache maintained by Dr.Jit.

src/python/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ NB_MODULE(_drjit_ext, m_) {
171171
m.def("has_backend", &jit_has_backend, doc_has_backend);
172172

173173
m.def("sync_thread", &jit_sync_thread, doc_sync_thread)
174+
.def("sync_device", &jit_sync_device, doc_sync_device)
175+
.def("sync_all_devices", &jit_sync_all_devices, doc_sync_all_devices)
174176
.def("flush_kernel_cache", &jit_flush_kernel_cache, doc_flush_kernel_cache)
175177
.def("flush_malloc_cache", &jit_flush_malloc_cache, doc_flush_malloc_cache)
176178
.def("malloc_clear_statistics", &jit_malloc_clear_statistics)

0 commit comments

Comments
 (0)