Skip to content

Commit 1ab6ec2

Browse files
committed
cann: use thread local var
1 parent 0fbf272 commit 1ab6ec2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ggml/src/ggml-cann/ggml-cann.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
GGML_ABORT("CANN error");
6868
}
6969

70-
// Global variable to record the current device of this process.
71-
static int g_current_cann_device = -1;
70+
// Thread-local variable to record the current device of this thread.
71+
thread_local int g_current_cann_device = -1;
7272

7373
/**
7474
* @brief Set the CANN device to be used.

0 commit comments

Comments
 (0)