|
19 | 19 |
|
20 | 20 | package org.apache.sysds.hops.codegen; |
21 | 21 |
|
| 22 | +import java.io.File; |
| 23 | +import java.io.IOException; |
| 24 | +import java.util.ArrayList; |
| 25 | +import java.util.Arrays; |
| 26 | +import java.util.Collections; |
| 27 | +import java.util.Enumeration; |
| 28 | +import java.util.HashMap; |
| 29 | +import java.util.HashSet; |
| 30 | +import java.util.Iterator; |
| 31 | +import java.util.LinkedHashMap; |
| 32 | +import java.util.Map.Entry; |
| 33 | +import java.util.jar.JarEntry; |
| 34 | +import java.util.jar.JarFile; |
| 35 | + |
22 | 36 | import org.apache.commons.io.FileUtils; |
23 | 37 | import org.apache.commons.io.IOUtils; |
24 | 38 | import org.apache.commons.lang3.SystemUtils; |
25 | | -import org.apache.commons.logging.Log; |
26 | | -import org.apache.commons.logging.LogFactory; |
27 | 39 | import org.apache.sysds.api.DMLScript; |
28 | 40 | import org.apache.sysds.common.Types.AggOp; |
29 | 41 | import org.apache.sysds.common.Types.DataType; |
|
97 | 109 | import org.apache.sysds.runtime.matrix.data.Pair; |
98 | 110 | import org.apache.sysds.utils.Explain; |
99 | 111 | import org.apache.sysds.utils.NativeHelper; |
| 112 | +import org.apache.sysds.utils.ParameterizedLogger; |
100 | 113 | import org.apache.sysds.utils.stats.CodegenStatistics; |
101 | 114 |
|
102 | | -import java.io.File; |
103 | | -import java.io.IOException; |
104 | | -import java.util.ArrayList; |
105 | | -import java.util.Arrays; |
106 | | -import java.util.Collections; |
107 | | -import java.util.Enumeration; |
108 | | -import java.util.HashMap; |
109 | | -import java.util.HashSet; |
110 | | -import java.util.Iterator; |
111 | | -import java.util.LinkedHashMap; |
112 | | -import java.util.Map.Entry; |
113 | | -import java.util.jar.JarEntry; |
114 | | -import java.util.jar.JarFile; |
115 | | - |
116 | 115 | public class SpoofCompiler { |
117 | | - private static final Log LOG = LogFactory.getLog(SpoofCompiler.class.getName()); |
| 116 | + private static final ParameterizedLogger LOG = ParameterizedLogger.getLogger(SpoofCompiler.class); |
118 | 117 |
|
119 | 118 | //internal configuration flags |
120 | 119 | public static CompilerType JAVA_COMPILER = CompilerType.JANINO; |
@@ -539,21 +538,20 @@ public static ArrayList<Hop> optimize(ArrayList<Hop> roots, boolean recompile) |
539 | 538 | } |
540 | 539 |
|
541 | 540 | //explain debug output cplans or generated source code |
542 | | - if( LOG.isInfoEnabled() || DMLScript.EXPLAIN.isHopsType(recompile) ) { |
543 | | - LOG.info("Codegen EXPLAIN (generated cplan for HopID: " + cplan.getKey() + |
544 | | - ", line "+tmp.getValue().getBeginLine() + ", hash="+tmp.getValue().hashCode()+"):"); |
| 541 | + if( DMLScript.EXPLAIN.isHopsType(recompile) ) { |
| 542 | + LOG.info("Codegen EXPLAIN (generated cplan for HopID: {}, line {}, hash={}):", |
| 543 | + cplan.getKey(), tmp.getValue().getBeginLine(), tmp.getValue().hashCode()); |
545 | 544 | LOG.info(tmp.getValue().getClassname() |
546 | 545 | + Explain.explainCPlan(cplan.getValue().getValue())); |
547 | 546 | } |
548 | | - if( LOG.isInfoEnabled() || DMLScript.EXPLAIN.isRuntimeType(recompile) ) { |
549 | | - LOG.info("JAVA Codegen EXPLAIN (generated code for HopID: " + cplan.getKey() + |
550 | | - ", line "+tmp.getValue().getBeginLine() + ", hash="+tmp.getValue().hashCode()+"):"); |
| 547 | + if( DMLScript.EXPLAIN.isRuntimeType(recompile) ) { |
| 548 | + LOG.info("JAVA Codegen EXPLAIN (generated code for HopID: {}, line {}, hash={}):", |
| 549 | + cplan.getKey(), tmp.getValue().getBeginLine(), tmp.getValue().hashCode()); |
551 | 550 | LOG.info(CodegenUtils.printWithLineNumber(src)); |
552 | | - |
553 | | - if(API == GeneratorAPI.CUDA) { |
554 | | - LOG.info("CUDA Codegen EXPLAIN (generated code for HopID: " + cplan.getKey() + |
555 | | - ", line " + tmp.getValue().getBeginLine() + ", hash=" + tmp.getValue().hashCode() + "):"); |
556 | 551 |
|
| 552 | + if(API == GeneratorAPI.CUDA) { |
| 553 | + LOG.info("CUDA Codegen EXPLAIN (generated code for HopID: {}, line {}, hash={}):", |
| 554 | + cplan.getKey(), tmp.getValue().getBeginLine(), tmp.getValue().hashCode()); |
557 | 555 | LOG.info(CodegenUtils.printWithLineNumber(src_cuda)); |
558 | 556 | } |
559 | 557 | } |
|
0 commit comments