File tree 3 files changed +42
-0
lines changed
test/dpct/python_migration/case_006
tools/dpct/extensions/python_rules
3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 56
56
57
57
torch .xpu .set_stream (st )
58
58
xpu .set_stream (st )
59
+
60
+ if torch .xpu .current_stream () != torch .xpu .current_stream ():
61
+ print ("Not default stream" )
62
+ device = torch .device ('xpu' )
63
+ extra_cuda_cflags = ['-ffast-math' , '' ]
Original file line number Diff line number Diff line change 56
56
57
57
torch .cuda .set_stream (st )
58
58
cuda .set_stream (st )
59
+
60
+ if torch .cuda .current_stream () != torch .cuda .default_stream ():
61
+ print ("Not default stream" )
62
+ device = torch .device ('cuda' )
63
+ extra_cuda_cflags = ['--use_fast_math' , '--allow-unsupported-compiler' ]
Original file line number Diff line number Diff line change 247
247
PythonSyntax : CUDA_HOME
248
248
In : CUDA_HOME
249
249
Out : SYCL_HOME
250
+
251
+ - Rule : rule_cuda_flag_use_fast_math
252
+ Kind : PythonRule
253
+ Priority : Fallback
254
+ MatchMode : Partial
255
+ PythonSyntax : cuda_flag_use_fast_math
256
+ In : ' --use_fast_math'
257
+ Out : ' -ffast-math'
258
+
259
+ - Rule : rule_cuda_flag_allow-unsupported-compiler
260
+ Kind : PythonRule
261
+ Priority : Fallback
262
+ MatchMode : Partial
263
+ PythonSyntax : cuda_flag_allow-unsupported-compiler
264
+ In : ' --allow-unsupported-compiler'
265
+ Out : ' '
266
+
267
+ - Rule : rule_cuda_default_stream
268
+ Kind : PythonRule
269
+ Priority : Fallback
270
+ MatchMode : Full
271
+ PythonSyntax : cuda_default_stream
272
+ In : torch.cuda.default_stream
273
+ Out : torch.xpu.current_stream
274
+
275
+ - Rule : rule_torch_device_cuda
276
+ Kind : PythonRule
277
+ Priority : Fallback
278
+ MatchMode : Full
279
+ PythonSyntax : torch_device_cuda
280
+ In : torch.device('cuda')
281
+ Out : torch.device('xpu')
You can’t perform that action at this time.
0 commit comments