Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added default virtual dtor to 'computation' and missing return … #311

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 39 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ set(PROJECT_DIR ${CMAKE_SOURCE_DIR})
set(CMAKE_VERBOSE_MAKEFILE "ON")
set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")


# Add CMake header files
set(HEADER_FILES
include/tiramisu/block.h
Expand All @@ -19,13 +18,16 @@ set(HEADER_FILES
include/tiramisu/expr.h
include/tiramisu/mpi_comm.h
include/tiramisu/externs.h
include/tiramisu/computation_graph.h
include/tiramisu/auto_scheduler.h
)
include/tiramisu/computation_graph.h
include/tiramisu/auto_scheduler.h
)

# Add CMake cpp files
set(OBJS auto_scheduler expr block core codegen_halide codegen_c computation_graph debug function utils codegen_halide_lowering codegen_from_halide mpi codegen_cuda externs)

if(${USE_HALIDE})
set(OBJS auto_scheduler expr block core codegen_halide codegen_c computation_graph debug function utils codegen_halide_lowering codegen_from_halide mpi codegen_cuda externs)
else()
set(OBJS auto_scheduler expr block core codegen_halide codegen_c computation_graph debug function utils mpi codegen_cuda externs)
endif()

### CMAKE FILE INTERNALS ###

Expand Down Expand Up @@ -54,7 +56,6 @@ FILE(STRINGS benchmarks/automatic_comm/dist_benchmark_list.txt TIRAMISU_DIST_BEN
FILE(STRINGS tutorials/developers_tutorial_list.txt TIRAMISU_DEVELOPERS_TUTORIALS_RAW)
FILE(STRINGS tutorials/users_tutorial_list.txt TIRAMISU_USERS_TUTORIALS_RAW)


macro(init_tags)
set(is_gpu false)
set(is_mpi false)
Expand Down Expand Up @@ -145,25 +146,35 @@ if (${USE_MPI})
endif()
endif()

set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wno-sign-compare -fno-rtti")
#set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wno-sign-compare -fno-rtti")
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wno-sign-compare")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")

if(${USE_HALIDE})
include_directories("include"
"${ISL_INCLUDE_DIRECTORY}"
"${HALIDE_SOURCE_DIRECTORY}/include" "${HALIDE_SOURCE_DIRECTORY}/tools"
"build")
else()
include_directories("include"
"${ISL_INCLUDE_DIRECTORY}"
"build")
endif()

if (${USE_MPI})
set(CMAKE_CXX_COMPILER "${MPI_BUILD_DIR}/bin/mpicxx")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_MPI")
link_directories(${MPI_BUILD_DIR}/lib)
include_directories(${MPI_BUILD_DIR}/include)
else ()
set(CMAKE_CXX_COMPILER "g++")
set(CMAKE_CXX_COMPILER "clang++")
endif()


find_library(HalideLib Halide PATHS ${HALIDE_LIB_DIRECTORY} NO_DEFAULT_PATH)
if(${USE_HALIDE})
find_library(HalideLib Halide PATHS ${HALIDE_LIB_DIRECTORY} NO_DEFAULT_PATH)
endif()
find_library(ISLLib isl PATHS ${ISL_LIB_DIRECTORY} NO_DEFAULT_PATH)

# Require LLVM 5.0 or greater to keep in line with Halide
Expand Down Expand Up @@ -212,7 +223,14 @@ foreach (obj ${OBJS})
endforeach ()

add_library(tiramisu SHARED ${T_CODE})
target_link_libraries(tiramisu ${HalideLib} ${ISLLib})
#add_library(tiramisu STATIC ${T_CODE})

if(${USE_HALIDE})
target_link_libraries(tiramisu ${HalideLib} ${ISLLib})
else()
target_link_libraries(tiramisu ${ISLLib})
endif()

target_link_libraries(tiramisu ${LINK_FLAGS})

function(link_tags name)
Expand All @@ -225,8 +243,10 @@ endfunction()

function(build_g name generator result)
add_executable(${name} ${generator} ${HEADER_FILES})
if(${USE_HALIDE})
target_link_libraries(${name} tiramisu ${HalideLib} ${ISLLib})
target_link_libraries(${name} ${LINK_FLAGS})
endif()
target_link_libraries(${name} tiramisu ${ISLLib} ${LINK_FLAGS})
link_tags(${name})
if (NOT result STREQUAL "")
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${result}")
Expand All @@ -236,7 +256,9 @@ endfunction()

