Skip to content

Commit

Permalink
Remove THGeneral (pytorch#69041)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#69041

`TH_CONCAT_{N}` is still being used by THP so I've moved that into
it's own header but all the compiled code is gone.

Test Plan: Imported from OSS

Reviewed By: anjali411

Differential Revision: D32872477

Pulled By: ngimel

fbshipit-source-id: 06c82d8f96dbcee0715be407c61dfc7d7e8be47a
  • Loading branch information
peterbell10 authored and facebook-github-bot committed Dec 14, 2021
1 parent 8dfdc3d commit b08d642
Show file tree
Hide file tree
Showing 24 changed files with 33 additions and 336 deletions.
31 changes: 0 additions & 31 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -347,13 +347,6 @@ filegroup(
),
)

filegroup(
name = "th_srcs",
srcs = [
"aten/src/TH/THGeneral.cpp",
],
)

filegroup(
name = "aten_cuda_srcs",
srcs = [
Expand Down Expand Up @@ -510,14 +503,6 @@ header_template_rule(
},
)

header_template_rule(
name = "aten_src_TH_THGeneral",
src = "aten/src/TH/THGeneral.h.in",
out = "aten/src/TH/THGeneral.h",
substitutions = {
},
)

cc_library(
name = "aten_headers",
hdrs = [
Expand All @@ -541,7 +526,6 @@ cc_library(
],
deps = [
":c10_headers",
":aten_src_TH_THGeneral",
],
)

Expand All @@ -565,20 +549,6 @@ intern_build_aten_ops(
],
)

cc_library(
name = "th",
srcs = [
":th_srcs",
],
copts = ATEN_COPTS + [
"-mavx",
],
deps = [
":aten_headers",
"@fbgemm",
],
)

cc_library(
name = "aten",
srcs = [
Expand Down Expand Up @@ -606,7 +576,6 @@ cc_library(
":ATen_CPU",
":aten_headers",
":caffe2_for_aten_headers",
":th",
":torch_headers",
"@fbgemm",
"@ideep",
Expand Down
4 changes: 0 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,6 @@ into the repo directory.
directly.)
* [aten](aten) - C++ tensor library for PyTorch (no autograd support)
* [src](aten/src) - [README](aten/src/README.md)
* [TH](aten/src/TH)
* generic - Contains actual implementations of operators,
parametrized over `scalar_t`. Files here get compiled N times
per supported scalar type in PyTorch.
* [ATen](aten/src/ATen)
* [core](aten/src/ATen/core) - Core functionality of ATen. This
is migrating to top-level c10 folder.
Expand Down
1 change: 0 additions & 1 deletion aten/src/ATen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ if(BUILD_LITE_INTERPRETER)
append_filelist("jit_core_sources" all_cpu_cpp)
append_filelist("aten_cpu_source_non_codegen_list" all_cpu_cpp)
append_filelist("aten_native_source_non_codegen_list" all_cpu_cpp)
list(APPEND all_cpu_cpp ${Aten_TH_AVX_extra_src})
else()
set(
all_cpu_cpp ${base_cpp} ${ATen_CORE_SRCS} ${native_cpp}
Expand Down
24 changes: 0 additions & 24 deletions aten/src/TH/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,13 @@
set(Aten_TH_AVX_extra_src)

set(hdr
THGeneral.h THHalf.h THTensor.h)

set(ATen_TH_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/THGeneral.cpp
)
# Remember that PARENT_SCOPE variables are not in the current scope
set(ATen_TH_SRCS ${ATen_TH_SRCS} PARENT_SCOPE)
set(ATen_CPU_SRCS ${ATen_CPU_SRCS} ${ATen_TH_SRCS} PARENT_SCOPE)

# Aten_TH_AVX_extra_src is used in aten/src/ATen/CMakeLists.txt
# when built with BUILD_LITE_INTERPRETER=1
set(Aten_TH_AVX_extra_src ${Aten_TH_AVX_extra_src} PARENT_SCOPE)
######################################################


set(ATen_CPU_INCLUDE ${ATen_CPU_INCLUDE}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
PARENT_SCOPE)

set(ATen_CUDA_INCLUDE ${ATen_CUDA_INCLUDE}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
PARENT_SCOPE)

configure_file(THGeneral.h.in "${CMAKE_CURRENT_BINARY_DIR}/THGeneral.h")


install(FILES
TH.h
${CMAKE_CURRENT_BINARY_DIR}/THGeneral.h
THGenerateByteType.h
THHalf.h
DESTINATION "${ATEN_INSTALL_INCLUDE_SUBDIR}/TH")
6 changes: 0 additions & 6 deletions aten/src/TH/TH.h

This file was deleted.

105 changes: 0 additions & 105 deletions aten/src/TH/THGeneral.cpp

This file was deleted.

141 changes: 0 additions & 141 deletions aten/src/TH/THGeneral.h.in

This file was deleted.

8 changes: 0 additions & 8 deletions aten/src/TH/THHalf.h

This file was deleted.

5 changes: 5 additions & 0 deletions c10/util/Exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,11 @@ namespace detail {
_TORCH_WARN_ONCE(__VA_ARGS__); \
}

// Report an error with a specific argument
// NOTE: using the argument name in TORCH_CHECK's message is preferred
#define TORCH_CHECK_ARG(cond, argN, ...) \
TORCH_CHECK(cond, "invalid argument ", argN, ": ", __VA_ARGS__)

// ----------------------------------------------------------------------------
// Deprecated macros
// ----------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit b08d642

Please sign in to comment.