# OpenCL
OpenCL is a cross-platform interface to compute devices.
# 1 Implementations
# 1.1 PoCL
PoCL is an implementation of OpenCL for CPU devices based on LLVM.
# 1.2 Clover
Clover is Mesa’s original OpenCL implementation based on LLVM.
# 1.3 rusticl
Mesa rusticl is an implementation of OpenCL for GPU devices based on LLVM.
AND RX 580 needs environment variable RUSTICL_ENABLE=radeonsi.
Support for double precision is “experimental”,
enable it by setting the environment variable RUSTICL_FEATURES=fp64.
# 1.4 PoCL vs Clover vs rusticl
Unfortunately (at least on Debian Trixie), using both PoCL and Clover or rusticl at the same time causes crashes, possibly because both are based on LLVM and LLVM’s internal state gets confused. Might be exacerbated if different LLVM versions are used.
Make sure only one of pocl.icd and rusticl.icd
is present in /etc/OpenCL/vendors
(you can rename pocl.icd to pocl.icd.disabled, for example).
# 2 Benchmarks
# 2.1 Fraktaler-3
Using fraktaler-3 wisdom benchmark:
| machine | backend | float | double | floatexp | doubleexp | softfloat | long double | float128 | notes |
|---|---|---|---|---|---|---|---|---|---|
| eiskaffee | CPU | 18.99 | 18.90 | 13.05 | 12.80 | 12.91 | 16.57 | 12.78 | long double is x87 |
| “ | Clover | 22.37 | 21.19 | 17.90 | 16.83 | 17.48 | - | - | |
| “ | rusticl | 20.30 | 19.84 | 18.37 | 15.21 | 15.53 | - | - | |
| decaf | CPU | 19.58 | 19.83 | 12.99 | 13.06 | 13.32 | 16.69 | 14.15 | long double is x87 |
| “ | PoCL | 19.25 | 19.62 | 14.84 | 14.63 | 15.06 | - | - | |
| “ | rusticl | 20.66 | 19.56 | 18.75 | 17.05 | - | - | - | |
| tallat | CPU | 11.51 | 11.46 | 5.52 | 5.33 | 5.88 | 9.51 | 5.71 | long double is x87 |
| “ | PoCL | 10.60 | 10.90 | 7.48 | 7.47 | 7.22 | - | - | |
| phone cat | CPU | 16.40 | 16.22 | 10.72 | 10.75 | 11.41 | 10.15 | - | long double is float128 |
| phone uk | CPU | 10.76 | 10.73 | 7.45 | 7.27 | 7.87 | 10.84 | - | long double is double |
Higher is better, increase of 1 unit means 2 times faster.