Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
36f6aede
Unverified
Commit
36f6aede
authored
Mar 25, 2026
by
Andreas Karatzas
Committed by
GitHub
Mar 26, 2026
Browse files
[Misc] Optimized check to encapsulate both CUDA and ROCm platforms (#34549)
Signed-off-by:
Andreas Karatzas
<
akaratza@amd.com
>
parent
9704a5c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
vllm/utils/torch_utils.py
vllm/utils/torch_utils.py
+1
-1
No files found.
vllm/utils/torch_utils.py
View file @
36f6aede
...
@@ -683,7 +683,7 @@ def get_accelerator_view_from_cpu_tensor(cpu_tensor: torch.Tensor) -> torch.Tens
...
@@ -683,7 +683,7 @@ def get_accelerator_view_from_cpu_tensor(cpu_tensor: torch.Tensor) -> torch.Tens
if
current_platform
.
is_xpu
():
if
current_platform
.
is_xpu
():
assert
cpu_tensor
.
is_pinned
(),
"CPU tensor must be pinned"
assert
cpu_tensor
.
is_pinned
(),
"CPU tensor must be pinned"
return
torch
.
ops
.
_C
.
get_xpu_view_from_cpu_tensor
(
cpu_tensor
)
return
torch
.
ops
.
_C
.
get_xpu_view_from_cpu_tensor
(
cpu_tensor
)
elif
current_platform
.
is_cuda
()
or
current_platform
.
is_rocm
():
elif
current_platform
.
is_cuda
_alike
():
return
torch
.
ops
.
_C
.
get_cuda_view_from_cpu_tensor
(
cpu_tensor
)
return
torch
.
ops
.
_C
.
get_cuda_view_from_cpu_tensor
(
cpu_tensor
)
else
:
else
:
raise
ValueError
(
raise
ValueError
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment