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

Dev/vossmjp/new examples #1517

Merged
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
5 changes: 4 additions & 1 deletion new_examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ include (CTest)
if (BUILD_TESTING)
enable_testing()
add_subdirectory(algorithms)
add_subdirectory(cancellation)
add_subdirectory(exception)
add_subdirectory(graph)
add_subdirectory(performance_tuning)
add_subdirectory(intro)
add_subdirectory(migration)
add_subdirectory(performance_tuning)
endif (BUILD_TESTING)

16 changes: 16 additions & 0 deletions new_examples/cancellation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -tbb")
set(CMAKE_CXX_LINKER_FLAGS "-tbb")

foreach(tpp cancel_group_execution1.cpp
cancel_group_execution2.cpp
cancel_group_execution3.cpp
cancel_group_execution4.cpp)
string(REPLACE ".cpp" "" texe ${tpp})
add_executable(${texe} ${tpp})
target_include_directories(${texe} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../common>
)
set_property(TARGET ${texe} PROPERTY CXX_STANDARD 20)
add_test(${texe} ${texe})
endforeach()

57 changes: 0 additions & 57 deletions new_examples/cancellation/Makefile

This file was deleted.

10 changes: 5 additions & 5 deletions new_examples/cancellation/cancel_group_execution3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ void SerialSearch(long begin, long end) {
}

void ParallelSearch(long begin, long end) {
//uncommenting the following line will speedup this program even more!
//if(g.is_group_execution_cancelled()) return;
//if(g.context().is_group_execution_cancelled()) return;
//if(g.is_current_task_group_canceling()) return;
if(g.is_canceling()) return;
// tbb::is_current_task_group_canceling()) calls the equivalent of
// <group we are in>.context().is_group_execution_cancelled()
// which is not accessible directly since the context method is
// protected (private to the class)
if(tbb::is_current_task_group_canceling()) return;
if((end-begin) < grainsize) { //cutoof equivalent
return SerialSearch(begin, end);
}
Expand Down
15 changes: 15 additions & 0 deletions new_examples/exception/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -tbb")
set(CMAKE_CXX_LINKER_FLAGS "-tbb")

foreach(tpp exception_catch1.cpp
exception_catch2.cpp
exception_catch3.cpp)
string(REPLACE ".cpp" "" texe ${tpp})
add_executable(${texe} ${tpp})
target_include_directories(${texe} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../common>
)
set_property(TARGET ${texe} PROPERTY CXX_STANDARD 20)
add_test(${texe} ${texe})
endforeach()

55 changes: 0 additions & 55 deletions new_examples/exception/Makefile

This file was deleted.

22 changes: 22 additions & 0 deletions new_examples/intro/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -tbb")
set(CMAKE_CXX_LINKER_FLAGS "-tbb")

foreach(tpp intro_pi.cpp
intro_pi_timing.cpp
intro_flowgraph.cpp
intro_gamma.cpp
intro_helloPSTL.cpp
intro_helloTBB.cpp
intro_parallel_for.cpp
intro_parallel_for_transform.cpp
intro_sidebar_functor.cpp
intro_sidebar_lambda.cpp)
string(REPLACE ".cpp" "" texe ${tpp})
add_executable(${texe} ${tpp})
target_include_directories(${texe} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../common>
)
set_property(TARGET ${texe} PROPERTY CXX_STANDARD 20)
add_test(${texe} ${texe})
endforeach()

Loading
Loading