Skip to content

Commit

Permalink
Revert "Move at::{Refcounted,}MapAllocator to c10 (pytorch#109881)"
Browse files Browse the repository at this point in the history
This reverts commit 68a1219.

Reverted pytorch#109881 on behalf of https://github.com/kit1980 due to breaking internal builds, undefined symbol: _ZN3c1022RefcountedMapAllocator6decrefEv ([comment](pytorch#109881 (comment)))
  • Loading branch information
pytorchmergebot committed Oct 13, 2023
1 parent 8162f41 commit f68d6e8
Show file tree
Hide file tree
Showing 18 changed files with 799 additions and 1,161 deletions.
3 changes: 1 addition & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -1643,8 +1643,7 @@ cc_library(
name = "shm",
srcs = glob(["torch/lib/libshm/*.cpp"]),
deps = [
":torch_headers",
"//c10",
":torch",
],
)

Expand Down
22 changes: 22 additions & 0 deletions aten/src/ATen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,28 @@ if(UNIX AND NOT APPLE)
endif(NEED_LIBRT)
endif(UNIX AND NOT APPLE)

if(UNIX)
set(CMAKE_EXTRA_INCLUDE_FILES "sys/mman.h")
CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
if(HAVE_MMAP)
add_definitions(-DHAVE_MMAP=1)
endif(HAVE_MMAP)
# done for lseek: https://www.gnu.org/software/libc/manual/html_node/File-Position-Primitive.html
add_definitions(-D_FILE_OFFSET_BITS=64)
CHECK_FUNCTION_EXISTS(shm_open HAVE_SHM_OPEN)
if(HAVE_SHM_OPEN)
add_definitions(-DHAVE_SHM_OPEN=1)
endif(HAVE_SHM_OPEN)
CHECK_FUNCTION_EXISTS(shm_unlink HAVE_SHM_UNLINK)
if(HAVE_SHM_UNLINK)
add_definitions(-DHAVE_SHM_UNLINK=1)
endif(HAVE_SHM_UNLINK)
CHECK_FUNCTION_EXISTS(malloc_usable_size HAVE_MALLOC_USABLE_SIZE)
if(HAVE_MALLOC_USABLE_SIZE)
add_definitions(-DHAVE_MALLOC_USABLE_SIZE=1)
endif(HAVE_MALLOC_USABLE_SIZE)
endif(UNIX)

ADD_DEFINITIONS(-DUSE_EXTERNAL_MZCRC)

if(NOT MSVC)
Expand Down
Loading

0 comments on commit f68d6e8

Please sign in to comment.