forked from NVIDIA/cuda-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_context.pxd
More file actions
25 lines (18 loc) · 758 Bytes
/
_context.pxd
File metadata and controls
25 lines (18 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
from cuda.core._resource_handles cimport ContextHandle, GreenCtxHandle
cdef class Context:
"""Cython declaration for Context class.
This class provides access to CUDA contexts. Context objects cannot be
instantiated directly - use factory methods or Device/Stream APIs.
"""
cdef:
ContextHandle _h_context
int _device_id
object __weakref__
@staticmethod
cdef Context _from_handle(type cls, ContextHandle h_context, int device_id)
@staticmethod
cdef Context _from_green_ctx(type cls, GreenCtxHandle h_green_ctx, int device_id)
cpdef close(self)