]> https://gitweb.dealii.org/ - dealii.git/commitdiff
port workstream.h to oneAPI
authorMatthias Maier <tamiko@43-1.org>
Thu, 6 Jan 2022 13:13:41 +0000 (07:13 -0600)
committerMatthias Maier <tamiko@43-1.org>
Wed, 12 Jan 2022 10:19:14 +0000 (04:19 -0600)
include/deal.II/base/work_stream.h

index 8ff38fe85aa59547189d1dc025a1e22311898547..36f37ef88821762aa3eca4242a7013ef3021fd0f 100644 (file)
@@ -491,7 +491,12 @@ namespace WorkStream
                                         sample_scratch_data,
                                         sample_copy_data);
         auto tbb_item_stream_filter = tbb::make_filter<void, ItemType *>(
-          tbb::filter::serial, [&](tbb::flow_control &fc) -> ItemType * {
+#    ifdef DEAL_II_TBB_WITH_ONEAPI
+          tbb::filter_mode::serial_in_order,
+#    else
+          tbb::filter::serial,
+#    endif
+          [&](tbb::flow_control &fc) -> ItemType * {
             if (const auto item = iterator_range_to_item_stream.get_item())
               return item;
             else
@@ -502,7 +507,11 @@ namespace WorkStream
           });
 
         auto tbb_worker_filter = tbb::make_filter<ItemType *, ItemType *>(
+#    ifdef DEAL_II_TBB_WITH_ONEAPI
+          tbb::filter_mode::parallel,
+#    else
           tbb::filter::parallel,
+#    endif
           [worker =
              std::function<void(const Iterator &, ScratchData &, CopyData &)>(
                worker),
@@ -589,7 +598,11 @@ namespace WorkStream
           });
 
         auto tbb_copier_filter = tbb::make_filter<ItemType *, void>(
+#    ifdef DEAL_II_TBB_WITH_ONEAPI
+          tbb::filter_mode::serial_in_order,
+#    else
           tbb::filter::serial,
+#    endif
           [copier = std::function<void(const CopyData &)>(copier)](
             ItemType *current_item) {
             if (copier)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.