Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…to fix_imdecode
  • Loading branch information
yajiedesign committed Jul 1, 2018
2 parents c451085 + 37c8165 commit 6f46e0d
Show file tree
Hide file tree
Showing 822 changed files with 62,196 additions and 15,669 deletions.
28 changes: 28 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Codecov.io configuration file
codecov:
notify:
require_ci_to_pass: yes

coverage:
precision: 2
round: down
range: "70...100"

status:
project: yes
patch: yes
changes: no

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

# Disable comments for now to gather data in the background
comment: false
# layout: "header, diff"
# behavior: default
# require_changes: no
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,7 @@ python/.eggs
*DartConfiguration.tcl
tests/Makefile
tests/mxnet_unit_tests

# generated wrappers for ccache
cc
cxx
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
[submodule "3rdparty/ps-lite"]
path = 3rdparty/ps-lite
url = https://github.com/dmlc/ps-lite
[submodule "3rdparty/nnvm"]
path = 3rdparty/nnvm
url = https://github.com/dmlc/nnvm
[submodule "3rdparty/dlpack"]
path = 3rdparty/dlpack
url = https://github.com/dmlc/dlpack
Expand All @@ -26,3 +23,6 @@
[submodule "3rdparty/cub"]
path = 3rdparty/cub
url = https://github.com/dmlc/cub
[submodule "3rdparty/tvm"]
path = 3rdparty/tvm
url = https://github.com/dmlc/tvm
2 changes: 1 addition & 1 deletion 3rdparty/mkldnn
1 change: 0 additions & 1 deletion 3rdparty/nnvm
Submodule nnvm deleted from 2bc514
1 change: 1 addition & 0 deletions 3rdparty/tvm
Submodule tvm added at 6ab4da
109 changes: 49 additions & 60 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ mxnet_option(USE_NCCL "Use NVidia NCCL with CUDA" OFF)
mxnet_option(USE_OPENCV "Build with OpenCV support" ON)
mxnet_option(USE_OPENMP "Build with Openmp support" ON)
mxnet_option(USE_CUDNN "Build with cudnn support" ON) # one could set CUDNN_ROOT for search path
mxnet_option(USE_SSE "Build with x86 SSE instruction support" ON)
mxnet_option(USE_SSE "Build with x86 SSE instruction support" ON IF NOT ARM)
mxnet_option(USE_F16C "Build with x86 F16C instruction support" ON) # autodetects support if ON
mxnet_option(USE_LAPACK "Build with lapack support" ON IF NOT MSVC)
mxnet_option(USE_LAPACK "Build with lapack support" ON)
mxnet_option(USE_MKL_IF_AVAILABLE "Use MKL if found" ON)
mxnet_option(USE_MKLML_MKL "Use MKLDNN variant of MKL (if MKL found)" ON IF USE_MKL_IF_AVAILABLE AND UNIX AND (NOT APPLE))
mxnet_option(USE_MKLDNN "Use MKLDNN variant of MKL (if MKL found)" ON IF USE_MKL_IF_AVAILABLE AND UNIX AND (NOT APPLE))
mxnet_option(USE_MKLML_MKL "Use MKLDNN variant of MKL (if MKL found)" ON IF USE_MKL_IF_AVAILABLE AND (NOT APPLE))
mxnet_option(USE_MKLDNN "Use MKLDNN variant of MKL (if MKL found)" ON IF USE_MKL_IF_AVAILABLE AND (NOT APPLE))
mxnet_option(USE_OPERATOR_TUNING "Enable auto-tuning of operators" ON IF NOT MSVC)
mxnet_option(USE_GPERFTOOLS "Build with GPerfTools support (if found)" ON)
mxnet_option(USE_JEMALLOC "Build with Jemalloc support" ON)
Expand All @@ -38,6 +38,7 @@ mxnet_option(BUILD_CPP_EXAMPLES "Build cpp examples" ON)
mxnet_option(INSTALL_EXAMPLES "Install the example source files." OFF)
mxnet_option(USE_SIGNAL_HANDLER "Print stack traces on segfaults." OFF)

