Skip to content

Commit dc8ec1c

Browse files
[cli] Add TI_GDB_TRIGGER environment variable (#766)
Co-authored-by: Yuanming Hu <[email protected]>
1 parent bab2720 commit dc8ec1c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

python/taichi/lang/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ def boolean_config(key, name=None):
130130
boolean_config("verbose")
131131
boolean_config("fast_math")
132132
boolean_config("async")
133+
gdb_trigger = os.environ.get("TI_GDB_TRIGGER")
134+
if gdb_trigger is not None:
135+
ti.set_gdb_trigger(len(gdb_trigger) and bool(int(gdb_trigger)))
133136
arch = os.environ.get("TI_ARCH")
134137
if arch is not None:
135138
print(f'Following TI_ARCH setting up for arch={arch}')

taichi/backends/cuda/cuda_driver.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ bool CUDADriver::detected() {
2121
CUDADriver::CUDADriver() {
2222
#if defined(TI_PLATFORM_LINUX)
2323
loader = std::make_unique<DynamicLoader>("libcuda.so");
24-
#else
24+
#elif defined(TI_PLATFORM_WINDOWS)
2525
loader = std::make_unique<DynamicLoader>("nvcuda.dll");
26+
#else
27+
static_assert(false, "Taichi CUDA driver supports only Windows and Linux.");
2628
#endif
2729

2830
if (detected()) {

0 commit comments

Comments
 (0)