From 19f22b468bc8cb1c0157da65f94ff819c5af8ace Mon Sep 17 00:00:00 2001 From: kpyzhov Date: Wed, 16 Oct 2019 01:21:28 -0400 Subject: [PATCH] [hipcc] Temporary add -D_OPENMP to clang options to workaround cmake issue (#1540) * Temporary add -D_OPENMP to clang options in hipcc to allow using CMake OpenMP detection with hip-clang (until updated CMake version is available). [ROCm/clr commit: 9773f94c7191b43fb45855cc0cd1050895a3655c] --- projects/clr/hipamd/bin/hipcc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/projects/clr/hipamd/bin/hipcc b/projects/clr/hipamd/bin/hipcc index 35fbb54397..0f97bf0e21 100755 --- a/projects/clr/hipamd/bin/hipcc +++ b/projects/clr/hipamd/bin/hipcc @@ -526,6 +526,13 @@ foreach $arg (@ARGV) $optArg = $arg; } + ## This is a temporary workaround for CMake detection of OpenMP support. + ## It should be removed when the OpenMP detection c++ test in CMake is updated + ## and corrected CMake version is available. + if((defined $HIP_COMPILER) and ($HIP_COMPILER eq "clang") and ($arg eq '-fopenmp')) { + $HIPCXXFLAGS .= " -D_OPENMP " + } + ## process linker response file for hip-clang ## extract object files from static library and pass them directly to ## hip-clang in command line.