message(STATUS "CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}")
if(USE_CUDA AND NOT USE_OLDCMAKECUDA)
message(STATUS "CMake version '${CMAKE_VERSION}' using generator '${CMAKE_GENERATOR}'")
if(
Expand Down Expand Up @@ -87,7 +88,6 @@ if(MSVC)
add_definitions(-DNNVM_EXPORTS)
add_definitions(-DDMLC_STRICT_CXX11)
add_definitions(-DNOMINMAX)
set(SUPPORT_F16C FALSE)
if(USE_F16C)
message("F16C instruction set is not yet supported for MSVC")
endif()
Expand Down Expand Up @@ -185,34 +185,21 @@ if(USE_VTUNE)
list(APPEND mxnet_LINKER_LIBS dl)
endif()

if(USE_MKL_IF_AVAILABLE)
if(USE_MKLDNN)
add_subdirectory(3rdparty/mkldnn)
include_directories(3rdparty/mkldnn/include)
list(APPEND mxnet_LINKER_LIBS mkldnn)
if(USE_MKLDNN)
include(cmake/MklDnn.cmake)
# CPU architecture (e.g., C5) can't run on another architecture (e.g., g3).
if(NOT MSVC)
set(ARCH_OPT_FLAGS "-mtune=generic")
endif()
find_package(MKL)
set(WITH_TEST OFF)
set(WITH_EXAMPLE OFF)
add_subdirectory(3rdparty/mkldnn)

if(MKL_FOUND)
include_directories(${MKL_INCLUDE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/operator/mkl)

if(USE_MKLDNN)
add_definitions(-DMXNET_USE_MKLDNN=1)
endif()

add_definitions(-DUSE_MKL=1)
add_definitions(-DCUB_MKL=1)
list(APPEND mxnet_LINKER_LIBS ${MKL_LIBRARIES})

if(NOT MSVC)
list(APPEND mxnet_LINKER_LIBS dl)
endif()
# If using MKL, use the Intel OMP libraries
list(APPEND mxnet_LINKER_LIBS iomp5)
else()
message(STATUS " MKL not found")
endif()
include_directories(3rdparty/mkldnn/include)
add_definitions(-DUSE_MKL=1)
add_definitions(-DCUB_MKL=1)
add_definitions(-DMXNET_USE_MKLDNN=1)
list(APPEND mxnet_LINKER_LIBS mkldnn)
endif()

# Allow Cuda compiles outside of src tree to find things in 'src' and 'include'
Expand Down Expand Up @@ -275,8 +262,8 @@ endforeach()
include_directories("include")
include_directories("3rdparty/mshadow")
include_directories("3rdparty/cub")
include_directories("3rdparty/nnvm/include")
include_directories("3rdparty/nnvm/tvm/include")
include_directories("3rdparty/tvm/nnvm/include")
include_directories("3rdparty/tvm/include")
include_directories("3rdparty/dmlc-core/include")
include_directories("3rdparty/dlpack/include")

Expand Down Expand Up @@ -334,14 +321,15 @@ endif()

# ---[ OpenCV
if(USE_OPENCV)
find_package(OpenCV QUIET COMPONENTS core highgui imgproc imgcodecs)
find_package(OpenCV COMPONENTS core highgui imgproc imgcodecs)
if(NOT OpenCV_FOUND) # if not OpenCV 3.x, then imgcodecs are not found
message(STATUS "OpenCV imgcodecs missing")
find_package(OpenCV REQUIRED COMPONENTS core highgui imgproc)
endif()
include_directories(SYSTEM ${OpenCV_INCLUDE_DIRS})
list(APPEND mxnet_LINKER_LIBS ${OpenCV_LIBS})
message(STATUS " OpenCV_LIBS=${OpenCV_LIBS}")
message(STATUS "OpenCV found (${OpenCV_CONFIG_PATH})")
message(STATUS "OpenCV ${OpenCV_VERSION} found (${OpenCV_CONFIG_PATH})")
add_definitions(-DMXNET_USE_OPENCV=1)
else(USE_OPENCV)
message(STATUS "OpenCV Disabled")
Expand All @@ -353,7 +341,11 @@ if(USE_OPENMP)
find_package(OpenMP REQUIRED)
# This should build on Windows, but there's some problem and I don't have a Windows box, so
# could a Windows user please fix?
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/openmp/CMakeLists.txt AND SYSTEM_ARCHITECTURE STREQUAL "x86_64" AND NOT MSVC)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/openmp/CMakeLists.txt
AND SYSTEM_ARCHITECTURE STREQUAL "x86_64"
AND NOT MSVC
AND NOT CMAKE_CROSSCOMPILING)

# Intel/llvm OpenMP: https://github.com/llvm-mirror/openmp
set(OPENMP_STANDALONE_BUILD TRUE)
set(LIBOMP_ENABLE_SHARED TRUE)
Expand All @@ -373,21 +365,21 @@ if(USE_OPENMP)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
endif()
elseif(UNIX)
elseif(UNIX AND NOT ANDROID)
list(APPEND mxnet_LINKER_LIBS pthread)
endif()


# ---[ LAPack
if(USE_LAPACK AND NOT MSVC)
if(USE_LAPACK)
add_definitions(-DMXNET_USE_LAPACK=1)
list(APPEND mxnet_LINKER_LIBS lapack)
else(USE_LAPACK)
# Workaround for Windows until using new Jenkinsfile.
if(BLAS STREQUAL "Open" OR BLAS STREQUAL "open" OR USE_BLAS STREQUAL "Open" OR USE_BLAS STREQUAL "open")
add_definitions(-DMXNET_USE_LAPACK=1)
if (NOT MSVC)
list(APPEND mxnet_LINKER_LIBS lapack)
endif()
endif()

message("USE LAPACK ${USE_LAPACK}")

