pytorch/test/cpp_extensions
Jane Xu 515e55e692 Set -DPy_LIMITED_API flag for py_limited_api=True extensions (#145764)
This could be BC breaking, because there was a period of time when we use py_limited_api=True but don't enforce the flag, and now that we will start enforcing the flag, people's custom extensions may fail to build.

This is strictly still better behavior, as it is sketchy to claim CPython agnosticism without the flag, but calling this out as potential people yelling at us. Ways to mitigate this risk + reasons this may not be too big a deal:
- People haven't known about py_limited_api for extensions much due to lack of docs from python so usage is low right now
- My current tutorial is in store to make new users of py_limited_api pass this flag, so it'd be a noop for them.

Test plan:
* Locally i'm confident as I tried rebuilding ao with this change and it reliably failed (cuz importing torch/extension.h is a nono)
* Unit test wise, the normal python_agnostic one I added should work

Pull Request resolved: https://github.com/pytorch/pytorch/pull/145764
Approved by: https://github.com/ezyang, https://github.com/zou3519, https://github.com/albanD
2025-01-28 20:11:05 +00:00
..
no_python_abi_suffix_test [BE][Easy][7/19] enforce style for empty lines in import segments in test/[a-c]*/ and test/[q-z]*/ (#129758) 2024-07-31 10:54:03 +00:00
open_registration_extension OpenReg: fix issue of pin_memory (#145046) 2025-01-28 09:41:04 +00:00
python_agnostic_extension Set -DPy_LIMITED_API flag for py_limited_api=True extensions (#145764) 2025-01-28 20:11:05 +00:00
self_compiler_include_dirs_test
torch_test_cpp_extension [RFC] Add support for device extension autoloading (#127074) 2024-07-09 06:14:13 +00:00
cpp_c10d_extension.cpp
cpp_c10d_extension.hpp
cpp_frontend_extension.cpp
cublas_extension.cpp
cuda_dlink_extension_add.cu
cuda_dlink_extension_add.cuh
cuda_dlink_extension_kernel.cu
cuda_dlink_extension.cpp
cuda_extension_kernel.cu
cuda_extension_kernel2.cu
cuda_extension.cpp
cuda_extension.cu
cudnn_extension.cpp
cusolver_extension.cpp
dangling_impl_extension.cpp
doubler.h
extension.cpp Support torch.dtype as parameter in pybind11 cpp extension. (#126865) 2024-05-29 23:19:32 +00:00
identity.cpp
jit_extension.cpp
jit_extension2.cpp
maia_extension.cpp [codemod] c10::optional -> std::optional in caffe2/aten/src/ATen/DeviceGuard.h +117 (#126901) 2024-05-24 00:26:15 +00:00
mps_extension.mm [BE] Use helper functions in mps_extension (#137313) 2024-10-04 00:26:38 +00:00
mtia_extension.cpp Make Context to be Device-agnostic Step by Step (1/N) (#136519) (#138155) 2024-10-17 20:58:56 +00:00
open_registration_extension.cpp [1/N] OpenReg: Replace open_registration_extension.cpp with openreg (#141815) 2025-01-14 15:59:00 +00:00
rng_extension.cpp [codemod] c10:optional -> std::optional (#126135) 2024-05-14 19:35:51 +00:00
setup.py [BE][Easy][7/19] enforce style for empty lines in import segments in test/[a-c]*/ and test/[q-z]*/ (#129758) 2024-07-31 10:54:03 +00:00
torch_library.cu