Skip to content
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
96 changes: 82 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
project(gflip3d)
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.2)
project(gdel3d)
set(APP_NAME "${PROJECT_NAME}_demo")
set(LIB_NAME_STATIC "${PROJECT_NAME}_static")
set(LIB_NAME "${PROJECT_NAME}")

## cuda
find_package(CUDA QUIET REQUIRED)
set(CMAKE_BUILD_TYPE Release)
set(CUDA_SEPARABLE_COMPILATION ON)
set(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE OFF)

# How to turn off specific warnings from nvcc
# (1) See this for available options: http://www.ssl.berkeley.edu/~jimm/grizzly_docs/SSL/opt/intel/cc/9.0/lib/locale/en_US/mcpcom.msg
# For example, for the warning "signed bit field of length 1" you will find the option "signed_one_bit_field"
# (2) Use: -Xcudafe "--diag_suppress=signed_one_bit_field"
set(CUDA_NVCC_FLAGS
${CUDA_NVCC_FLAGS};
-gencode arch=compute_35,code=sm_35
-gencode arch=compute_30,code=sm_30)
include_directories(
GDelFlipping/Main
)
cuda_add_executable(
${PROJECT_NAME}
# -lineinfo
# --use_fast_math
-Wno-deprecated-gpu-targets
-Xcompiler "-fPIC"
-maxrregcount=0
-Xcudafe "--diag_suppress=signed_one_bit_field"
-Xcudafe "--diag_suppress=extra_semicolon"
-Xcudafe "--diag_suppress=linkage_specifier_not_allowed"
CACHE STRING "nvcc flags" FORCE
)

## sources
list(APPEND SOURCE_FILES
GDelFlipping/src/DelaunayChecker.cpp
GDelFlipping/src/Demo.cpp
GDelFlipping/src/InputCreator.cpp
GDelFlipping/src/RandGen.cpp
GDelFlipping/src/gDel3D/GpuDelaunay.cu
Expand All @@ -22,5 +37,58 @@ cuda_add_executable(
GDelFlipping/src/gDel3D/CPU/Star.cpp
GDelFlipping/src/gDel3D/GPU/KerDivision.cu
GDelFlipping/src/gDel3D/GPU/KerPredicates.cu
GDelFlipping/src/gDel3D/GPU/ThrustWrapper.cu
)
GDelFlipping/src/gDel3D/GPU/ThrustWrapper.cu)

list(APPEND HEADER_FILES_CPU
GDelFlipping/src/gDel3D/CPU/CPUDecl.h
GDelFlipping/src/gDel3D/CPU/predicates.h
GDelFlipping/src/gDel3D/CPU/PredWrapper.h
GDelFlipping/src/gDel3D/CPU/Splaying.h
GDelFlipping/src/gDel3D/CPU/Star.h)

list(APPEND HEADER_FILES_GPU
GDelFlipping/src/gDel3D/GPU/DPredWrapper.h
GDelFlipping/src/gDel3D/GPU/CudaWrapper.h
GDelFlipping/src/gDel3D/GPU/GPUDecl.h
GDelFlipping/src/gDel3D/GPU/HostToKernel.h
GDelFlipping/src/gDel3D/GPU/KerCommon.h
GDelFlipping/src/gDel3D/GPU/KerDivision.h
GDelFlipping/src/gDel3D/GPU/KerPredicates.h
GDelFlipping/src/gDel3D/GPU/KerShewchuk.h
GDelFlipping/src/gDel3D/GPU/ThrustWrapper.h)

list(APPEND HEADER_FILES_GDEL3D
GDelFlipping/src/gDel3D/CommonTypes.h
GDelFlipping/src/gDel3D/GpuDelaunay.h
GDelFlipping/src/gDel3D/PerfTimer.h)

list(APPEND HEADER_FILES_COMMON
GDelFlipping/src/DelaunayChecker.h
GDelFlipping/src/InputCreator.h
GDelFlipping/src/RandGen.h)

# build the app
cuda_add_executable(${APP_NAME} ${SOURCE_FILES} GDelFlipping/src/Demo.cpp)
set_target_properties(${APP_NAME} PROPERTIES CUDA_SEPARABLE_COMPILATION ON)

# build the static library
cuda_add_library(${LIB_NAME_STATIC} STATIC ${SOURCE_FILES})
set_target_properties(${LIB_NAME_STATIC} PROPERTIES CUDA_SEPARABLE_COMPILATION ON)

# build the shared library
cuda_add_library(${LIB_NAME} SHARED ${SOURCE_FILES})
set_target_properties(${LIB_NAME} PROPERTIES CUDA_SEPARABLE_COMPILATION ON)


#########################################################
install(TARGETS ${APP_NAME} DESTINATION bin)
install(TARGETS ${LIB_NAME_STATIC} DESTINATION lib)
install(TARGETS ${LIB_NAME} DESTINATION lib)

install(FILES ${HEADER_FILES_COMMON} DESTINATION include)
install(FILES ${HEADER_FILES_GDEL3D} DESTINATION include/gDel3D)
install(FILES ${HEADER_FILES_CPU} DESTINATION include/gDel3D/CPU)
install(FILES ${HEADER_FILES_GPU} DESTINATION include/gDel3D/GPU)
#########################################################


6 changes: 3 additions & 3 deletions GDelFlipping/src/gDel3D/CommonTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ struct Tet

__forceinline__ __host__ __device__ int minIdx() const
{
int idx1 = min( _v[0], _v[1] );
int idx2 = min( _v[2], _v[3] );
int idx1 = min<int>( _v[0], _v[1] );
int idx2 = min<int>( _v[2], _v[3] );

return min( idx1, idx2 );
return min<int>( idx1, idx2 );
}
};

Expand Down
17 changes: 17 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

BUILD_TREE="build-release"
if [ -d ${BUILD_TREE} ]; then
rm -rf ${BUILD_TREE}
fi

mkdir -p ${BUILD_TREE}
pushd ${BUILD_TREE}

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/devsystem/dependencies/ubuntu16/gdel3d/gdel3d-1.0/" -DCUDA_TOOLKIT_ROOT_DIR="/devsystem/dependencies/ubuntu16/cuda/cuda-8.0/" -DCMAKE_POSITION_INDEPENDENT_CODE=True ..

make -j
make install

popd