nvicia/cuda-context: Don't modify the primary context

Doing so could potentially cause other CUDA implementations to suddenly fail.
This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2020-05-12 02:48:37 +02:00
parent a40db1258a
commit b91df3e11a
2 changed files with 2 additions and 4 deletions

View file

@ -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."); throw std::runtime_error("Failed to acquire primary device context.");
} }
_cuda->cuDevicePrimaryCtxSetFlags(_device, cu_context_flags::SCHEDULER_YIELD);
_has_device = true; _has_device = true;
} }
#endif #endif

View file

@ -27,8 +27,8 @@ namespace nvidia::cuda {
::nvidia::cuda::cu_context_t _ctx; ::nvidia::cuda::cu_context_t _ctx;
// Primary Device Context // Primary Device Context
bool _has_device; bool _has_device;
std::int32_t _device; ::nvidia::cuda::cu_device_t _device;
private: private:
context(std::shared_ptr<::nvidia::cuda::cuda> cuda); context(std::shared_ptr<::nvidia::cuda::cuda> cuda);