@@ -112,6 +112,8 @@ string HipBinNvidia::getHipCC() const {
112
112
hipCCPath = cudaPath;
113
113
hipCCPath /= " bin/nvcc" ;
114
114
hipCC = hipCCPath.string ();
115
+ if (getOSInfo () == windows)
116
+ hipCC = " \" " + hipCC + " \" " ;
115
117
return hipCC;
116
118
}
117
119
@@ -176,7 +178,11 @@ string HipBinNvidia::getHipInclude() const {
176
178
void HipBinNvidia::initializeHipLdFlags () {
177
179
string hipLdFlags;
178
180
const string& cudaPath = getCompilerPath ();
179
- hipLdFlags = " -Wno-deprecated-gpu-targets -lcuda -lcudart -L" +
181
+ if (getOSInfo () == windows)
182
+ hipLdFlags = " -Wno-deprecated-gpu-targets -lcuda -lcudart -L\" " +
183
+ cudaPath + " /lib64\" " ;
184
+ else
185
+ hipLdFlags = " -Wno-deprecated-gpu-targets -lcuda -lcudart -L" +
180
186
cudaPath + " /lib64" ;
181
187
hipLdFlags_ = hipLdFlags;
182
188
}
@@ -196,7 +202,10 @@ const string& HipBinNvidia::getHipLdFlags() const {
196
202
void HipBinNvidia::initializeHipCFlags () {
197
203
string hipCFlags;
198
204
const string& cudaPath = getCompilerPath ();
199
- hipCFlags += " -isystem " + cudaPath + " /include" ;
205
+ if (getOSInfo () == windows)
206
+ hipCFlags += " -isystem \" " + cudaPath + " /include\" " ;
207
+ else
208
+ hipCFlags += " -isystem " + cudaPath + " /include" ;
200
209
string hipIncludePath;
201
210
hipIncludePath = getHipInclude ();
202
211
hipCFlags += " -isystem \" " + hipIncludePath + " \" " ;
@@ -212,7 +221,10 @@ const string& HipBinNvidia::getHipCXXFlags() const {
212
221
void HipBinNvidia::initializeHipCXXFlags () {
213
222
string hipCXXFlags = " -Wno-deprecated-gpu-targets " ;
214
223
const string& cudaPath = getCompilerPath ();
215
- hipCXXFlags += " -isystem " + cudaPath + " /include" ;
224
+ if (getOSInfo () == windows)
225
+ hipCXXFlags += " -isystem \" " + cudaPath + " /include\" " ;
226
+ else
227
+ hipCXXFlags += " -isystem " + cudaPath + " /include" ;
216
228
string hipIncludePath;
217
229
hipIncludePath = getHipInclude ();
218
230
hipCXXFlags += " -isystem \" " + hipIncludePath + " \" " ;
@@ -253,7 +265,10 @@ void HipBinNvidia::printCompilerInfo() const {
253
265
fs::path nvcc;
254
266
nvcc = getCompilerPath ();
255
267
nvcc /= " bin/nvcc" ;
256
- cmd = nvcc.string () + " --version" ;
268
+ if (getOSInfo () == windows)
269
+ cmd = " \" " + nvcc.string () + " \" " + " --version" ;
270
+ else
271
+ cmd = nvcc.string () + " --version" ;
257
272
system (cmd.c_str ());
258
273
}
259
274
@@ -263,7 +278,10 @@ string HipBinNvidia::getCompilerVersion() {
263
278
fs::path nvcc;
264
279
nvcc = getCompilerPath ();
265
280
nvcc /= " bin/nvcc" ;
266
- cmd = nvcc.string () + " --version" ;
281
+ if (getOSInfo () == windows)
282
+ cmd = " \" " + nvcc.string () + " \" " + " --version" ;
283
+ else
284
+ cmd = nvcc.string () + " --version" ;
267
285
system (cmd.c_str ());
268
286
return compilerVersion;
269
287
}
@@ -591,6 +609,9 @@ void HipBinNvidia::executeHipCCCmd(vector<string> argv) {
591
609
}
592
610
if (runCmd) {
593
611
SystemCmdOut sysOut;
612
+ if (os == windows)
613
+ CMD = " \" " + CMD + " \" " ;
614
+
594
615
sysOut = hipBinUtilPtr_->exec (CMD.c_str (), true );
595
616
string cmdOut = sysOut.out ;
596
617
int CMD_EXIT_CODE = sysOut.exitCode ;
0 commit comments