|
@@ -19,9 +19,12 @@ namespace NTERA.Compiler
|
|
|
|
|
|
public Dictionary<FunctionDefinition, string> DeclaredFunctions = new Dictionary<FunctionDefinition, string>();
|
|
|
|
|
|
- public Compiler(string inputDirectory)
|
|
|
+ public int Threads { get; set; }
|
|
|
+
|
|
|
+ public Compiler(string inputDirectory, int threads)
|
|
|
{
|
|
|
InputDirectory = inputDirectory;
|
|
|
+ Threads = threads;
|
|
|
}
|
|
|
|
|
|
protected static string[] DefaultGlobalNumberVariables =
|
|
@@ -283,7 +286,7 @@ namespace NTERA.Compiler
|
|
|
#else
|
|
|
Parallel.ForEach(Directory.EnumerateFiles(erbPath, "*.erh", SearchOption.AllDirectories), new ParallelOptions
|
|
|
{
|
|
|
- MaxDegreeOfParallelism = 8
|
|
|
+ MaxDegreeOfParallelism = Threads
|
|
|
}, file =>
|
|
|
#endif
|
|
|
{
|
|
@@ -312,7 +315,7 @@ namespace NTERA.Compiler
|
|
|
#else
|
|
|
Parallel.ForEach(Directory.EnumerateFiles(erbPath, "*.erb", SearchOption.AllDirectories), new ParallelOptions
|
|
|
{
|
|
|
- MaxDegreeOfParallelism = 8
|
|
|
+ MaxDegreeOfParallelism = Threads
|
|
|
}, file =>
|
|
|
#endif
|
|
|
{
|
|
@@ -345,7 +348,7 @@ namespace NTERA.Compiler
|
|
|
#else
|
|
|
Parallel.ForEach(DeclaredFunctions, new ParallelOptions
|
|
|
{
|
|
|
- MaxDegreeOfParallelism = 8
|
|
|
+ MaxDegreeOfParallelism = Threads
|
|
|
}, kv =>
|
|
|
#endif
|
|
|
{
|