Skip to content

Commit c726d94

Browse files
authored
Error out when LIBOMPTARGET_OMPT_SUPPORT is requested but not supported
Currently a user could pass `-DLIBOMPTARGET_OMPT_SUPPORT=ON` but the build may ignore it There is already a check for `LIBOMP_OMPT_SUPPORT AND NOT LIBOMP_HAVE_OMPT_SUPPORT` causing an error so a) There should be a similar error on mismatch of passed options and supported configuration b) The check for `LIBOMP_HAVE_OMPT_SUPPORT` is redundant
1 parent 76274eb commit c726d94

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

offload/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,15 +326,17 @@ endmacro()
326326

327327
# OMPT support for libomptarget
328328
# Follow host OMPT support and check if host support has been requested.
329-
# LIBOMP_HAVE_OMPT_SUPPORT indicates whether host OMPT support has been implemented.
330329
# LIBOMP_OMPT_SUPPORT indicates whether host OMPT support has been requested (default is ON).
331-
# LIBOMPTARGET_OMPT_SUPPORT indicates whether target OMPT support has been requested (default is ON).
332330
set(OMPT_TARGET_DEFAULT FALSE)
333-
if ((LIBOMP_HAVE_OMPT_SUPPORT) AND (LIBOMP_OMPT_SUPPORT) AND (NOT WIN32))
331+
if (LIBOMP_OMPT_SUPPORT AND (NOT WIN32))
334332
set (OMPT_TARGET_DEFAULT TRUE)
335333
endif()
334+
# LIBOMPTARGET_OMPT_SUPPORT indicates whether target OMPT support has been requested.
336335
set(LIBOMPTARGET_OMPT_SUPPORT ${OMPT_TARGET_DEFAULT} CACHE BOOL "OMPT-target-support?")
337-
if ((OMPT_TARGET_DEFAULT) AND (LIBOMPTARGET_OMPT_SUPPORT))
336+
if (LIBOMPTARGET_OMPT_SUPPORT)
337+
if(NOT LIBOMP_OMPT_SUPPORT)
338+
message(FATAL_ERROR "OMPT Target support requested but OMPT (host) support is not enabled")
339+
endif()
338340
add_definitions(-DOMPT_SUPPORT=1)
339341
message(STATUS "OMPT target enabled")
340342
else()

0 commit comments

Comments
 (0)