changed: probe for cl/opencl.hpp and use if found

this to avoid a spam of warnings
This commit is contained in:
Arne Morten Kvarving 2021-11-01 13:45:21 +01:00
parent 903b5462aa
commit 7de50b94c7
6 changed files with 12 additions and 1 deletions

View File

@ -202,6 +202,10 @@ if(OpenCL_FOUND)
if(CL2_HPP)
set(HAVE_OPENCL 1)
include_directories(${OpenCL_INCLUDE_DIRS})
find_file(OPENCL_HPP CL/opencl.hpp HINTS ${OpenCL_INCLUDE_DIRS})
if(OPENCL_HPP)
set(HAVE_OPENCL_HPP 1)
endif()
else()
message(WARNING " OpenCL was found, but this version of opm-simulators relies on CL/cl2.hpp, which implements OpenCL 1.0, 1.1 and 1.2.\n Deactivating OpenCL")
set(OpenCL_FOUND OFF)

View File

@ -7,6 +7,7 @@ set (opm-simulators_CONFIG_VAR
HAVE_PETSC
HAVE_CUDA
HAVE_OPENCL
HAVE_OPENCL_HPP
HAVE_FPGA
HAVE_AMGCL
HAVE_VEXCL

View File

@ -17,7 +17,7 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <dune/common/timer.hh>

View File

@ -17,6 +17,7 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <opm/simulators/linalg/bda/opencl.hpp>
#include <string>

View File

@ -25,7 +25,11 @@
#define CL_HPP_TARGET_OPENCL_VERSION 120 // indicate OpenCL 1.2 is used
#define CL_HPP_MINIMUM_VERSION 120
#define CL_HPP_MINIMUM_OPENCL_VERSION 120
#if HAVE_OPENCL_HPP
#include <CL/opencl.hpp>
#else
#include <CL/cl2.hpp> // supports up to OpenCL 1.2
#endif
#include <string>

View File

@ -17,6 +17,7 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <opm/simulators/linalg/bda/openclKernels.hpp>
namespace bda