Skip to content

Commit

Permalink
Merge pull request #244 from cgogn/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
pierrekraemer authored Sep 26, 2016
2 parents 4a8be03 + a49e5d9 commit b70bc86
Show file tree
Hide file tree
Showing 681 changed files with 537,479 additions and 46,340 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
Expand Down
19 changes: 2 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ set(CGOGN_SOURCE_DIR ${CGOGN_PATH})

### External Templates
option(CGOGN_EXTERNAL_TEMPLATES "Use external templates to reduce compile time" OFF)
if(${CGOGN_EXTERNAL_TEMPLATES})
add_definitions("-DCGOGN_USE_EXTERNAL_TEMPLATES")
endif()

#### ThirdParty options
set(CGOGN_THIRDPARTY_DIR ${CGOGN_PATH}/thirdparty)
Expand All @@ -62,11 +59,6 @@ if (${CGOGN_USE_PARALLEL_GLIBCXX})
set(CGOGN_USE_OPENMP "ON")
endif()
option(CGOGN_USE_QT "use Qt (5.4 min) for interface & rendering" ON)
option(CGOGN_WITH_CGAL_EXAMPLES "Build the examples using cgal for mesh generation." OFF)
if ((NOT MSVC) AND CGOGN_WITH_CGAL_EXAMPLES)
set(CGOGN_USE_GLIBCXX_DEBUG OFF)
set(CGOGN_USE_GLIBCXX_DEBUG_PEDANTIC OFF)
endif()

#### Continuous integration options
option(CGOGN_WITH_GPROF "Builds the project for performance analysis with gprof" OFF)
Expand Down Expand Up @@ -121,13 +113,6 @@ endif(CGOGN_BUILD_TESTS)
#### Endianness detection
include (TestBigEndian)
test_big_endian(CGOGN_TEST_BIG_ENDIAN)
add_definitions("-DCGOGN_LITTLE_ENDIAN=1234")
add_definitions("-DCGOGN_BIG_ENDIAN=4321")
if(${CGOGN_TEST_BIG_ENDIAN})
add_definitions("-DCGOGN_ENDIANNESS=CGOGN_BIG_ENDIAN")
else()
add_definitions("-DCGOGN_ENDIANNESS=CGOGN_LITTLE_ENDIAN")
endif()

#### Link time optimisation
if (CGOGN_ENABLE_LTO AND ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") AND (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug"))
Expand Down Expand Up @@ -162,9 +147,9 @@ if(CGOGN_BUILD_EXAMPLES)
add_subdirectory(cgogn/core/examples)
add_subdirectory(cgogn/geometry/examples)
add_subdirectory(cgogn/io/examples)
add_subdirectory(cgogn/io/mesh_generation/examples)
add_subdirectory(cgogn/modeling/examples)
add_subdirectory(cgogn/rendering/examples)
add_subdirectory(cgogn/topology/examples)
endif()


Expand All @@ -175,7 +160,7 @@ ENABLE_COVERAGE_REPORT(TARGETS ${CGOGN_SOURCE_DIR})

# --- CPPCheck ---
GENERATE_CPPCHECK( SOURCES ${CGOGN_SOURCE_DIR}
ENABLE_IDS all
ENABLE_IDS all
INCLUDES ${CGOGN_SOURCE_DIR}
PLATFORM_FLAGS "-UNDEBUG -UWIN32 -U__func__ -U__FUNCTION__ -U__GNUG__ -U__clang__ -U_MSC_VER"
SYSTEM_INCLUDE_WARNING_SUPPRESSION
Expand Down
6 changes: 6 additions & 0 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
set(CGOGN_TEST_MESHES_PATH "${CMAKE_SOURCE_DIR}/data/meshes/")
add_definitions("-DCGOGN_TEST_MESHES_PATH=${CGOGN_TEST_MESHES_PATH}")

add_subdirectory(multithreading)
add_subdirectory(tri_map)
add_subdirectory(quad_map)
add_subdirectory(tetra_map)
8 changes: 5 additions & 3 deletions benchmarks/multithreading/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ project(bench_multithreading
LANGUAGES CXX
)

set(CGOGN_TEST_MESHES_PATH "${CMAKE_SOURCE_DIR}/data/meshes/")
add_definitions("-DCGOGN_TEST_MESHES_PATH=${CGOGN_TEST_MESHES_PATH}")
find_package(cgogn_core REQUIRED)
find_package(cgogn_io REQUIRED)
find_package(cgogn_geometry REQUIRED)
find_package(benchmark REQUIRED)

add_executable(${PROJECT_NAME} bench_multithreading.cpp)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/thirdparty/google-benchmark/include)
target_link_libraries(${PROJECT_NAME} cgogn_core cgogn_io cgogn_geometry benchmark)
target_link_libraries(${PROJECT_NAME} ${cgogn_core_LIBRARIES} ${cgogn_io_LIBRARIES} ${cgogn_geometry_LIBRARIES} ${benchmark_LIBRARIES})
27 changes: 13 additions & 14 deletions benchmarks/multithreading/bench_multithreading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static void BENCH_Dart_count_multi_threaded(benchmark::State& state)
while (state.KeepRunning())
{
uint32 nb_darts_2 = 0u;
std::vector<uint32> nb_darts_per_thread(cgogn::get_nb_threads()+2);
std::vector<uint32> nb_darts_per_thread(cgogn::nb_threads() + 2);
for (auto& n : nb_darts_per_thread)
n = 0u;
nb_darts_2 = 0u;
Expand All @@ -84,7 +84,7 @@ static void BENCH_Dart_count_multi_threaded(benchmark::State& state)
}
}

