Skip to content

Commit aa7f10e

Browse files
committed
ensure context exists when LinkState is created
This is needed as SimpleKernel may be invoked before calling any Runtime APIs.
1 parent 79fedbc commit aa7f10e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

cupy/cuda/function.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ cdef class LinkState:
191191
"""CUDA link state."""
192192

193193
def __init__(self):
194+
runtime._ensure_context()
194195
self.ptr = driver.linkCreate()
195196

196197
def __del__(self):

0 commit comments

Comments
 (0)