Skip to content

Commit

Permalink
[Refactor] Rename before release (dmlc#261)
Browse files Browse the repository at this point in the history
* include/dgl/runtime

* include

* src/runtime

* src/graph

* src/scheduler

* src

* clean up CMakeLists

* further clean up in cmake

* install commands

* python/dgl/_ffi/_cython

* python/dgl/_ffi/_ctypes

* python/dgl/_ffi

* python/dgl

* some fix

* copy right
  • Loading branch information
lingfanyu authored Dec 5, 2018
1 parent aabba9d commit a1d50f0
Show file tree
Hide file tree
Showing 54 changed files with 1,060 additions and 1,291 deletions.
159 changes: 0 additions & 159 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
cmake_minimum_required(VERSION 2.8)
project(dgl C CXX)

# Utility functions
include(cmake/util/Util.cmake)

if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/config.cmake)
include(${CMAKE_CURRENT_BINARY_DIR}/config.cmake)
else()
Expand All @@ -15,37 +12,6 @@ else()
endif()
endif()

# NOTE: do not modify this file to change option values.
# You can create a config.cmake at build folder
# and add set(OPTION VALUE) to override these build options.
# Alernatively, use cmake -DOPTION=VALUE through command-line.
#tvm_option(USE_CUDA "Build with CUDA" OFF)
#tvm_option(USE_OPENCL "Build with OpenCL" OFF)
#tvm_option(USE_VULKAN "Build with Vulkan" OFF)
#tvm_option(USE_OPENGL "Build with OpenGL" OFF)
#tvm_option(USE_METAL "Build with Metal" OFF)
#tvm_option(USE_ROCM "Build with ROCM" OFF)
#tvm_option(ROCM_PATH "The path to rocm" /opt/rocm)
#tvm_option(USE_RPC "Build with RPC" ON)
#tvm_option(USE_LLVM "Build with LLVM, can be set to specific llvm-config path" OFF)
#tvm_option(USE_STACKVM_RUNTIME "Include stackvm into the runtime" OFF)
#tvm_option(USE_GRAPH_RUNTIME "Build with tiny graph runtime" ON)
#tvm_option(USE_GRAPH_RUNTIME_DEBUG "Build with tiny graph runtime debug mode" OFF)
#tvm_option(USE_RTTI "Build with RTTI" ON)
#tvm_option(USE_MSVC_MT "Build with MT" OFF)
#tvm_option(INSTALL_DEV "Install compiler infrastructure" OFF)

# Contrib library options
#tvm_option(USE_BLAS "The blas library to be linked" none)
#tvm_option(USE_MKL_PATH "MKL root path when use MKL blas" none)
#tvm_option(USE_CUDNN "Build with cuDNN" OFF)
#tvm_option(USE_CUBLAS "Build with cuBLAS" OFF)
#tvm_option(USE_MIOPEN "Build with ROCM:MIOpen" OFF)
#tvm_option(USE_ROCBLAS "Build with ROCM:RoCBLAS" OFF)
#tvm_option(USE_SORT "Build with sort support" OFF)
#tvm_option(USE_NNPACK "Build with nnpack support" OFF)
#tvm_option(USE_RANDOM "Build with random support" OFF)

# include directories
include_directories("include")
include_directories("third_party/dlpack/include")
Expand Down Expand Up @@ -83,140 +49,15 @@ else(MSVC)
endif()
endif(MSVC)

# add source group
#FILE(GLOB_RECURSE GROUP_SOURCE "src/*.cc")
#FILE(GLOB_RECURSE GROUP_INCLUDE "src/*.h" "include/*.h")
#assign_source_group("Source" ${GROUP_SOURCE})
#assign_source_group("Include" ${GROUP_INCLUDE})