template<cgogn::TraversalStrategy STRATEGY>
template <cgogn::TraversalStrategy STRATEGY>
static void BENCH_faces_normals_single_threaded(benchmark::State& state)
{
while(state.KeepRunning())
Expand All @@ -98,7 +98,7 @@ static void BENCH_faces_normals_single_threaded(benchmark::State& state)

bench_map.template foreach_cell<STRATEGY>([&] (Face f)
{
face_normal[f] = cgogn::geometry::face_normal<Vec3>(bench_map, f, vertex_position);
face_normal[f] = cgogn::geometry::normal<Vec3>(bench_map, f, vertex_position);
});
}
}
Expand All @@ -119,13 +119,13 @@ static void BENCH_faces_normals_cache_single_threaded(benchmark::State& state)

bench_map.foreach_cell([&] (Face f)
{
face_normal[f] = cgogn::geometry::face_normal<Vec3>(bench_map, f, vertex_position);
face_normal[f] = cgogn::geometry::normal<Vec3>(bench_map, f, vertex_position);
},
cache);
}
}

template<cgogn::TraversalStrategy STRATEGY>
template <cgogn::TraversalStrategy STRATEGY>
static void BENCH_faces_normals_multi_threaded(benchmark::State& state)
{
while(state.KeepRunning())
Expand All @@ -139,7 +139,7 @@ static void BENCH_faces_normals_multi_threaded(benchmark::State& state)

bench_map.template parallel_foreach_cell<STRATEGY>([&] (Face f, uint32)
{
face_normal_mt[f] = cgogn::geometry::face_normal<Vec3>(bench_map, f, vertex_position);
face_normal_mt[f] = cgogn::geometry::normal<Vec3>(bench_map, f, vertex_position);
});

{
Expand Down Expand Up @@ -178,14 +178,14 @@ static void BENCH_faces_normals_cache_multi_threaded(benchmark::State& state)

bench_map.parallel_foreach_cell([&] (Face f, uint32)
{
face_normal[f] = cgogn::geometry::face_normal<Vec3>(bench_map, f, vertex_position);
face_normal[f] = cgogn::geometry::normal<Vec3>(bench_map, f, vertex_position);
},
cache);
}
}


template<cgogn::TraversalStrategy STRATEGY>
template <cgogn::TraversalStrategy STRATEGY>
static void BENCH_vertices_normals_single_threaded(benchmark::State& state)
{
while(state.KeepRunning())
Expand All @@ -199,7 +199,7 @@ static void BENCH_vertices_normals_single_threaded(benchmark::State& state)

bench_map.template foreach_cell<STRATEGY>([&] (Vertex v)
{
vertices_normal[v] = cgogn::geometry::vertex_normal<Vec3>(bench_map, v, vertex_position);
vertices_normal[v] = cgogn::geometry::normal<Vec3>(bench_map, v, vertex_position);
});
}
}
Expand All @@ -220,13 +220,13 @@ static void BENCH_vertices_normals_cache_single_threaded(benchmark::State& state

bench_map.foreach_cell([&] (Vertex v)
{
vertices_normal[v] = cgogn::geometry::vertex_normal<Vec3>(bench_map, v, vertex_position);
vertices_normal[v] = cgogn::geometry::normal<Vec3>(bench_map, v, vertex_position);
},
cache);
}
}

template<cgogn::TraversalStrategy STRATEGY>
template <cgogn::TraversalStrategy STRATEGY>
static void BENCH_vertices_normals_multi_threaded(benchmark::State& state)
{
while(state.KeepRunning())
Expand All @@ -240,7 +240,7 @@ static void BENCH_vertices_normals_multi_threaded(benchmark::State& state)

bench_map.template parallel_foreach_cell<STRATEGY>([&] (Vertex v, uint32)
{
vertices_normal_mt[v] = cgogn::geometry::vertex_normal<Vec3>(bench_map, v, vertex_position);
vertices_normal_mt[v] = cgogn::geometry::normal<Vec3>(bench_map, v, vertex_position);
});

{
Expand Down Expand Up @@ -279,7 +279,7 @@ static void BENCH_vertices_normals_cache_multi_threaded(benchmark::State& state)

bench_map.parallel_foreach_cell([&] (Vertex v, uint32)
{
vertices_normal[v] = cgogn::geometry::vertex_normal<Vec3>(bench_map, v, vertex_position);
vertices_normal[v] = cgogn::geometry::normal<Vec3>(bench_map, v, vertex_position);
},
cache);
}
Expand Down Expand Up @@ -327,4 +327,3 @@ int main(int argc, char** argv)
::benchmark::RunSpecifiedBenchmarks();
return 0;
}

14 changes: 14 additions & 0 deletions benchmarks/quad_map/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)

project(bench_quad_map
LANGUAGES CXX
)

find_package(cgogn_core REQUIRED)
find_package(cgogn_io REQUIRED)
find_package(cgogn_geometry REQUIRED)
find_package(benchmark REQUIRED)

add_executable(${PROJECT_NAME} bench_quad_map.cpp)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/thirdparty/google-benchmark/include)
target_link_libraries(${PROJECT_NAME} ${cgogn_core_LIBRARIES} ${cgogn_io_LIBRARIES} ${cgogn_geometry_LIBRARIES} ${benchmark_LIBRARIES})
Loading

0 comments on commit b70bc86

Please sign in to comment.