From ef283d219c1b23525c472d85b1d4087490bf77a1 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Tue, 12 May 2020 02:48:37 +0200 Subject: [PATCH] nvicia/cuda-context: Don't modify the primary context Doing so could potentially cause other CUDA implementations to suddenly fail. --- source/nvidia/cuda/nvidia-cuda-context.cpp | 2 -- source/nvidia/cuda/nvidia-cuda-context.hpp | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/source/nvidia/cuda/nvidia-cuda-context.cpp b/source/nvidia/cuda/nvidia-cuda-context.cpp index a4621d7f..9d47e369 100644 --- a/source/nvidia/cuda/nvidia-cuda-context.cpp +++ b/source/nvidia/cuda/nvidia-cuda-context.cpp @@ -71,8 +71,6 @@ nvidia::cuda::context::context(std::shared_ptr<::nvidia::cuda::cuda> cuda, ID3D1 throw std::runtime_error("Failed to acquire primary device context."); } - _cuda->cuDevicePrimaryCtxSetFlags(_device, cu_context_flags::SCHEDULER_YIELD); - _has_device = true; } #endif diff --git a/source/nvidia/cuda/nvidia-cuda-context.hpp b/source/nvidia/cuda/nvidia-cuda-context.hpp index 3cabc9a7..94916146 100644 --- a/source/nvidia/cuda/nvidia-cuda-context.hpp +++ b/source/nvidia/cuda/nvidia-cuda-context.hpp @@ -27,8 +27,8 @@ namespace nvidia::cuda { ::nvidia::cuda::cu_context_t _ctx; // Primary Device Context - bool _has_device; - std::int32_t _device; + bool _has_device; + ::nvidia::cuda::cu_device_t _device; private: context(std::shared_ptr<::nvidia::cuda::cuda> cuda);