# Source file lists
file(GLOB CORE_SRCS src/graph/*.cc src/*.cc src/scheduler/*.cc)

file(GLOB RUNTIME_SRCS src/runtime/*.cc)

# Package runtime rules
#if(NOT USE_RTTI)
# add_definitions(-DDMLC_ENABLE_RTTI=0)
#endif()
#
#if(USE_RPC)
# message(STATUS "Build with RPC support...")
# file(GLOB RUNTIME_RPC_SRCS src/runtime/rpc/*.cc)
# list(APPEND RUNTIME_SRCS ${RUNTIME_RPC_SRCS})
#endif(USE_RPC)
#
#file(GLOB STACKVM_RUNTIME_SRCS src/runtime/stackvm/*.cc)
#file(GLOB STACKVM_CODEGEN_SRCS src/codegen/stackvm/*.cc)
#list(APPEND COMPILER_SRCS ${STACKVM_CODEGEN_SRCS})
#if(USE_STACKVM_RUNTIME)
# message(STATUS "Build with stackvm support in runtime...")
# list(APPEND RUNTIME_SRCS ${STACKVM_RUNTIME_SRCS})
#else()
# list(APPEND COMPILER_SRCS ${STACKVM_RUNTIME_SRCS})
#endif(USE_STACKVM_RUNTIME)
#
#if(USE_GRAPH_RUNTIME)
# message(STATUS "Build with Graph runtime support...")
# file(GLOB RUNTIME_GRAPH_SRCS src/runtime/graph/*.cc)
# list(APPEND RUNTIME_SRCS ${RUNTIME_GRAPH_SRCS})
#
# if(USE_GRAPH_RUNTIME_DEBUG)
# set_source_files_properties(${RUNTIME_GRAPH_SRCS}
# PROPERTIES COMPILE_DEFINITIONS "TVM_GRAPH_RUNTIME_DEBUG")
# endif(USE_GRAPH_RUNTIME_DEBUG)
#endif(USE_GRAPH_RUNTIME)

# Module rules
#include(cmake/modules/VTA.cmake)
#include(cmake/modules/CUDA.cmake)
#include(cmake/modules/OpenCL.cmake)
#include(cmake/modules/OpenGL.cmake)
#include(cmake/modules/Vulkan.cmake)
#include(cmake/modules/Metal.cmake)
#include(cmake/modules/ROCM.cmake)
#include(cmake/modules/LLVM.cmake)
#include(cmake/modules/contrib/BLAS.cmake)
#include(cmake/modules/contrib/Random.cmake)
#include(cmake/modules/contrib/Sort.cmake)
#include(cmake/modules/contrib/NNPack.cmake)

add_library(dgl SHARED ${CORE_SRCS} ${RUNTIME_SRCS})
#add_library(dgl_runtime SHARED ${RUNTIME_SRCS})

target_link_libraries(dgl ${DGL_LINKER_LIBS} ${DGL_RUNTIME_LINKER_LIBS})
#target_link_libraries(dgl_runtime ${DGL_RUNTIME_LINKER_LIBS})

# Related headers
#target_include_directories(
# dgl
# PUBLIC "HalideIR/src"
# PUBLIC "topi/include")

# Tests
#set(TEST_EXECS "")
#file(GLOB TEST_SRCS tests/cpp/*.cc)
#find_library(GTEST_LIB gtest)

#if(GTEST_LIB)
# foreach(__srcpath ${TEST_SRCS})
# get_filename_component(__srcname ${__srcpath} NAME)
# string(REPLACE ".cc" "" __execname ${__srcname})
# add_executable(${__execname} ${__srcpath})
# list(APPEND TEST_EXECS ${__execname})
# target_link_libraries(${__execname}
# tvm ${GTEST_LIB} pthread)
# set_target_properties(${__execname} PROPERTIES EXCLUDE_FROM_ALL 1)
# set_target_properties(${__execname} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1)
# endforeach()
# add_custom_target(cpptest DEPENDS ${TEST_EXECS})
#endif()

# Custom targets
#add_custom_target(runtime DEPENDS tvm_runtime)

# Installation rules
install(TARGETS dgl DESTINATION lib${LIB_SUFFIX})
#install(TARGETS dgl_runtime DESTINATION lib${LIB_SUFFIX})

#if (INSTALL_DEV)
# install(
# DIRECTORY "include/." DESTINATION "include"
# FILES_MATCHING
# PATTERN "*.h"
# )
# install(
# DIRECTORY "topi/include/." DESTINATION "include"
# FILES_MATCHING
# PATTERN "*.h"
# )
# install(
# DIRECTORY "HalideIR/src/." DESTINATION "include/HalideIR"
# FILES_MATCHING
# PATTERN "*.h"
# )
# install(
# DIRECTORY "dlpack/include/." DESTINATION "include"
# FILES_MATCHING
# PATTERN "*.h"
# )
# install(
# DIRECTORY "nnvm/include/." DESTINATION "include"
# FILES_MATCHING
# PATTERN "*.h"
# )
#else(INSTALL_DEV)
# install(
# DIRECTORY "include/tvm/runtime/." DESTINATION "include/tvm/runtime"
# FILES_MATCHING
# PATTERN "*.h"
# )
#endif(INSTALL_DEV)

# More target definitions
#if(MSVC)
# target_compile_definitions(tvm PRIVATE -DHalide_EXPORTS)
# target_compile_definitions(tvm_runtime PRIVATE -DHalide_EXPORTS)
# target_compile_definitions(tvm PRIVATE -DTVM_EXPORTS)
# target_compile_definitions(tvm_runtime PRIVATE -DTVM_EXPORTS)
# target_compile_definitions(nnvm_compiler PRIVATE -DNNVM_EXPORTS)
#endif()
62 changes: 0 additions & 62 deletions cmake/util/Util.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion conda/dgl/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ git submodule init
git submodule update
md build
cd build
cmake -DCMAKE_CXX_FLAGS="-DDMLC_LOG_STACK_TRACE=0 -DTVM_EXPORTS" -DCMAKE_MAKE_PROGRAM=mingw32-make .. -G "MSYS Makefiles"
cmake -DCMAKE_CXX_FLAGS="-DDMLC_LOG_STACK_TRACE=0 -DDGL_EXPORTS" -DCMAKE_MAKE_PROGRAM=mingw32-make .. -G "MSYS Makefiles"
if errorlevel 1 exit 1
mingw32-make
if errorlevel 1 exit 1
Expand Down
2 changes: 1 addition & 1 deletion docs/source/install/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Then build the shared library and install the Python binding:
md build
cd build
cmake -DCMAKE_CXX_FLAGS="-DDMLC_LOG_STACK_TRACE=0 -DTVM_EXPORTS" -DCMAKE_MAKE_PROGRAM=mingw32-make .. -G "MSYS Makefiles"
cmake -DCMAKE_CXX_FLAGS="-DDMLC_LOG_STACK_TRACE=0 -DDGL_EXPORTS" -DCMAKE_MAKE_PROGRAM=mingw32-make .. -G "MSYS Makefiles"
mingw32-make
cd ..\python
python setup.py install
12 changes: 6 additions & 6 deletions include/dgl/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
namespace dgl {

typedef uint64_t dgl_id_t;
typedef tvm::runtime::NDArray IdArray;
typedef tvm::runtime::NDArray DegreeArray;
typedef tvm::runtime::NDArray BoolArray;
typedef tvm::runtime::NDArray IntArray;
typedef dgl::runtime::NDArray IdArray;
typedef dgl::runtime::NDArray DegreeArray;
typedef dgl::runtime::NDArray BoolArray;
typedef dgl::runtime::NDArray IntArray;

class Graph;
class GraphOp;
Expand Down Expand Up @@ -386,12 +386,12 @@ class Graph {
struct Subgraph {
/*! \brief The graph. */
Graph graph;
/*!
/*!
* \brief The induced vertex ids.
* \note This is also a map from the new vertex id to the vertex id in the parent graph.
*/
IdArray induced_vertices;
/*!
/*!
* \brief The induced edge ids.
* \note This is also a map from the new edge id to the edge id in the parent graph.
*/
Expand Down
Loading

0 comments on commit a1d50f0

Please sign in to comment.