add cuda path

This commit is contained in:
William S. Moses 2021-09-22 12:21:34 -04:00 committed by William Moses
parent 0778c08843
commit 82cf51e6ee
2 changed files with 17 additions and 0 deletions

View File

@ -6137,6 +6137,13 @@ static bool parseMLIR(const char *Argv0, std::vector<std::string> filenames,
chars[a.length()] = 0;
Argv.push_back(chars);
}
if (CUDAPath != "") {
auto a = "--cuda-path=" + CUDAPath;
char *chars = (char *)malloc(a.length() + 1);
memcpy(chars, a.data(), a.length());
chars[a.length()] = 0;
Argv.push_back(chars);
}
if (MArch != "") {
auto a = "-march=" + MArch;
char *chars = (char *)malloc(a.length() + 1);

View File

@ -92,6 +92,9 @@ static cl::opt<std::string> Standard("std", cl::init(""),
static cl::opt<std::string> CUDAGPUArch("cuda-gpu-arch", cl::init(""),
cl::desc("CUDA GPU arch"));
static cl::opt<std::string> CUDAPath("cuda-path", cl::init(""),
cl::desc("CUDA Path"));
static cl::opt<std::string> Output("o", cl::init("-"), cl::desc("Output file"));
static cl::list<std::string> inputFileName(cl::Positional, cl::OneOrMore,
@ -229,6 +232,13 @@ int emitBinary(char *Argv0, const char *filename,
chars[a.length()] = 0;
Argv.push_back(chars);
}
if (CUDAPath != "") {
auto a = "--cuda-path=" + CUDAPath;
char *chars = (char *)malloc(a.length() + 1);
memcpy(chars, a.data(), a.length());
chars[a.length()] = 0;
Argv.push_back(chars);
}
if (Opt0) {
Argv.push_back("-O0");
}