Skip to content

Commit

Permalink
OpenCL POC 1
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Aug 8, 2018
1 parent a2a5669 commit 05be622
Show file tree
Hide file tree
Showing 4 changed files with 322 additions and 25 deletions.
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ MESSAGE(STATUS "QGIS version: ${COMPLETE_VERSION} ${RELEASE_NAME} (${QGIS_VERSIO


#############################################################
# Configure OpenCL if available

option(USE_OPENCL "Use OpenCL" ON)
if (USE_OPENCL)
FIND_PACKAGE(OpenCL)
if(${OpenCL_FOUND})
SET (USE_OPENCL TRUE CACHE BOOL "Use OpenCL")
IF(USE_OPENCL)
SET(HAVE_OPENCL TRUE)
ENDIF(USE_OPENCL)
endif(${OpenCL_FOUND})
endif(USE_OPENCL)

# Configure CCache if available
IF(NOT MSVC)
option(USE_CCACHE "Use ccache" ON)
Expand Down
2 changes: 2 additions & 0 deletions cmake_templates/qgsconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@

#cmakedefine HAVE_SERVER_PYTHON_PLUGINS

#cmakedefine HAVE_OPENCL

#cmakedefine ENABLE_MODELTEST

#cmakedefine HAVE_3D
Expand Down
12 changes: 12 additions & 0 deletions src/analysis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,15 @@ INCLUDE_DIRECTORIES(SYSTEM
${GEOS_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
${OpenCL_INCLUDE_DIRS}
)

IF(HAVE_OPENCL)
INCLUDE_DIRECTORIES(${OpenCL_LIBRARIES})
ENDIF(HAVE_OPENCL)



#############################################################
# qgis_analysis library

Expand Down Expand Up @@ -353,6 +360,11 @@ ENDIF (NOT ANDROID)

TARGET_LINK_LIBRARIES(qgis_analysis qgis_core)

IF(HAVE_OPENCL)
TARGET_LINK_LIBRARIES(qgis_analysis ${OpenCL_LIBRARIES})
ENDIF(HAVE_OPENCL)


# clang-tidy
IF(CLANG_TIDY_EXE)
SET_TARGET_PROPERTIES(
Expand Down
Loading

0 comments on commit 05be622

Please sign in to comment.