function(build_halide_g name generator result)
add_executable(${name} ${generator})
if(${USE_HALIDE})
target_link_libraries(${name} ${HalideLib})
endif()
target_link_libraries(${name} ${LINK_FLAGS})
if (NOT result STREQUAL "")
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${result})
Expand All @@ -246,8 +268,12 @@ endfunction()

function(build_w name objs wrapper header)
add_executable(${name} ${wrapper} ${objs} ${header})
if(${USE_HALIDE})
target_link_libraries(${name} tiramisu ${HalideLib} ${ISLLib})
target_link_libraries(${name} ${LINK_FLAGS})
else()
target_link_libraries(${name} tiramisu ${ISLLib})
endif()
target_link_libraries(${name} tiramisu ${ISLLib} ${LINK_FLAGS})
link_tags(${name})
endfunction()

Expand Down
15 changes: 11 additions & 4 deletions configure.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
set(CMAKE_BUILD_TYPE DEBUG)

#option(CMAKE_C_COMPILER "gcc" OFF)
#option(CMAKE_CXX_COMPILER "g++" OFF)

option(USE_GPU "Build with GPU support" OFF)

option(USE_MPI "Build with MPI support" OFF)
option(USE_HALIDE "Build with Halide support" OFF)

option(USE_LIBPNG "Build with libpng for the Halide benchmark" FALSE)

Expand All @@ -11,7 +15,7 @@ option(USE_LIBJPEG "Build with libjpeg for the Halide benchmark" FALSE)
option(USE_CUDNN "Build with cuDNN for benchmark comparisons" FALSE)

# If you set this to true, you should correctly set MKL_PREFIX (see below)
option(USE_MKL_WRAPPERS "Build with MKL wrappers provided by Tiramisu" TRUE)
option(USE_MKL_WRAPPERS "Build with MKL wrappers provided by Tiramisu" FALSE)

# Change with the cudnn library location
set(CUDNN_LOCATION /data/scratch/akkas/cudnn7 CACHE PATH "CUDNN library location")
Expand All @@ -31,7 +35,8 @@ set(MPI_NODES "" CACHE PATH "Use of MPI node paths")
# set(MKL_PREFIX "/data/scratch/baghdadi/libs/intel/mkl/")
set(MKL_PREFIX "" CACHE PATH "Intel MKL library path")

set(LLVM_CONFIG_BIN "${CMAKE_SOURCE_DIR}/3rdParty/llvm/prefix/bin/" CACHE PATH "Directory containing llvm-config executable")
#set(LLVM_CONFIG_BIN "${CMAKE_SOURCE_DIR}/3rdParty/llvm/prefix/bin/" CACHE PATH "Directory containing llvm-config executable")
set(LLVM_CONFIG_BIN "/usr/bin/" CACHE PATH "Directory containing llvm-config executable")

# Debug
option(ENABLE_DEBUG "Enable debug printing" FALSE)
Expand All @@ -41,6 +46,8 @@ set(DEBUG_LEVEL 0 CACHE STRING "Debug level value")
set(ISL_INCLUDE_DIRECTORY "3rdParty/isl/build/include/" CACHE PATH "Path to ISL include directory")
set(ISL_LIB_DIRECTORY "3rdParty/isl/build/lib/" CACHE PATH "Path to ISL library directory")


# Halide Paths
set(HALIDE_SOURCE_DIRECTORY "3rdParty/Halide" CACHE PATH "Path to Halide source directory")
set(HALIDE_LIB_DIRECTORY "3rdParty/Halide/lib" CACHE PATH "Path to Halide library directory")
set(HALIDE_SOURCE_DIRECTORY "3rdParty/Halide/build" CACHE PATH "Path to Halide source directory")
set(HALIDE_INCLUDE_DIRECTORY "3rdParty/Halide/build/include" CACHE PATH "Path to Halide include directory")
set(HALIDE_LIB_DIRECTORY "3rdParty/Halide/build/lib" CACHE PATH "Path to Halide library directory")
Loading