From 5638cbb2837d234419e2eae0c71f1d2ad1c2d486 Mon Sep 17 00:00:00 2001 From: Tom Deakin Date: Wed, 11 May 2016 17:49:48 +0100 Subject: [PATCH] Check for OpenMP support and build OMP3 version --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed048c5..4bcd688 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,8 +75,13 @@ endif () #------------------------------------------------------------------------------- # OpenMP 3.0 #------------------------------------------------------------------------------- - -# TODO +find_package(OpenMP QUIET) +if (${OpenMP_FOUND}) + add_executable(gpu-stream-omp3 main.cpp OMP3Stream.cpp) + target_compile_definitions(gpu-stream-omp3 PUBLIC OMP3) +else () + message("Skipping OpenMP 3...") +endif () #------------------------------------------------------------------------------- # OpenMP 4.5