Skip to content

Commit f68d6e8

Browse files
Revert "Move at::{Refcounted,}MapAllocator to c10 (pytorch#109881)"
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)))
1 parent 8162f41 commit f68d6e8

18 files changed

+799
-1161
lines changed

BUILD.bazel

+1-2
Original file line numberDiff line numberDiff line change
@@ -1643,8 +1643,7 @@ cc_library(
16431643
name = "shm",
16441644
srcs = glob(["torch/lib/libshm/*.cpp"]),
16451645
deps = [
1646-
":torch_headers",
1647-
"//c10",
1646+
":torch",
16481647
],
16491648
)
16501649

aten/src/ATen/CMakeLists.txt

+22
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,28 @@ if(UNIX AND NOT APPLE)
337337
endif(NEED_LIBRT)
338338
endif(UNIX AND NOT APPLE)
339339

340+
if(UNIX)
341+
set(CMAKE_EXTRA_INCLUDE_FILES "sys/mman.h")
342+
CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
343+
if(HAVE_MMAP)
344+
add_definitions(-DHAVE_MMAP=1)
345+
endif(HAVE_MMAP)
346+
# done for lseek: https://www.gnu.org/software/libc/manual/html_node/File-Position-Primitive.html
347+
add_definitions(-D_FILE_OFFSET_BITS=64)
348+
CHECK_FUNCTION_EXISTS(shm_open HAVE_SHM_OPEN)
349+
if(HAVE_SHM_OPEN)
350+
add_definitions(-DHAVE_SHM_OPEN=1)
351+
endif(HAVE_SHM_OPEN)
352+
CHECK_FUNCTION_EXISTS(shm_unlink HAVE_SHM_UNLINK)
353+
if(HAVE_SHM_UNLINK)
354+
add_definitions(-DHAVE_SHM_UNLINK=1)
355+
endif(HAVE_SHM_UNLINK)
356+
CHECK_FUNCTION_EXISTS(malloc_usable_size HAVE_MALLOC_USABLE_SIZE)
357+
if(HAVE_MALLOC_USABLE_SIZE)
358+
add_definitions(-DHAVE_MALLOC_USABLE_SIZE=1)
359+
endif(HAVE_MALLOC_USABLE_SIZE)
360+
endif(UNIX)
361+
340362
ADD_DEFINITIONS(-DUSE_EXTERNAL_MZCRC)
341363

342364
if(NOT MSVC)

0 commit comments

Comments
 (0)