add cuda path
This commit is contained in:
parent
0778c08843
commit
82cf51e6ee
|
@ -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);
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue