#define NI_FLAGS_SKIP_RO_APP 0x0400
#define NI_FLAGS_RM_ORIGIN_AFTER_NI 0x0800
#define NI_FLAGS_SET_PRIORITY 0x1000
+#define NI_FLAGS_PARALLELISM 0x2000
typedef std::function<void (std::string)> afterCreate;
std::vector<std::string> inputBubbleRefFiles;
std::vector<std::string> mibcPath;
int priority;
+ std::string threadNum;
} NIOption;
/**
" Note!: App ATOC options(--ni-pkg, --ni-regen-all-app, --tac-regen-all) cannot be used with --rm-origin-after-ni option.\n"
" (Use only for assemblies that will not be AOTed again afterward.)\n"
" --set-priority - Sets the priority of the process to the specified values from -20(highest priority) to 19(lowest priority).(default : 0)\n"
+ " --parallelism - Sets the maximum number of threads to use in AOTC (default = logical processor count)\n"
"\n"
"Usage: dotnettool [options] [command] [arguments]\n"
DisplayUsage();
return -1;
}
+ } else if (arg == "--parallelism") {
+ ++i;
+ if (i >= argc) {
+ _SOUT("Number of threads (minimum 1) should be followed for --parallelism option");
+ DisplayUsage();
+ return -1;
+ }
+
+ opt->flags |= NI_FLAGS_PARALLELISM;
+ try {
+ opt->threadNum = argv[i];
+ if (std::stoi(argv[i]) < 1) {
+ _SERR("Number of threads should be bigger than 1 (input : %s)", argv[i]);
+ DisplayUsage();
+ return -1;
+ }
+ } catch (...) {
+ _SERR("Invalid argument: %s", argv[i]);
+ DisplayUsage();
+ return -1;
+ }
} else if (arg == "--mibc") {
++i;
if (i >= argc) {
static const char* CROSSGEN_OPT_TARGET_ARCH = "--targetarch";
static const char* CROSSGEN_OPT_OUT_NEAR_INPUT = "--out-near-input";
static const char* CROSSGEN_OPT_SINGLE_FILE_COMPILATION = "--single-file-compilation";
-//static const char* CROSSGEN_OPT_PARALLELISM = "--parallelism";
-//static const char* CROSSGEN_OPT_PARALLELISM_COUNT = "5";
+static const char* CROSSGEN_OPT_PARALLELISM = "--parallelism";
static const char* CROSSGEN_OPT_RESILIENT = "--resilient";
//static const char* CROSSGEN_OPT_OPTIMIZE = "-O";
static const char* CROSSGEN_OPT_OPTIMIZE_TIME = "--Ot";
args.push_back(CROSSGEN_OPT_TARGET_ARCH);
args.push_back(ARCHITECTURE_IDENTIFIER);
- //args.push_back(OPT_PARALLELISM);
- //args.push_back(OPT_PARALLELISM_COUNT);
+ if (opt->flags & NI_FLAGS_PARALLELISM) {
+ args.push_back(CROSSGEN_OPT_PARALLELISM);
+ args.push_back(opt->threadNum.c_str());
+ }
args.push_back(CROSSGEN_OPT_RESILIENT);
args.push_back(CROSSGEN_OPT_OPTIMIZE_TIME);