Skip to content

Commit 99c5089

Browse files
committed
Small changes to allow the names of the variables needed by OMPD to be listed.
Small changes to allow the names of the set of variables that the OMPD may need to satisfy requests from the debugger. The file generated by the changes to the CMakefile is not generated by default, and is not built into the runtime. So there should be absolutely no performance impact at all. What it does do is provide a convenient way to expand out the names that the debugger will eventually be asked about. Changes to be committed: modified: runtime/src/CMakeLists.txt new file: runtime/src/ompd-symbols.c.in
1 parent 0091c9e commit 99c5089

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

runtime/src/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,24 @@ if(${LIBOMP_FORTRAN_MODULES})
261261
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES omp_lib${CMAKE_C_OUTPUT_EXTENSION})
262262
endif()
263263

264+
# generate a C file containing the names of the variables that encode
265+
# size and offset information for OMPD.
266+
# This is not built into the runtime, but can be generated by invoking
267+
# "gmake ompd-symbols". This will create a .c file in the build area,
268+
# which be examined as needed.
269+
libomp_get_cflags(OMPD_SYMBOLS_CFLAGS)
270+
get_property(ompd_symbols_inc_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
271+
message("OMPD_SYMBOLS_INC_DIRS == ${ompd_symbols_inc_dirs}")
272+
foreach(d ${ompd_symbols_inc_dirs})
273+
set(OMPD_SYMBOLS_CFLAGS "${OMPD_SYMBOLS_CFLAGS} -I${d}")
274+
endforeach()
275+
SEPARATE_ARGUMENTS(OMPD_SYMBOLS_CFLAGS)
276+
add_custom_target(
277+
ompd-symbols
278+
DEPENDS ${LIBOMP_SRC_DIR}/ompd-symbols.c.in
279+
COMMAND ${CMAKE_C_COMPILER} -C -E -x c ${OMPD_SYMBOLS_CFLAGS} ${LIBOMP_SRC_DIR}/ompd-symbols.c.in | ${PERL_EXECUTABLE} -p -e "'s@___NEWLINE___@\\n@g'" > ${CMAKE_CURRENT_BINARY_DIR}/ompd-symbols.c
280+
)
281+
264282
# Move files to exports/ directory if requested
265283
if(${LIBOMP_COPY_EXPORTS})
266284
include(LibompExports)

runtime/src/ompd-symbols.c.in

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
#include "ompd-specific.h"
3+
4+
5+
#if OMPD_SUPPORT
6+
7+
const char *ompd_symbols [] = {
8+
9+
/* OMPD_FOREACH_ACCESS: ompd_access__##t##__##m, */
10+
# define ompd_define_symbol_string(t,m) "ompd_access__" #t "__" #m ,___NEWLINE___
11+
OMPD_FOREACH_ACCESS(ompd_define_symbol_string)
12+
# undef ompd_define_symbol_string
13+
14+
/* OMPD_FOREACH_ACCESS: ompd_sizeof__##t##__##m, */
15+
# define ompd_define_symbol_string(t,m) "ompd_sizeof__" #t "__" #m,___NEWLINE___
16+
OMPD_FOREACH_ACCESS(ompd_define_symbol_string)
17+
# undef ompd_define_symbol_string
18+
19+
/* OMPD_FOREACH_BITFIELD: ompd_bitfield__##t##__##m, */
20+
# define ompd_define_symbol_string(t,m) "ompd_bitfield__" #t "__" #m,___NEWLINE___
21+
OMPD_FOREACH_BITFIELD(ompd_define_symbol_string)
22+
# undef ompd_define_symbol_string
23+
24+
/* OMPD_FOREACH_SIZEOF: ompd_sizeof__##t, */
25+
# define ompd_define_symbol_string(t) "ompd_sizeof__" #t,___NEWLINE___
26+
OMPD_FOREACH_SIZEOF(ompd_define_symbol_string)
27+
# undef ompd_define_symbol_string
28+
29+
0
30+
}; /* ompd_symbols */
31+
32+
#endif
33+

0 commit comments

Comments
 (0)