# ---[ jemalloc
if(USE_JEMALLOC)
find_package(JeMalloc)
Expand Down Expand Up @@ -432,13 +424,13 @@ FILE(GLOB_RECURSE CUDA "src/*.cu" "src/*.cuh")

# add nnvm to source
FILE(GLOB_RECURSE NNVMSOURCE
3rdparty/nnvm/src/c_api/*.cc
3rdparty/nnvm/src/core/*.cc
3rdparty/nnvm/src/pass/*.cc
3rdparty/nnvm/src/c_api/*.h
3rdparty/nnvm/src/core/*.h
3rdparty/nnvm/src/pass/*.h
3rdparty/nnvm/include/*.h)
3rdparty/tvm/nnvm/src/c_api/*.cc
3rdparty/tvm/nnvm/src/core/*.cc
3rdparty/tvm/nnvm/src/pass/*.cc
3rdparty/tvm/nnvm/src/c_api/*.h
3rdparty/tvm/nnvm/src/core/*.h
3rdparty/tvm/nnvm/src/pass/*.h
3rdparty/tvm/nnvm/include/*.h)
list(APPEND SOURCE ${NNVMSOURCE})

# add mshadow file
Expand All @@ -448,8 +440,8 @@ list(APPEND SOURCE ${MSHADOWSOURCE})
list(APPEND CUDA ${MSHADOW_CUDASOURCE})

# add source group
FILE(GLOB_RECURSE GROUP_SOURCE "src/*.cc" "3rdparty/nnvm/*.cc" "plugin/*.cc")
FILE(GLOB_RECURSE GROUP_Include "src/*.h" "3rdparty/nnvm/*.h" "3rdparty/mshadow/mshadow/*.h" "plugin/*.h")
FILE(GLOB_RECURSE GROUP_SOURCE "src/*.cc" "3rdparty/tvm/nnvm/*.cc" "plugin/*.cc")
FILE(GLOB_RECURSE GROUP_Include "src/*.h" "3rdparty/tvm/nnvm/*.h" "3rdparty/mshadow/mshadow/*.h" "plugin/*.h")
FILE(GLOB_RECURSE GROUP_CUDA "src/*.cu" "src/*.cuh" "3rdparty/mshadow/mshadow/*.cuh" "plugin/*.cu"
"plugin/*.cuh" "3rdparty/cub/cub/*.cuh")
assign_source_group("Source" ${GROUP_SOURCE})
Expand Down Expand Up @@ -588,11 +580,6 @@ if(USE_PLUGIN_CAFFE)
endif()
endif()

if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/nnvm/CMakeLists.txt")
set(nnvm_LINKER_LIBS nnvm)
list(APPEND mxnet_LINKER_LIBS ${nnvm_LINKER_LIBS})
endif()

if(NOT MSVC)
# Only add c++11 flags and definitions after cuda compiling
add_definitions(-DDMLC_USE_CXX11)
Expand All @@ -607,7 +594,7 @@ else()
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /OPT:REF /OPT:ICF")
set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL} /OPT:REF /OPT:ICF")
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /OPT:REF /OPT:ICF")

endif()

set(MXNET_INSTALL_TARGETS mxnet)
Expand Down Expand Up @@ -661,7 +648,7 @@ if(USE_PLUGINS_WARPCTC)
endif()


if(USE_OPENCV)
if(USE_OPENCV AND OpenCV_VERSION_MAJOR GREATER 2)
add_executable(im2rec "tools/im2rec.cc")
if(MSVC)
target_link_libraries(im2rec mxnet)
Expand All @@ -672,9 +659,11 @@ if(USE_OPENCV)
${mxnet_LINKER_LIBS}
${OpenCV_LIBS}
dmlc
${nnvm_LINKER_LIBS}
${pslite_LINKER_LIBS}
)
else()
message(WARNING "OpenCV_VERSION_MAJOR: ${OpenCV_VERSION_MAJOR}, version 3 with imgcodecs \
is required for im2rec, im2rec will not be available")
endif()

target_link_libraries(mxnet PUBLIC dmlc)
Expand Down
3 changes: 2 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@

# Language bindings
/R-package/ @thirdwing
/scala-package/ @yzhliu
/scala-package/ @yzhliu @nswamy
/perl-package/ @sergeykolychev
/python/ @szha

# C++ base
/src/kvstore/ @rahul003
/cpp-package/ @nswamy

# CMake
CMakeLists.txt @szha @rahul003
Expand Down
4 changes: 3 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,6 @@ List of Contributors
* [Sina Afrooze](https://github.com/safrooze)
* [Sergey Sokolov](https://github.com/Ishitori)
* [Thomas Delteil](https://github.com/ThomasDelteil)

* [Jesse Brizzi](https://github.com/jessebrizzi)
* [Hang Zhang](http://hangzh.com)
* [Kou Ding](https://github.com/chinakook)
Loading

0 comments on commit 6f46e0d

Please sign in to comment.