Skip to content

ZhaoqiongZ/extension-cpp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++/CUDA/SYCL Extensions in PyTorch

An example of writing a C++/CUDA/Sycl extension for PyTorch. See here for the accompanying tutorial. This repo demonstrates how to write an example extension_cpp.ops.mymuladd custom op that has both custom CPU and CUDA/Sycl kernels.

Note: SYCL serves as the backend programming language for Intel GPUs (device label xpu). For configuration details, see: Getting Started on Intel GPUs.

The examples in this repo work with PyTorch 2.4 or later for C++/CUDA & PyTorch 2.8 or later for Sycl.

To build:

pip install --no-build-isolation -e .

To test:

python test/test_extension.py

Authors

Peter Goldsborough, Richard Zou

About

C++ extensions in PyTorch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 55.3%
  • C++ 23.6%
  • Cuda 21.1%