From 73402dbe2dd503c6ff1a56436df11a5aa81edb04 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 17 Jan 2019 13:35:00 +0100 Subject: [PATCH] allow other threads to run during device init() and make_context() since those calls can take hundreds of milliseconds --- src/cpp/cuda.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpp/cuda.hpp b/src/cpp/cuda.hpp index 1f49f9d9..da60bd57 100644 --- a/src/cpp/cuda.hpp +++ b/src/cpp/cuda.hpp @@ -497,7 +497,7 @@ namespace pycuda inline void init(unsigned int flags) { - CUDAPP_CALL_GUARDED(cuInit, (flags)); + CUDAPP_CALL_GUARDED_THREADED(cuInit, (flags)); } inline @@ -822,7 +822,7 @@ namespace pycuda context::prepare_context_switch(); CUcontext ctx; - CUDAPP_CALL_GUARDED(cuCtxCreate, (&ctx, flags, m_device)); + CUDAPP_CALL_GUARDED_THREADED(cuCtxCreate, (&ctx, flags, m_device)); boost::shared_ptr result(new context(ctx)); context_stack::get().push(result); return result; -- GitLab