pytorch/test/cpp_extensions
Pavel Belevich 1beca4ac6a Prerequisites for CSPRNG (#36631)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/36631

Summary of changes

1. Moved random transformation functions to DistributionHelper.h (`uniform_int_from_to_distribution`, `uniform_int_full_range_distribution`, `uniform_int_distribution`) to avoid code duplication between default CPU, CUDA rngs and custom rng extensions
2. Made GeneratorImpl fields protected instead of private
3. Introduced `TORCH_CHECK_IF_NOT_ON_CUDA` that does the same as `TORCH_CHECK` if it is not CUDA/ROCm device
4. To test multiple rng extensions I had to move ops registration to the method `registerOps()`, expose it to python and call it `def setUp(self)`

Test Plan: Imported from OSS

Differential Revision: D21229202

Pulled By: pbelevich

fbshipit-source-id: 6aa3280f2fc3324cf3e748388b5087e3a1e49f23
2020-04-24 12:25:37 -07:00
..
no_python_abi_suffix_test
torch_test_cpp_extension
cpp_c10d_extension.cpp add c10d dynamic loading mechanism and unit test (#28068) 2020-04-02 15:46:51 -07:00
cpp_c10d_extension.hpp add c10d dynamic loading mechanism and unit test (#28068) 2020-04-02 15:46:51 -07:00
cpp_frontend_extension.cpp
cuda_extension.cpp
cuda_extension.cu
cuda_extension_kernel.cu
cuda_extension_kernel2.cu
cudnn_extension.cpp
doubler.h
extension.cpp
jit_extension.cpp
jit_extension2.cpp
msnpu_extension.cpp Back out "Revert D21089648: Put TORCH_LIBRARY in torch/library.h; add custom class API" 2020-04-22 09:18:23 -07:00
rng_extension.cpp Prerequisites for CSPRNG (#36631) 2020-04-24 12:25:37 -07:00
setup.py pybind11 type_caster for at::Generator and custom RNG python test (#34774) 2020-03-22 10:57:35 -07:00