Skip to content

Commit d4c32f7

Browse files
committedMar 7, 2025
Remove OpenCL warper
- Even when OpenCL was detected at build time, this has been disabled at runtime by default due to multiple issues - Performance improvements weren't that big compared to multithreaded CPU - Wasn't functionaly on par with CPU version - Nobody cared enough about it to maintain it - Big users of GDAL (remote sensing companies) don't care that much about GPU uage of GDAL.
1 parent fd803f4 commit d4c32f7

10 files changed

+1
-3673
lines changed
 

‎.github/workflows/cmake_builds.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
libpoppler-dev libpoppler-private-dev gpsbabel libhdf4-alt-dev libhdf5-serial-dev libpodofo-dev poppler-utils \
5656
libfreexl-dev unixodbc-dev libwebp-dev liblcms2-2 libcrypto++-dev libkml-dev \
5757
libmysqlclient-dev libarmadillo-dev wget libfyba-dev libjsoncpp-dev libexpat1-dev \
58-
libclc-dev ocl-icd-opencl-dev libsqlite3-dev sqlite3-pcre libpcre3-dev libspatialite-dev libsfcgal-dev fossil libcairo2-dev libjson-c-dev libdeflate-dev liblz4-dev libblosc-dev libarchive-dev \
58+
libsqlite3-dev sqlite3-pcre libpcre3-dev libspatialite-dev libsfcgal-dev fossil libcairo2-dev libjson-c-dev libdeflate-dev liblz4-dev libblosc-dev libarchive-dev \
5959
libqhull-dev libcfitsio-dev libopenjp2-7-dev libheif-dev \
6060
python3-dev libpython3-dev libpython3.10-dev python3.10-dev python3-numpy python3-lxml python3-pyflakes python3-setuptools python3-pip python3-venv \
6161
python3-pytest swig doxygen texlive-latex-base make cppcheck ccache g++ \

‎.github/workflows/ubuntu_20.04/Dockerfile.ci

-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ RUN apt-get update -y \
7474
make \
7575
mono-mcs \
7676
numactl \
77-
ocl-icd-opencl-dev \
78-
opencl-c-headers \
7977
openjdk-8-jdk-headless \
8078
pkg-config \
8179
python3-dev \

‎alg/CMakeLists.txt

-6
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,6 @@ if (GDAL_USE_ARMADILLO)
8282
gdal_target_link_libraries(alg PRIVATE ${ARMADILLO_LIBRARIES})
8383
endif ()
8484

85-
if (GDAL_USE_OPENCL)
86-
gdal_target_link_libraries(alg PRIVATE OpenCL::OpenCL)
87-
target_compile_definitions(alg PRIVATE -DHAVE_OPENCL)
88-
target_sources(alg PRIVATE gdalwarpkernel_opencl.h gdalwarpkernel_opencl.cpp)
89-
endif ()
90-
9185
gdal_target_link_libraries(alg PRIVATE PROJ::proj)
9286

9387
if (GDAL_USE_QHULL_INTERNAL)

‎alg/gdalwarpkernel.cpp

-450
Large diffs are not rendered by default.

‎alg/gdalwarpkernel_opencl.cpp

-2,993
This file was deleted.

‎alg/gdalwarpkernel_opencl.h

-187
This file was deleted.

‎cmake/helpers/CheckDependentLibraries.cmake

-1
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@ gdal_check_package(NetCDF "Enable netCDF driver" CAN_DISABLE
409409
NAMES netCDF
410410
TARGETS netCDF::netcdf NETCDF::netCDF
411411
VERSION "4.7")
412-
gdal_check_package(OpenCL "Enable OpenCL (may be used for warping)" CAN_DISABLE)
413412

414413
set(PostgreSQL_ADDITIONAL_VERSIONS "14" CACHE STRING "Additional PostgreSQL versions to check")
415414
gdal_check_package(PostgreSQL "" CAN_DISABLE)

‎cmake/template/gdal_def.h.in

-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
/* Define if gdal use geos*/
2222
#cmakedefine GDAL_USE_GEOS
2323

24-
/* Define if gdal use opencl*/
25-
#cmakedefine GDAL_USE_OPENCL
26-
2724
/* Define if gdal use armadillo*/
2825
#cmakedefine GDAL_USE_ARMADILLO
2926

‎doc/source/development/building_from_source.rst

