Title: XPU Support — PyTorch main documentation
Description: PyTorch XPU C++ API — Intel GPU support with device management, streams, and guards.
Keywords:
Domain: docs.pytorch.org
{
"@context": "https://schema.org",
"@type": "Article",
"name": "XPU Support",
"headline": "XPU Support",
"description": "PyTorch XPU C++ API \u2014 Intel GPU support with device management, streams, and guards.",
"url": "/api/xpu/index.html",
"articleBody": "XPU Support# PyTorch provides XPU support for Intel GPU-accelerated tensor operations. The XPU API allows you to manage Intel GPU devices, streams for asynchronous execution, and synchronization. When to use XPU APIs: When running on Intel GPUs (Data Center GPU Max, Arc, etc.) When implementing custom XPU kernels or operations When managing asynchronous execution with XPU streams When writing device-portable code alongside CUDA Basic usage: #include \u003ctorch/torch.h\u003e // Check if XPU is available if (torch::xpu::is_available()) { // Create tensor on XPU auto tensor = torch::randn({2, 3}, torch::device(torch::kXPU)); // Move model to XPU model-\u003eto(torch::kXPU); } Header Files# torch/xpu.h - High-level XPU utilities (device count, availability, seeding) c10/xpu/XPUStream.h - XPU stream management XPU Categories# XPU Streams XPU Utility Functions",
"author": {
"@type": "Organization",
"name": "PyTorch Contributors",
"url": "https://pytorch.org"
},
"image": "https://pytorch.org/docs/stable/_static/img/pytorch_seo.png",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "/api/xpu/index.html"
},
"datePublished": "2023-01-01T00:00:00Z",
"dateModified": "2023-01-01T00:00:00Z"
}
| docsearch:language | en |
| llm:site-type | documentation |
| llm:framework | PyTorch |
| llm:description | PyTorch XPU C++ API — Intel GPU support with device management, streams, and guards. |
| llm:navigation-file | https://pytorch.org/docs/stable/llms.txt |
| llm:sitemap | https://pytorch.org/docs/stable/sitemap.xml |
| llm:version | main |
| llm:project | PyTorch |
| llm:page-type | documentation |
| og:image | https://docs.pytorch.org/docs/stable/_static/img/pytorch_seo.png |
| None | 2 |
Links:
Viewport: width=device-width, initial-scale=1