-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for more torch.cuda APIs
- Loading branch information
1 parent
6ae8d31
commit 7280da2
Showing
4 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
clang/test/dpct/python_migration/case_006/case_006_torch_cuda.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// RUN: rm -rf %T && mkdir -p %T | ||
// RUN: cd %T | ||
// RUN: cp %S/input.py ./input.py | ||
// RUN: dpct -in-root ./ -out-root out ./input.py --migrate-build-script-only | ||
// RUN: echo "begin" > %T/diff.txt | ||
// RUN: diff --strip-trailing-cr %S/expected.py %T/out/input.py >> %T/diff.txt | ||
// RUN: echo "end" >> %T/diff.txt | ||
|
||
// CHECK: begin | ||
// CHECK-NEXT: end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from torch import xpu | ||
|
||
devs = torch.xpu.device_count() | ||
devs = xpu.device_count() | ||
|
||
d_cap = torch.xpu.get_device_capability() | ||
d_cap = xpu.get_device_capability() | ||
d0_cap = torch.xpu.get_device_capability(devs[0]) | ||
d0_cap = xpu.get_device_capability(devs[0]) | ||
|
||
arch_list = [''] | ||
arch_list = [''] | ||
|
||
cuda_ver = torch.version.xpu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from torch import cuda | ||
|
||
devs = torch.cuda.device_count() | ||
devs = cuda.device_count() | ||
|
||
d_cap = torch.cuda.get_device_capability() | ||
d_cap = cuda.get_device_capability() | ||
d0_cap = torch.cuda.get_device_capability(devs[0]) | ||
d0_cap = cuda.get_device_capability(devs[0]) | ||
|
||
arch_list = torch.cuda.get_arch_list() | ||
arch_list = cuda.get_arch_list() | ||
|
||
cuda_ver = torch.version.cuda |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters