Skip to content

Commit 4e70324

Browse files
committed
fix: remove incorrect noexcept from resource handle functions
Functions that allocate memory (via new, std::make_shared, or container operations) can throw std::bad_alloc. Marking them noexcept causes std::terminate on OOM instead of allowing graceful error handling. Changes: - Remove noexcept from 22 C++ functions that can throw - Keep noexcept on 5 functions that truly cannot throw: get_last_error, peek_last_error, clear_last_error, deallocation_stream, set_deallocation_stream - Update Cython .pxd/.pyx to use "nogil except+" for throwing functions This allows C++ exceptions to be translated to Python exceptions by Cython, enabling proper error handling instead of process termination. Based on feedback from Leo Fang, Lawrence Mitchell, and Vyas Ramasubramani.
1 parent 709c402 commit 4e70324

4 files changed

Lines changed: 88 additions & 88 deletions

File tree

cuda_core/cuda/core/_cpp/resource_handles.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,15 @@ struct ContextBox {
171171
};
172172
} // namespace
173173

174-
ContextHandle create_context_handle_ref(CUcontext ctx) noexcept {
174+
ContextHandle create_context_handle_ref(CUcontext ctx) {
175175
auto box = std::make_shared<const ContextBox>(ContextBox{ctx});
176176
return ContextHandle(box, &box->resource);
177177
}
178178

179179
// Thread-local cache of primary contexts indexed by device ID
180180
static thread_local std::vector<ContextHandle> primary_context_cache;
181181

182-
ContextHandle get_primary_context(int device_id) noexcept {
182+
ContextHandle get_primary_context(int device_id) {
183183
// Check thread-local cache
184184
if (static_cast<size_t>(device_id) < primary_context_cache.size()) {
185185
if (auto cached = primary_context_cache[device_id]) {
@@ -212,7 +212,7 @@ ContextHandle get_primary_context(int device_id) noexcept {
212212
return h;
213213
}
214214

215-
ContextHandle get_current_context() noexcept {
215+
ContextHandle get_current_context() {
216216
GILReleaseGuard gil;
217217
CUcontext ctx = nullptr;
218218
if (CUDA_SUCCESS != (err = p_cuCtxGetCurrent(&ctx))) {
@@ -234,7 +234,7 @@ struct StreamBox {
234234
};
235235
} // namespace
236236

237-
StreamHandle create_stream_handle(ContextHandle h_ctx, unsigned int flags, int priority) noexcept {
237+
StreamHandle create_stream_handle(ContextHandle h_ctx, unsigned int flags, int priority) {
238238
GILReleaseGuard gil;
239239
CUstream stream;
240240
if (CUDA_SUCCESS != (err = p_cuStreamCreateWithPriority(&stream, flags, priority))) {
@@ -252,12 +252,12 @@ StreamHandle create_stream_handle(ContextHandle h_ctx, unsigned int flags, int p
252252
return StreamHandle(box, &box->resource);
253253
}
254254

255-
StreamHandle create_stream_handle_ref(CUstream stream) noexcept {
255+
StreamHandle create_stream_handle_ref(CUstream stream) {
256256
auto box = std::make_shared<const StreamBox>(StreamBox{stream});
257257
return StreamHandle(box, &box->resource);
258258
}
259259

260-
StreamHandle create_stream_handle_with_owner(CUstream stream, PyObject* owner) noexcept {
260+
StreamHandle create_stream_handle_with_owner(CUstream stream, PyObject* owner) {
261261
if (!owner) {
262262
return create_stream_handle_ref(stream);
263263
}
@@ -281,12 +281,12 @@ StreamHandle create_stream_handle_with_owner(CUstream stream, PyObject* owner) n
281281
return StreamHandle(box, &box->resource);
282282
}
283283

284-
StreamHandle get_legacy_stream() noexcept {
284+
StreamHandle get_legacy_stream() {
285285
static StreamHandle handle = create_stream_handle_ref(CU_STREAM_LEGACY);
286286
return handle;
287287
}
288288

289-
StreamHandle get_per_thread_stream() noexcept {
289+
StreamHandle get_per_thread_stream() {
290290
static StreamHandle handle = create_stream_handle_ref(CU_STREAM_PER_THREAD);
291291
return handle;
292292
}
@@ -301,7 +301,7 @@ struct EventBox {
301301
};
302302
} // namespace
303303

304-
EventHandle create_event_handle(ContextHandle h_ctx, unsigned int flags) noexcept {
304+
EventHandle create_event_handle(ContextHandle h_ctx, unsigned int flags) {
305305
GILReleaseGuard gil;
306306
CUevent event;
307307
if (CUDA_SUCCESS != (err = p_cuEventCreate(&event, flags))) {
@@ -319,11 +319,11 @@ EventHandle create_event_handle(ContextHandle h_ctx, unsigned int flags) noexcep
319319
return EventHandle(box, &box->resource);
320320
}
321321

322-
EventHandle create_event_handle_noctx(unsigned int flags) noexcept {
322+
EventHandle create_event_handle_noctx(unsigned int flags) {
323323
return create_event_handle(ContextHandle{}, flags);
324324
}
325325

326-
EventHandle create_event_handle_ipc(const CUipcEventHandle& ipc_handle) noexcept {
326+
EventHandle create_event_handle_ipc(const CUipcEventHandle& ipc_handle) {
327327
GILReleaseGuard gil;
328328
CUevent event;
329329
if (CUDA_SUCCESS != (err = p_cuIpcOpenEventHandle(&event, ipc_handle))) {
@@ -381,7 +381,7 @@ static MemoryPoolHandle wrap_mempool_owned(CUmemoryPool pool) {
381381
return MemoryPoolHandle(box, &box->resource);
382382
}
383383

384-
MemoryPoolHandle create_mempool_handle(const CUmemPoolProps& props) noexcept {
384+
MemoryPoolHandle create_mempool_handle(const CUmemPoolProps& props) {
385385
GILReleaseGuard gil;
386386
CUmemoryPool pool;
387387
if (CUDA_SUCCESS != (err = p_cuMemPoolCreate(&pool, &props))) {
@@ -390,12 +390,12 @@ MemoryPoolHandle create_mempool_handle(const CUmemPoolProps& props) noexcept {
390390
return wrap_mempool_owned(pool);
391391
}
392392

393-
MemoryPoolHandle create_mempool_handle_ref(CUmemoryPool pool) noexcept {
393+
MemoryPoolHandle create_mempool_handle_ref(CUmemoryPool pool) {
394394
auto box = std::make_shared<const MemoryPoolBox>(MemoryPoolBox{pool});
395395
return MemoryPoolHandle(box, &box->resource);
396396
}
397397

398-
MemoryPoolHandle get_device_mempool(int device_id) noexcept {
398+
MemoryPoolHandle get_device_mempool(int device_id) {
399399
GILReleaseGuard gil;
400400
CUmemoryPool pool;
401401
if (CUDA_SUCCESS != (err = p_cuDeviceGetMemPool(&pool, device_id))) {
@@ -404,7 +404,7 @@ MemoryPoolHandle get_device_mempool(int device_id) noexcept {
404404
return create_mempool_handle_ref(pool);
405405
}
406406

407-
MemoryPoolHandle create_mempool_handle_ipc(int fd, CUmemAllocationHandleType handle_type) noexcept {
407+
MemoryPoolHandle create_mempool_handle_ipc(int fd, CUmemAllocationHandleType handle_type) {
408408
GILReleaseGuard gil;
409409
CUmemoryPool pool;
410410
auto handle_ptr = reinterpret_cast<void*>(static_cast<uintptr_t>(fd));
@@ -448,7 +448,7 @@ void set_deallocation_stream(const DevicePtrHandle& h, StreamHandle h_stream) no
448448
get_box(h)->h_stream = std::move(h_stream);
449449
}
450450

451-
DevicePtrHandle deviceptr_alloc_from_pool(size_t size, MemoryPoolHandle h_pool, StreamHandle h_stream) noexcept {
451+
DevicePtrHandle deviceptr_alloc_from_pool(size_t size, MemoryPoolHandle h_pool, StreamHandle h_stream) {
452452
GILReleaseGuard gil;
453453
CUdeviceptr ptr;
454454
if (CUDA_SUCCESS != (err = p_cuMemAllocFromPoolAsync(&ptr, size, *h_pool, as_cu(h_stream)))) {
@@ -466,7 +466,7 @@ DevicePtrHandle deviceptr_alloc_from_pool(size_t size, MemoryPoolHandle h_pool,
466466
return DevicePtrHandle(box, &box->resource);
467467
}
468468

469-
DevicePtrHandle deviceptr_alloc_async(size_t size, StreamHandle h_stream) noexcept {
469+
DevicePtrHandle deviceptr_alloc_async(size_t size, StreamHandle h_stream) {
470470
GILReleaseGuard gil;
471471
CUdeviceptr ptr;
472472
if (CUDA_SUCCESS != (err = p_cuMemAllocAsync(&ptr, size, as_cu(h_stream)))) {
@@ -484,7 +484,7 @@ DevicePtrHandle deviceptr_alloc_async(size_t size, StreamHandle h_stream) noexce
484484
return DevicePtrHandle(box, &box->resource);
485485
}
486486

487-
DevicePtrHandle deviceptr_alloc(size_t size) noexcept {
487+
DevicePtrHandle deviceptr_alloc(size_t size) {
488488
GILReleaseGuard gil;
489489
CUdeviceptr ptr;
490490
if (CUDA_SUCCESS != (err = p_cuMemAlloc(&ptr, size))) {
@@ -502,7 +502,7 @@ DevicePtrHandle deviceptr_alloc(size_t size) noexcept {
502502
return DevicePtrHandle(box, &box->resource);
503503
}
504504

505-
DevicePtrHandle deviceptr_alloc_host(size_t size) noexcept {
505+
DevicePtrHandle deviceptr_alloc_host(size_t size) {
506506
GILReleaseGuard gil;
507507
void* ptr;
508508
if (CUDA_SUCCESS != (err = p_cuMemAllocHost(&ptr, size))) {
@@ -520,12 +520,12 @@ DevicePtrHandle deviceptr_alloc_host(size_t size) noexcept {
520520
return DevicePtrHandle(box, &box->resource);
521521
}
522522

523-
DevicePtrHandle deviceptr_create_ref(CUdeviceptr ptr) noexcept {
523+
DevicePtrHandle deviceptr_create_ref(CUdeviceptr ptr) {
524524
auto box = std::make_shared<DevicePtrBox>(DevicePtrBox{ptr, StreamHandle{}});
525525
return DevicePtrHandle(box, &box->resource);
526526
}
527527

528-
DevicePtrHandle deviceptr_create_with_owner(CUdeviceptr ptr, PyObject* owner) noexcept {
528+
DevicePtrHandle deviceptr_create_with_owner(CUdeviceptr ptr, PyObject* owner) {
529529
if (!owner) {
530530
return deviceptr_create_ref(ptr);
531531
}
@@ -607,7 +607,7 @@ struct ExportDataKeyHash {
607607
static std::mutex ipc_ptr_cache_mutex;
608608
static std::unordered_map<ExportDataKey, std::weak_ptr<DevicePtrBox>, ExportDataKeyHash> ipc_ptr_cache;
609609

610-
DevicePtrHandle deviceptr_import_ipc(MemoryPoolHandle h_pool, const void* export_data, StreamHandle h_stream) noexcept {
610+
DevicePtrHandle deviceptr_import_ipc(MemoryPoolHandle h_pool, const void* export_data, StreamHandle h_stream) {
611611
auto data = const_cast<CUmemPoolPtrExportData*>(
612612
reinterpret_cast<const CUmemPoolPtrExportData*>(export_data));
613613

cuda_core/cuda/core/_cpp/resource_handles.hpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ using MemoryPoolHandle = std::shared_ptr<const CUmemoryPool>;
7575
// ============================================================================
7676

7777
// Function to create a non-owning context handle (references existing context).
78-
ContextHandle create_context_handle_ref(CUcontext ctx) noexcept;
78+
ContextHandle create_context_handle_ref(CUcontext ctx);
7979

8080
// Get handle to the primary context for a device (with thread-local caching)
8181
// Returns empty handle on error (caller must check)
82-
ContextHandle get_primary_context(int device_id) noexcept;
82+
ContextHandle get_primary_context(int device_id);
8383

8484
// Get handle to the current CUDA context
8585
// Returns empty handle if no context is current (caller must check)
86-
ContextHandle get_current_context() noexcept;
86+
ContextHandle get_current_context();
8787

8888
// ============================================================================
8989
// Stream handle functions
@@ -93,26 +93,26 @@ ContextHandle get_current_context() noexcept;
9393
// The stream structurally depends on the provided context handle.
9494
// When the last reference is released, cuStreamDestroy is called automatically.
9595
// Returns empty handle on error (caller must check).
96-
StreamHandle create_stream_handle(ContextHandle h_ctx, unsigned int flags, int priority) noexcept;
96+
StreamHandle create_stream_handle(ContextHandle h_ctx, unsigned int flags, int priority);
9797

9898
// Create a non-owning stream handle (references existing stream).
9999
// Use for borrowed streams (from foreign code) or built-in streams.
100100
// The stream will NOT be destroyed when the handle is released.
101101
// Caller is responsible for keeping the stream's context alive.
102-
StreamHandle create_stream_handle_ref(CUstream stream) noexcept;
102+
StreamHandle create_stream_handle_ref(CUstream stream);
103103

104104
// Create a non-owning stream handle that prevents a Python owner from being GC'd.
105105
// The owner's refcount is incremented; decremented when handle is released.
106106
// The owner is responsible for keeping the stream's context alive.
107-
StreamHandle create_stream_handle_with_owner(CUstream stream, PyObject* owner) noexcept;
107+
StreamHandle create_stream_handle_with_owner(CUstream stream, PyObject* owner);
108108

109109
// Get non-owning handle to the legacy default stream (CU_STREAM_LEGACY)
110110
// Note: Legacy stream has no specific context dependency.
111-
StreamHandle get_legacy_stream() noexcept;
111+
StreamHandle get_legacy_stream();
112112

113113
// Get non-owning handle to the per-thread default stream (CU_STREAM_PER_THREAD)
114114
// Note: Per-thread stream has no specific context dependency.
115-
StreamHandle get_per_thread_stream() noexcept;
115+
StreamHandle get_per_thread_stream();
116116

117117
// ============================================================================
118118
// Event handle functions
@@ -122,19 +122,19 @@ StreamHandle get_per_thread_stream() noexcept;
122122
// The event structurally depends on the provided context handle.
123123
// When the last reference is released, cuEventDestroy is called automatically.
124124
// Returns empty handle on error (caller must check).
125-
EventHandle create_event_handle(ContextHandle h_ctx, unsigned int flags) noexcept;
125+
EventHandle create_event_handle(ContextHandle h_ctx, unsigned int flags);
126126

127127
// Create an owning event handle without context dependency.
128128
// Use for temporary events that are created and destroyed in the same scope.
129129
// When the last reference is released, cuEventDestroy is called automatically.
130130
// Returns empty handle on error (caller must check).
131-
EventHandle create_event_handle_noctx(unsigned int flags) noexcept;
131+
EventHandle create_event_handle_noctx(unsigned int flags);
132132

133133
// Create an owning event handle from an IPC handle.
134134
// The originating process owns the event and its context.
135135
// When the last reference is released, cuEventDestroy is called automatically.
136136
// Returns empty handle on error (caller must check).
137-
EventHandle create_event_handle_ipc(const CUipcEventHandle& ipc_handle) noexcept;
137+
EventHandle create_event_handle_ipc(const CUipcEventHandle& ipc_handle);
138138

139139
// ============================================================================
140140
// Memory pool handle functions
@@ -144,22 +144,22 @@ EventHandle create_event_handle_ipc(const CUipcEventHandle& ipc_handle) noexcept
144144
// Memory pools are device-scoped (not context-scoped).
145145
// When the last reference is released, cuMemPoolDestroy is called automatically.
146146
// Returns empty handle on error (caller must check).
147-
MemoryPoolHandle create_mempool_handle(const CUmemPoolProps& props) noexcept;
147+
MemoryPoolHandle create_mempool_handle(const CUmemPoolProps& props);
148148

149149
// Create a non-owning memory pool handle (references existing pool).
150150
// Use for device default/current pools that are managed by the driver.
151151
// The pool will NOT be destroyed when the handle is released.
152-
MemoryPoolHandle create_mempool_handle_ref(CUmemoryPool pool) noexcept;
152+
MemoryPoolHandle create_mempool_handle_ref(CUmemoryPool pool);
153153

154154
// Get non-owning handle to the current memory pool for a device.
155155
// Returns empty handle on error (caller must check).
156-
MemoryPoolHandle get_device_mempool(int device_id) noexcept;
156+
MemoryPoolHandle get_device_mempool(int device_id);
157157

158158
// Create an owning memory pool handle from an IPC import.
159159
// The file descriptor is NOT owned by this handle (caller manages FD separately).
160160
// When the last reference is released, cuMemPoolDestroy is called automatically.
161161
// Returns empty handle on error (caller must check).
162-
MemoryPoolHandle create_mempool_handle_ipc(int fd, CUmemAllocationHandleType handle_type) noexcept;
162+
MemoryPoolHandle create_mempool_handle_ipc(int fd, CUmemAllocationHandleType handle_type);
163163

164164
// ============================================================================
165165
// Device pointer handle functions
@@ -174,33 +174,33 @@ using DevicePtrHandle = std::shared_ptr<const CUdeviceptr>;
174174
DevicePtrHandle deviceptr_alloc_from_pool(
175175
size_t size,
176176
MemoryPoolHandle h_pool,
177-
StreamHandle h_stream) noexcept;
177+
StreamHandle h_stream);
178178

179179
// Allocate device memory asynchronously via cuMemAllocAsync.
180180
// When the last reference is released, cuMemFreeAsync is called on the stored stream.
181181
// Returns empty handle on error (caller must check).
182-
DevicePtrHandle deviceptr_alloc_async(size_t size, StreamHandle h_stream) noexcept;
182+
DevicePtrHandle deviceptr_alloc_async(size_t size, StreamHandle h_stream);
183183

184184
// Allocate device memory synchronously via cuMemAlloc.
185185
// When the last reference is released, cuMemFree is called.
186186
// Returns empty handle on error (caller must check).
187-
DevicePtrHandle deviceptr_alloc(size_t size) noexcept;
187+
DevicePtrHandle deviceptr_alloc(size_t size);
188188

189189
// Allocate pinned host memory via cuMemAllocHost.
190190
// When the last reference is released, cuMemFreeHost is called.
191191
// Returns empty handle on error (caller must check).
192-
DevicePtrHandle deviceptr_alloc_host(size_t size) noexcept;
192+
DevicePtrHandle deviceptr_alloc_host(size_t size);
193193

194194
// Create a non-owning device pointer handle (references existing pointer).
195195
// Use for foreign pointers (e.g., from external libraries).
196196
// The pointer will NOT be freed when the handle is released.
197-
DevicePtrHandle deviceptr_create_ref(CUdeviceptr ptr) noexcept;
197+
DevicePtrHandle deviceptr_create_ref(CUdeviceptr ptr);
198198

199199
// Create a non-owning device pointer handle that prevents a Python owner from being GC'd.
200200
// The owner's refcount is incremented; decremented when handle is released.
201201
// The pointer will NOT be freed when the handle is released.
202202
// If owner is nullptr, equivalent to deviceptr_create_ref.
203-
DevicePtrHandle deviceptr_create_with_owner(CUdeviceptr ptr, PyObject* owner) noexcept;
203+
DevicePtrHandle deviceptr_create_with_owner(CUdeviceptr ptr, PyObject* owner);
204204

205205
// Import a device pointer from IPC via cuMemPoolImportPointer.
206206
// When the last reference is released, cuMemFreeAsync is called on the stored stream.
@@ -209,7 +209,7 @@ DevicePtrHandle deviceptr_create_with_owner(CUdeviceptr ptr, PyObject* owner) no
209209
DevicePtrHandle deviceptr_import_ipc(
210210
MemoryPoolHandle h_pool,
211211
const void* export_data,
212-
StreamHandle h_stream) noexcept;
212+
StreamHandle h_stream);
213213

214214
// Access the deallocation stream for a device pointer handle (read-only).
215215
// For non-owning handles, the stream is not used but can still be accessed.

cuda_core/cuda/core/_resource_handles.pxd

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -56,41 +56,41 @@ cdef cydriver.CUresult peek_last_error() noexcept nogil
5656
cdef void clear_last_error() noexcept nogil
5757

5858
# Context handles
59-
cdef ContextHandle create_context_handle_ref(cydriver.CUcontext ctx) noexcept nogil
60-
cdef ContextHandle get_primary_context(int device_id) noexcept nogil
61-
cdef ContextHandle get_current_context() noexcept nogil
59+
cdef ContextHandle create_context_handle_ref(cydriver.CUcontext ctx) nogil except+
60+
cdef ContextHandle get_primary_context(int device_id) nogil except+
61+
cdef ContextHandle get_current_context() nogil except+
6262

6363
# Stream handles
6464
cdef StreamHandle create_stream_handle(
65-
ContextHandle h_ctx, unsigned int flags, int priority) noexcept nogil
66-
cdef StreamHandle create_stream_handle_ref(cydriver.CUstream stream) noexcept nogil
67-
cdef StreamHandle create_stream_handle_with_owner(cydriver.CUstream stream, object owner) noexcept nogil
68-
cdef StreamHandle get_legacy_stream() noexcept nogil
69-
cdef StreamHandle get_per_thread_stream() noexcept nogil
65+
ContextHandle h_ctx, unsigned int flags, int priority) nogil except+
66+
cdef StreamHandle create_stream_handle_ref(cydriver.CUstream stream) nogil except+
67+
cdef StreamHandle create_stream_handle_with_owner(cydriver.CUstream stream, object owner) except+
68+
cdef StreamHandle get_legacy_stream() nogil except+
69+
cdef StreamHandle get_per_thread_stream() nogil except+
7070

7171
# Event handles
72-
cdef EventHandle create_event_handle(ContextHandle h_ctx, unsigned int flags) noexcept nogil
73-
cdef EventHandle create_event_handle_noctx(unsigned int flags) noexcept nogil
72+
cdef EventHandle create_event_handle(ContextHandle h_ctx, unsigned int flags) nogil except+
73+
cdef EventHandle create_event_handle_noctx(unsigned int flags) nogil except+
7474
cdef EventHandle create_event_handle_ipc(
75-
const cydriver.CUipcEventHandle& ipc_handle) noexcept nogil
75+
const cydriver.CUipcEventHandle& ipc_handle) nogil except+
7676

7777
# Memory pool handles
7878
cdef MemoryPoolHandle create_mempool_handle(
79-
const cydriver.CUmemPoolProps& props) noexcept nogil
80-
cdef MemoryPoolHandle create_mempool_handle_ref(cydriver.CUmemoryPool pool) noexcept nogil
81-
cdef MemoryPoolHandle get_device_mempool(int device_id) noexcept nogil
79+
const cydriver.CUmemPoolProps& props) nogil except+
80+
cdef MemoryPoolHandle create_mempool_handle_ref(cydriver.CUmemoryPool pool) nogil except+
81+
cdef MemoryPoolHandle get_device_mempool(int device_id) nogil except+
8282
cdef MemoryPoolHandle create_mempool_handle_ipc(
83-
int fd, cydriver.CUmemAllocationHandleType handle_type) noexcept nogil
83+
int fd, cydriver.CUmemAllocationHandleType handle_type) nogil except+
8484

8585
# Device pointer handles
8686
cdef DevicePtrHandle deviceptr_alloc_from_pool(
87-
size_t size, MemoryPoolHandle h_pool, StreamHandle h_stream) noexcept nogil
88-
cdef DevicePtrHandle deviceptr_alloc_async(size_t size, StreamHandle h_stream) noexcept nogil
89-
cdef DevicePtrHandle deviceptr_alloc(size_t size) noexcept nogil
90-
cdef DevicePtrHandle deviceptr_alloc_host(size_t size) noexcept nogil
91-
cdef DevicePtrHandle deviceptr_create_ref(cydriver.CUdeviceptr ptr) noexcept nogil
92-
cdef DevicePtrHandle deviceptr_create_with_owner(cydriver.CUdeviceptr ptr, object owner) noexcept nogil
87+
size_t size, MemoryPoolHandle h_pool, StreamHandle h_stream) nogil except+
88+
cdef DevicePtrHandle deviceptr_alloc_async(size_t size, StreamHandle h_stream) nogil except+
89+
cdef DevicePtrHandle deviceptr_alloc(size_t size) nogil except+
90+
cdef DevicePtrHandle deviceptr_alloc_host(size_t size) nogil except+
91+
cdef DevicePtrHandle deviceptr_create_ref(cydriver.CUdeviceptr ptr) nogil except+
92+
cdef DevicePtrHandle deviceptr_create_with_owner(cydriver.CUdeviceptr ptr, object owner) except+
9393
cdef DevicePtrHandle deviceptr_import_ipc(
94-
MemoryPoolHandle h_pool, const void* export_data, StreamHandle h_stream) noexcept nogil
94+
MemoryPoolHandle h_pool, const void* export_data, StreamHandle h_stream) nogil except+
9595
cdef StreamHandle deallocation_stream(const DevicePtrHandle& h) noexcept nogil
9696
cdef void set_deallocation_stream(const DevicePtrHandle& h, StreamHandle h_stream) noexcept nogil

0 commit comments

Comments
 (0)