author | Boris Fomitchev <bfomitchev@nvidia.com> | |
Mon, 19 Oct 2015 23:47:18 +0000 (16:47 -0700) | ||
committer | Boris Fomitchev <bfomitchev@nvidia.com> | |
Mon, 19 Oct 2015 23:47:18 +0000 (16:47 -0700) |
1 | 2 | |||
---|---|---|---|---|
.3rdparty/cnmem/.gitignore | patch | | | | | | blob |
.3rdparty/cnmem/CMakeLists.txt | patch | | | | | | blob |
.3rdparty/cnmem/LICENSE | patch | | | | | | blob |
.3rdparty/cnmem/README.md | patch | | | | | | blob |
.3rdparty/cnmem/include/cnmem.h | patch | | | | diff2 | | blob | history |
.3rdparty/cnmem/src/cnmem.cpp | patch | | | | diff2 | | blob | history |
.3rdparty/cnmem/tests/cnmem_tests.cpp | patch | | | | diff2 | | blob | history |
diff --cc .3rdparty/cnmem/.gitignore
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..e8ab68ab1c07d1497fd1473c9f509c196a9dabe0
new file mode 100644 (file)
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,2 @@@
++# Ignore the build directory created to build the code
++build
diff --cc .3rdparty/cnmem/CMakeLists.txt
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..e11d12f9ee38bf0a18c3ef96a5e521956fd73492
new file mode 100644 (file)
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,45 @@@
++# CMakeLists to build the cnmem library.
++cmake_minimum_required(VERSION 2.8.8)
++project(cnmem)
++
++# We need CUDA to build that library.
++find_package(CUDA QUIET REQUIRED)
++include_directories(${CUDA_INCLUDE_DIRS})
++
++# Rules to build the cnmem library.
++include_directories(include)
++add_definitions(-DCNMEM_DLLEXPORT)
++add_library(cnmem SHARED src/cnmem.cpp)
++set_target_properties(cnmem PROPERTIES VERSION 1.0.0 SOVERSION 1)
++target_link_libraries(cnmem LINK_PUBLIC ${CUDA_LIBRARIES})
++install(TARGETS cnmem RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
++install(FILES include/cnmem.h DESTINATION include)
++
++# Add the tests.
++if(WITH_TESTS)
++
++ # Get Google tests.
++ find_package(GTest QUIET REQUIRED)
++ include_directories(${GTEST_INCLUDE_DIRS})
++
++ # Build the executable.
++ add_executable(cnmem_tests tests/cnmem_tests.cpp)
++ if(MSVC)
++ if(MSVC_VERSION GREATER 1700) # Visual Studio 11 or more.
++ add_definitions(-DUSE_CPP_11)
++ endif(MSVC_VERSION GREATER 1700)
++ endif(MSVC)
++ if(CMAKE_COMPILER_IS_GNUCC)
++ add_definitions(-std=c++11 -DUSE_CPP_11)
++ endif(CMAKE_COMPILER_IS_GNUCC)
++ target_link_libraries(cnmem_tests LINK_PUBLIC cnmem ${CUDA_LIBRARIES} ${GTEST_LIBRARIES} -lpthread)
++ install(TARGETS cnmem_tests RUNTIME DESTINATION bin)
++
++ # On Windows, we copy the Google test DLL to the bin folder.
++ if(MSVC)
++ get_filename_component(gtest_dll_path ${GTEST_LIBRARIES} DIRECTORY)
++ install(FILES ${gtest_dll_path}/gtest.dll DESTINATION bin)
++ endif(MSVC)
++
++endif(WITH_TESTS)
++
diff --cc .3rdparty/cnmem/LICENSE
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..9f24f8bc1abc453a58b3616848392df58c84070f
new file mode 100644 (file)
new file mode 100644 (file)
--- /dev/null
--- /dev/null
+++ b/.3rdparty/cnmem/LICENSE
@@@ -1,0 -1,0 +1,26 @@@
++Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
++
++Redistribution and use in source and binary forms, with or without
++modification, are permitted provided that the following conditions
++are met:
++ * Redistributions of source code must retain the above copyright
++ notice, this list of conditions and the following disclaimer.
++ * Redistributions in binary form must reproduce the above copyright
++ notice, this list of conditions and the following disclaimer in the
++ documentation and/or other materials provided with the distribution.
++ * Neither the name of NVIDIA CORPORATION nor the names of its
++ contributors may be used to endorse or promote products derived
++ from this software without specific prior written permission.
++
++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
++EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
++OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
diff --cc .3rdparty/cnmem/README.md
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..9fcb35d50e84675d4d0bf9a3437d099cdcdf0a74
new file mode 100644 (file)
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,56 @@@
++# CNMeM Library
++
++Simple library to help the Deep Learning frameworks manage CUDA memory.
++
++CNMeM is not intended to be a general purpose memory management library. It was designed as a simple
++tool for applications which work on a limited number of large memory buffers.
++
++CNMeM is mostly developed on Ubuntu Linux. It should support other operating systems as well. If you
++encounter an issue with the library on other operating systems, please submit a bug (or a fix).
++
++# Prerequisites
++
++CNMeM relies on the CUDA toolkit. It uses C++ STL and the Pthread library on Linux. On Windows, it uses
++the native Win32 threading library. The build system uses CMake. The unit tests are written using
++Google tests (but are not mandatory).
++
++## CUDA
++
++The CUDA toolkit is required. We recommend using CUDA >= 7.0 even if earlier versions will work.
++* Download from the [CUDA website](https://developer.nvidia.com/cuda-downloads)
++* Follow the installation instructions
++* Don't forget to set your path. For example:
++ * `CUDA_HOME=/usr/local/cuda`
++ * `LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH`
++
++# Build CNMeM
++
++## Grab the source
++
++ % cd $HOME
++ % git clone https://github.com/NVIDIA/cnmem.git cnmem
++
++## Build CNMeM without the unit tests
++
++ % cd cnmem
++ % mkdir build
++ % cd build
++ % cmake ..
++ % make
++
++## Build CNMeM with the unit tests
++
++To build the tests, you need to add an extra option to the cmake command.
++
++ % cd cnmem
++ % mkdir build
++ % cd build
++ % cmake -DWITH_TESTS=True ..
++ % make
++
++## Link with CNMeM
++
++The source folder contains a header file 'include/cnmem.h' and the build directory contains the
++library 'libcnmem.so', 'cnmem.lib/cnmem.dll' or 'libcnmem.dylib', depending on your operating
++system.
++
diff --cc .3rdparty/cnmem/include/cnmem.h
index 0000000000000000000000000000000000000000,19fd2f84022c05ce84d3b7a7c9e280b07b02da8a..19fd2f84022c05ce84d3b7a7c9e280b07b02da8a
mode 000000,100644..100644
mode 000000,100644..100644
--- /dev/null
--- 2/include/cnmem.h
diff --cc .3rdparty/cnmem/src/cnmem.cpp
index 0000000000000000000000000000000000000000,f0bc54374ce76e488107c029abd5ee8dfc0af328..f0bc54374ce76e488107c029abd5ee8dfc0af328
mode 000000,100644..100644
mode 000000,100644..100644
--- /dev/null
--- 2/src/cnmem.cpp
diff --cc .3rdparty/cnmem/tests/cnmem_tests.cpp
index 0000000000000000000000000000000000000000,0f1c26873b051136c1173a471e0ef9f61194ebbe..0f1c26873b051136c1173a471e0ef9f61194ebbe
mode 000000,100644..100644
mode 000000,100644..100644
--- /dev/null