Commit 5172def
committed
Work around buggy OpenCL ICD loader
ocl-icd under 2.2.3 calls dlopen() in its library constructor
and accesses a thread local variable in the process. This causes
all subsequent access to any other thread local variables to
deadlock.
The bug is fixed in ocl-icd 2.2.4, which is not in stable releases
in Ubuntu or Debian. Thus this provides a workaround given buggy
ocl-icd.
To avoid access to thread local variable, errno, std::ostream
with unitbuf, and exception handling in libstdc++ cannot be used.
This commit checks ocl-icd version, and refactor the OpenCL
processor to not use exceptions. Then disable unitbuf on std::cerr
and disable all exceptions with -fno-exceptions (when available).
This commit and the ocl-icd bug do not affect Mac OS X or Windows.1 parent 0dbff0a commit 5172def
File tree
4 files changed
+185
-146
lines changed- examples/protonect
- src
- tinythread
4 files changed
+185
-146
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
169 | 176 | | |
170 | 177 | | |
171 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
100 | 106 | | |
101 | 107 | | |
102 | 108 | | |
| |||
0 commit comments