Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 5785c99

Browse files
committed
Remove the flags check for logging in two places
1 parent c315745 commit 5785c99

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

src/autotuner/genetic_tuning_harness.cc

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,11 @@ void GeneticTunerHarness::doCompile(ExecutorType& engine) {
326326
pConf->optionalCompilationHandle =
327327
std::unique_ptr<size_t>(new size_t(handle));
328328
} catch (const std::exception& e) {
329-
if (FLAGS_debug_tuner) {
330-
LOG(WARNING) << "[TUNER][COMPILE] failed compilation: " << e.what();
331-
std::stringstream ssWarning;
332-
MappingOptionsCppPrinter warningPrinter(ssWarning);
333-
warningPrinter << options;
334-
LOG_LINE_BY_LINE(WARNING, ssWarning);
335-
}
329+
LOG(WARNING) << "[TUNER][COMPILE] failed compilation: " << e.what();
330+
std::stringstream ssWarning;
331+
MappingOptionsCppPrinter warningPrinter(ssWarning);
332+
warningPrinter << options;
333+
LOG_LINE_BY_LINE(WARNING, ssWarning);
336334
pConf->invalid = true;
337335
}
338336
CHECK(pConf->invalid || pConf->optionalCompilationHandle)
@@ -413,14 +411,12 @@ void GeneticTunerHarness::doGpuWork(
413411
engine.clear(handle);
414412
}
415413
} catch (std::exception& e) {
416-
if (FLAGS_debug_tuner) {
417-
LOG(WARNING) << "Runtime error gpu " << gpu << ": " << e.what();
418-
std::stringstream ssWarning;
419-
MappingOptionsCppPrinter warningPrinter(ssWarning);
420-
warningPrinter << options;
421-
LOG(WARNING) << "Aborted execution on gpu " << gpu;
422-
LOG_LINE_BY_LINE(WARNING, ssWarning);
423-
}
414+
LOG(WARNING) << "Runtime error gpu " << gpu << ": " << e.what();
415+
std::stringstream ssWarning;
416+
MappingOptionsCppPrinter warningPrinter(ssWarning);
417+
warningPrinter << options;
418+
LOG(WARNING) << "Aborted execution on gpu " << gpu;
419+
LOG_LINE_BY_LINE(WARNING, ssWarning);
424420
while (cudaGetLastError() != cudaSuccess) {
425421
// In case of errors in the generated, we cannot rely on deviceReset to
426422
// set the GPU in a clean state. So instead we just pop and discard all

src/core/cuda/cuda_tc_executor.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,7 @@ void CudaTcExecutor::compileWithTcMapper() {
174174
// that.
175175
std::tie(cudaSource, grid, block) =
176176
mappedScop->codegen(kernelSpecializedName);
177-
if (FLAGS_dump_cuda) {
178-
std::cout << "generatedCuda: " << cudaSource << std::endl;
179-
}
177+
LOG_IF(INFO, FLAGS_dump_cuda) << "generatedCuda: " << cudaSource;
180178
}
181179

182180
Duration CudaTcExecutor::run(

0 commit comments

Comments
 (0)