-26
Original file line numberDiff line numberDiff line change
@@ -1516,32 +1516,6 @@ driver. If not found, an internal copy can be used.
15161516
to ON, has precedence over GDAL_USE_OPENCAD=ON
15171517

15181518

1519-
1520-
OpenCL
1521-
******
1522-
1523-
The OpenCL library may be used to accelerate warping computations, typically
1524-
with a GPU.
1525-
1526-
.. note:: (GDAL 3.5 and 3.6) It is disabled by default even when detected, since the current OpenCL
1527-
warping implementation lags behind the generic implementation.
1528-
Starting with GDAL 3.7, build support is enabled by default when OpenCL is detected,
1529-
but it is disabled by default at runtime. The warping option USE_OPENCL
1530-
or the configuration option GDAL_USE_OPENCL must be set to YES to enable it.
1531-
1532-
.. option:: OpenCL_INCLUDE_DIR
1533-
1534-
Path to an include directory with the ``CL/cl.h`` header file.
1535-
1536-
.. option:: OpenCL_LIBRARY
1537-
1538-
Path to a shared or static library file.
1539-
1540-
.. option:: GDAL_USE_OPENCL=ON/OFF
1541-
1542-
Control whether to use OPENCL. Defaults to *OFF* when OPENCL is found.
1543-
1544-
15451519
OpenEXR
15461520
*******
15471521

‎port/cpl_known_config_options.h

-4
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ constexpr static const char* const apszKnownConfigOptions[] =
5656
"BAG_GEOREF_MD_BLOCKYSIZE", // from bagdataset.cpp
5757
"BASISU_MAX_FILE_SIZE", // from basisudataset.cpp
5858
"BIGTIFF_OVERVIEW", // from gt_overview.cpp
59-
"BLACKLISTED_OPENCL_VENDOR", // from gdalwarpkernel_opencl.cpp
6059
"BLOCKXSIZE", // from netcdfdataset.cpp
6160
"BLOCKYSIZE", // from netcdfdataset.cpp
6261
"BSB_DISABLE_INDEX", // from bsb_read.c
@@ -390,7 +389,6 @@ constexpr static const char* const apszKnownConfigOptions[] =
390389
"GDAL_USE_AVX", // from gdalgrid.cpp
391390
"GDAL_USE_GEOJP2", // from gdaljp2metadata.cpp
392391
"GDAL_USE_GMLJP2", // from gdaljp2metadata.cpp
393-
"GDAL_USE_OPENCL", // from gdalwarpkernel.cpp
394392
"GDAL_USE_SSE", // from gdalgrid.cpp
395393
"GDAL_USE_SSSE3", // from cpl_cpu_features.cpp
396394
"GDAL_VALIDATE_CREATION_OPTIONS", // from gdaldataset.cpp, gdaldriver.cpp
@@ -831,7 +829,6 @@ constexpr static const char* const apszKnownConfigOptions[] =
831829
"OGR_XLS_HEADERS", // from ogrxlslayer.cpp
832830
"OGR_XLSX_FIELD_TYPES", // from ogrxlsxdatasource.cpp
833831
"OGR_XLSX_HEADERS", // from ogrxlsxdatasource.cpp
834-
"OPENCL_USE_CPU", // from gdalwarpkernel_opencl.cpp
835832
"OPENFILEGDB_CREATE_FIELD_BEFORE_GEOMETRY", // from ogropenfilegdblayer_write.cpp
836833
"OPENFILEGDB_CREATOR", // from filegdbtable_write.cpp
837834
"OPENFILEGDB_DEFAULT_STRING_WIDTH", // from ogropenfilegdblayer_write.cpp
@@ -946,7 +943,6 @@ constexpr static const char* const apszKnownConfigOptions[] =
946943
"PR_RESOLUTION_STRATEGY", // from postgisrasterdataset.cpp
947944
"PR_WE_RES", // from postgisrasterdataset.cpp
948945
"PREDICTOR_OVERVIEW", // from gt_overview.cpp
949-
"PREFERRED_OPENCL_VENDOR", // from gdalwarpkernel_opencl.cpp
950946
"PROJ_DATA", // from ogr_proj_p.cpp
951947
"PROJ_LIB", // from ogr_proj_p.cpp
952948
"PST_INSTANCE", // from jpipkakdataset.cpp

0 commit comments

Comments
 (0)
Please sign in to comment.