From 40452e72d9054e5c449e3c4fe310a9a15849d564 Mon Sep 17 00:00:00 2001 From: Zhen Wang Date: Thu, 20 Jun 2019 17:04:37 +0800 Subject: [PATCH] add the clhpp dependency. --- cmake/external/opencl-clhpp.cmake | 5 ----- cmake/external/opencl-headers.cmake | 2 +- paddle/fluid/lite/opencl/CMakeLists.txt | 5 +++-- paddle/fluid/lite/opencl/cl_tool.h | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/cmake/external/opencl-clhpp.cmake b/cmake/external/opencl-clhpp.cmake index fa00be9d1a3..0d10e09da4f 100644 --- a/cmake/external/opencl-clhpp.cmake +++ b/cmake/external/opencl-clhpp.cmake @@ -29,11 +29,6 @@ ExternalProject_Add( -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=${OPENCL_CLHPP_INSTALL_DIR} - ${OPTIONAL_ARGS} - ${EXTERNAL_OPTIONAL_ARGS} - CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${GTEST_INSTALL_DIR} - -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON - -DCMAKE_BUILD_TYPE:STRING=${THIRD_PARTY_BUILD_TYPE} ) ADD_DEPENDENCIES(opencl_clhpp opencl_headers) diff --git a/cmake/external/opencl-headers.cmake b/cmake/external/opencl-headers.cmake index 70e40e6d480..68c9c5251cf 100644 --- a/cmake/external/opencl-headers.cmake +++ b/cmake/external/opencl-headers.cmake @@ -15,7 +15,7 @@ INCLUDE(ExternalProject) SET(OPENCL_HEADERS_SRCS_DIR ${THIRD_PARTY_PATH}/opencl-headers) -SET(OPENCL_HEADERS_INCLUDE_DIR "${OPENCL_HEADERS_SRCS_DIR}/src/opencl_headers/opencl20" CACHE PATH "opencl-headers include directory." FORCE) +SET(OPENCL_HEADERS_INCLUDE_DIR "${OPENCL_HEADERS_SRCS_DIR}/src/opencl_headers" CACHE PATH "opencl-headers include directory." FORCE) INCLUDE_DIRECTORIES(${OPENCL_HEADERS_INCLUDE_DIR}) diff --git a/paddle/fluid/lite/opencl/CMakeLists.txt b/paddle/fluid/lite/opencl/CMakeLists.txt index 239f55f137d..740d51128d5 100644 --- a/paddle/fluid/lite/opencl/CMakeLists.txt +++ b/paddle/fluid/lite/opencl/CMakeLists.txt @@ -6,7 +6,7 @@ find_library(opencl-lib NAMES OpenCL) message(STATUS "The OpenCL library path : ${opencl-lib}") -add_compile_options(-fno-strict-aliasing) +add_compile_options(-fno-strict-aliasing -Wno-ignored-qualifiers) cc_library(cl_tool SRCS cl_tool.cc) cc_library(cl_half SRCS cl_half.cc) @@ -14,6 +14,7 @@ cc_library(cl_engine SRCS cl_engine.cc DEPS cl_tool) cc_library(cl_context SRCS cl_context.cc DEPS cl_engine) cc_library(cl_helper SRCS cl_helper.cc DEPS cl_context) cc_library(cl_image_converter SRCS cl_image_converter.cc DEPS cl_half lite_tensor) -cc_library(cl_image SRCS cl_image.cc DEPS cl_half lite_tensor cl_image_converter) +cc_library(cl_image SRCS cl_image.cc DEPS cl_half lite_tensor cl_image_converter cl_engine) cc_test(test_cl_runtime SRCS cl_test.cc DEPS cl_engine cl_context) target_link_libraries(test_cl_runtime ${opencl-lib}) +add_dependencies(cl_tool opencl_clhpp) diff --git a/paddle/fluid/lite/opencl/cl_tool.h b/paddle/fluid/lite/opencl/cl_tool.h index efc9f570c2c..3fdc6287cad 100644 --- a/paddle/fluid/lite/opencl/cl_tool.h +++ b/paddle/fluid/lite/opencl/cl_tool.h @@ -14,7 +14,7 @@ limitations under the License. */ #pragma once -#include +#include "paddle/fluid/lite/opencl/cl2_header.h" namespace paddle { namespace lite { -- GitLab