Skip to content

Commit 0887590

Browse files
committed
Fix test_numba: lazy import cuda to avoid CPU crash
Move 'from numba import cuda' from module level into the @gpu_test method. numba-cuda v0.30.0 requires libcudart.so at import time, which is not available on the CPU image.
1 parent 81f8067 commit 0887590

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/test_numba.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import unittest
22

33
import numpy as np
4-
from numba import jit, cuda
4+
from numba import jit
55

66
from common import gpu_test
77

@@ -20,6 +20,8 @@ def go_fast(a): # Function is compiled to machine code when called the first tim
2020

2121
@gpu_test
2222
def test_cuda_jit(self):
23+
from numba import cuda
24+
2325
x = np.arange(10)
2426

2527
@cuda.jit

0 commit comments

Comments
 (0)