Skip to content

Commit 567ea2c

Browse files
authored
Merge branch 'main' into memory-refactor
2 parents 0d5f08b + 85d57c2 commit 567ea2c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cuda_core/tests/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
import multiprocessing
5+
import os
56

67
import helpers
78
import pytest
@@ -29,6 +30,13 @@ def init_cuda():
2930
# TODO: rename this to e.g. init_context
3031
device = Device()
3132
device.set_current()
33+
34+
# Set option to avoid spin-waiting on synchronization.
35+
if int(os.environ.get("CUDA_CORE_TEST_BLOCKING_SYNC", 0)) != 0:
36+
handle_return(
37+
driver.cuDevicePrimaryCtxSetFlags(device.device_id, driver.CUctx_flags.CU_CTX_SCHED_BLOCKING_SYNC)
38+
)
39+
3240
yield
3341
_ = _device_unset_current()
3442

0 commit comments

Comments
 (0)