From e3eedacbcce5f3e102027a84708ec85fc1cd3a87 Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Thu, 28 Jun 2018 20:35:18 +0900 Subject: Disabled calls to clReleaseProgram under Windows to avoid segfaults when the OpenCL driver unloads first --- CHANGELOG | 3 +++ src/clpp11.hpp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 23052c83..f31babbe 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,7 @@ +Development (next version) +- Fixed an access violation under Windows upon releasing the OpenCL program when the driver is already unloaded + Version 1.4.0 - Added Python interface to CLBlast 'PyCLBlast' - Added CLBlast to Ubuntu PPA and macOS Homebrew package managers diff --git a/src/clpp11.hpp b/src/clpp11.hpp index ce6f39cb..8d6a1127 100644 --- a/src/clpp11.hpp +++ b/src/clpp11.hpp @@ -463,7 +463,9 @@ class Program { // Clean-up ~Program() { - if (program_) { CheckErrorDtor(clReleaseProgram(program_)); } + #ifndef _MSC_VER // causes an access violation under Windows when the driver is already unloaded + if (program_) { CheckErrorDtor(clReleaseProgram(program_)); } + #endif } // Compiles the device program and checks whether or not there are any warnings/errors -- cgit v1.2.3