Skip to content

Commit 204f3be

Browse files
authored
Merge pull request #1844 from CEED/jeremy/debug-defines
debug - show JiT defines
2 parents 597fda5 + bdcc272 commit 204f3be

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

backends/cuda/ceed-cuda-compile.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@ static int CeedCompileCore_Cuda(Ceed ceed, const char *source, const bool throw_
122122
CeedDebug256(ceed, CEED_DEBUG_COLOR_ERROR, "---------- ATTEMPTING TO COMPILE JIT SOURCE ----------\n");
123123
CeedDebug(ceed, "Source:\n%s\n", code.str().c_str());
124124
CeedDebug256(ceed, CEED_DEBUG_COLOR_ERROR, "---------- END OF JIT SOURCE ----------\n");
125+
if (CeedDebugFlag(ceed)) {
126+
// LCOV_EXCL_START
127+
CeedDebug256(ceed, CEED_DEBUG_COLOR_ERROR, "---------- JiT COMPILER OPTIONS ----------\n");
128+
for (CeedInt i = 0; i < num_opts + num_jit_source_dirs + num_jit_defines; i++) {
129+
CeedDebug(ceed, "Option %d: %s", i, opts[i]);
130+
}
131+
CeedDebug(ceed, "");
132+
CeedDebug256(ceed, CEED_DEBUG_COLOR_ERROR, "---------- END OF JiT COMPILER OPTIONS ----------\n");
133+
// LCOV_EXCL_STOP
134+
}
125135
nvrtcResult result = nvrtcCompileProgram(prog, num_opts + num_jit_source_dirs + num_jit_defines, opts);
126136

127137
for (CeedInt i = 0; i < num_jit_source_dirs; i++) {

backends/hip/ceed-hip-compile.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,16 @@ static int CeedCompileCore_Hip(Ceed ceed, const char *source, const bool throw_e
124124
CeedDebug256(ceed, CEED_DEBUG_COLOR_ERROR, "---------- ATTEMPTING TO COMPILE JIT SOURCE ----------\n");
125125
CeedDebug(ceed, "Source:\n%s\n", code.str().c_str());
126126
CeedDebug256(ceed, CEED_DEBUG_COLOR_ERROR, "---------- END OF JIT SOURCE ----------\n");
127+
if (CeedDebugFlag(ceed)) {
128+
// LCOV_EXCL_START
129+
CeedDebug256(ceed, CEED_DEBUG_COLOR_ERROR, "---------- JiT COMPILER OPTIONS ----------\n");
130+
for (CeedInt i = 0; i < num_opts + num_jit_source_dirs + num_jit_defines; i++) {
131+
CeedDebug(ceed, "Option %d: %s", i, opts[i]);
132+
}
133+
CeedDebug(ceed, "");
134+
CeedDebug256(ceed, CEED_DEBUG_COLOR_ERROR, "---------- END OF JiT COMPILER OPTIONS ----------\n");
135+
// LCOV_EXCL_STOP
136+
}
127137
hiprtcResult result = hiprtcCompileProgram(prog, num_opts + num_jit_source_dirs + num_jit_defines, opts);
128138

129139
for (CeedInt i = 0; i < num_jit_source_dirs; i++) {

0 commit comments

Comments
 (0)