File tree Expand file tree Collapse file tree
test/dpct/python_migration/case_006
tools/dpct/extensions/python_rules Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5656
5757torch .xpu .set_stream (st )
5858xpu .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 = ['' , '' ]
Original file line number Diff line number Diff line change 5656
5757torch .cuda .set_stream (st )
5858cuda .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 247247 PythonSyntax : CUDA_HOME
248248 In : CUDA_HOME
249249 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 : ' '
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