[Openmp-commits] [openmp] [OpenMP] Add ompTest library to OpenMP (PR #147381)
via Openmp-commits
openmp-commits at lists.llvm.org
Thu Jul 17 08:11:24 PDT 2025
Michael =?utf-8?q?Halkenhäuser?= <michaelhalk at web.de>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/147381 at github.com>
================
@@ -0,0 +1,116 @@
+##===----------------------------------------------------------------------===##
+#
+# Build OMPT unit testing library: ompTest
+#
+##===----------------------------------------------------------------------===##
+
+cmake_minimum_required(VERSION 3.22)
+project(omptest LANGUAGES CXX)
+
+option(LIBOMPTEST_BUILD_STANDALONE
+ "Build ompTest 'standalone', i.e. w/o GoogleTest." OFF)
+option(LIBOMPTEST_BUILD_UNITTESTS
+ "Build ompTest's unit tests , requires GoogleTest." OFF)
+
+# In absence of corresponding OMPT support: exit early
+if(NOT ${LIBOMPTARGET_OMPT_SUPPORT})
----------------
jprotze wrote:
My idea was, that we should be able to write tests which describe the expected callback sequence. Some callbacks are "optional" and will not be triggered with cmake option `LIBOMP_OMPT_OPTIONAL=off`.
I think it makes sense to allow the test to specify the necessary/optional callbacks (as another assert statement). As a sane default, it probably makes sense to use the mandatory/optional from the standard.
But, if we want to run some target tests also with `OMP_OFFLOAD=disabled`, the target callbacks should probably be optional (while I'm actually not sure what `set_callback` reports in this case. Or when compiling without -fopenmp-target?).
https://github.com/llvm/llvm-project/pull/147381
More information about the Openmp-commits
mailing list