Skip to content

Commit

Permalink
delete TH (pytorch#69929)
Browse files Browse the repository at this point in the history
Summary:
Move TH<C>GenerateByteType includes into torch/csrc (the only place they are used), and we can remove TH folder altogether!
The only thing left in THC are includes left for bc compatibility.

Pull Request resolved: pytorch#69929

Reviewed By: mruberry

Differential Revision: D33133013

Pulled By: ngimel

fbshipit-source-id: 78c87cf93d2d641631b0f71051ace318bf4ec3c1
  • Loading branch information
Natalia Gimelshein authored and facebook-github-bot committed Dec 16, 2021
1 parent 7f7966a commit c9e898f
Show file tree
Hide file tree
Showing 17 changed files with 17 additions and 36 deletions.
1 change: 0 additions & 1 deletion aten/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ if(USE_CUDA)
endif()

set(TH_LINK_STYLE STATIC)
add_subdirectory(src/TH)
set(TH_CPU_INCLUDE
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR}/src
Expand Down
7 changes: 7 additions & 0 deletions aten/src/ATen/native/cpu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,10 @@ a generic definition of `sumImplAll`. This function allows the user to reduce
over a dimension or all dimensions. The appropiate capability is chosen at
runtime using cpuinfo. If the current platform has AVX2, `sumImpl` will be set
to `sumImplAll<CPUCapability::AVX2>`.

At runtime, the following environment variables control which codepath is taken:

x64 options:
ATEN_CPU_CAPABILITY=avx2 # Force AVX2 codepaths to be used
ATEN_CPU_CAPABILITY=avx # Force AVX codepaths to be used
ATEN_CPU_CAPABILITY=default # Use oldest supported vector instruction set
13 changes: 0 additions & 13 deletions aten/src/TH/CMakeLists.txt

This file was deleted.

11 changes: 0 additions & 11 deletions aten/src/TH/README.md

This file was deleted.

1 change: 0 additions & 1 deletion aten/src/THC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ PARENT_SCOPE)
install(FILES
THCAtomics.cuh
THCDeviceUtils.cuh
THCGenerateByteType.h
DESTINATION "${ATEN_INSTALL_INCLUDE_SUBDIR}/THC")
2 changes: 1 addition & 1 deletion torch/csrc/Storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

// NOLINTNEXTLINE(bugprone-suspicious-include)
#include <torch/csrc/generic/Storage.cpp>
#include <TH/THGenerateByteType.h>
#include <torch/csrc/THGenerateByteType.h>

#include <c10/util/intrusive_ptr.h>

Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/Storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
#define THPStorageBaseStr TH_CONCAT_STRING_2(Real,StorageBase)

#include <torch/csrc/generic/Storage.h>
#include <TH/THGenerateByteType.h>
#include <torch/csrc/THGenerateByteType.h>

#endif
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion torch/csrc/cuda/Storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
#include <torch/csrc/autograd/utils/wrap_outputs.h>

#define THC_GENERIC_FILE "torch/csrc/generic/Storage.cpp"
#include <THC/THCGenerateByteType.h>
#include <torch/csrc/THCGenerateByteType.h>
2 changes: 1 addition & 1 deletion torch/csrc/cuda/Storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
#include <torch/csrc/cuda/override_macros.h>

#define THC_GENERIC_FILE "torch/csrc/generic/Storage.h"
#include <THC/THCGenerateByteType.h>
#include <torch/csrc/THCGenerateByteType.h>

#endif
2 changes: 1 addition & 1 deletion torch/csrc/cuda/serialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
#include <memory>

#define THC_GENERIC_FILE "torch/csrc/generic/serialization.cpp"
#include <THC/THCGenerateByteType.h>
#include <torch/csrc/THCGenerateByteType.h>
2 changes: 1 addition & 1 deletion torch/csrc/cuda/serialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
#include <torch/csrc/cuda/override_macros.h>

#define THC_GENERIC_FILE "torch/csrc/generic/serialization.h"
#include <THC/THCGenerateByteType.h>
#include <torch/csrc/THCGenerateByteType.h>

#endif
2 changes: 1 addition & 1 deletion torch/csrc/cuda/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
#include <torch/csrc/cuda/override_macros.h>

#define THC_GENERIC_FILE "torch/csrc/generic/utils.h"
#include <THC/THCGenerateByteType.h>
#include <torch/csrc/THCGenerateByteType.h>
#endif
2 changes: 1 addition & 1 deletion torch/csrc/serialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ void doWrite(io fildes, void* raw_buf, size_t nbytes) {

// NOLINTNEXTLINE(bugprone-suspicious-include)
#include <torch/csrc/generic/serialization.cpp>
#include <TH/THGenerateByteType.h>
#include <torch/csrc/THGenerateByteType.h>
2 changes: 1 addition & 1 deletion torch/csrc/serialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define THP_SERIALIZATION_INC

#include <torch/csrc/generic/serialization.h>
#include <TH/THGenerateByteType.h>
#include <torch/csrc/THGenerateByteType.h>

template <class io>
void doRead(io fildes, void* buf, size_t nbytes);
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ template <typename T>
struct THPUtils_typeTraits {};

#include <torch/csrc/generic/utils.h>
#include <TH/THGenerateByteType.h>
#include <torch/csrc/THGenerateByteType.h>

std::vector<int64_t> THPUtils_unpackLongs(PyObject *arg);
PyObject * THPUtils_dispatchStateless(PyObject *tensor, const char *name, PyObject *args, PyObject *kwargs);
Expand Down

0 comments on commit c9e898f

Please sign in to comment.