feat(linear-static-3d-euler-beam): step 17 - parallel-for-tbb
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <functional>
|
||||
|
||||
namespace fesa {
|
||||
|
||||
// Executes independent index-addressed work without exposing the backend.
|
||||
// Callers own output storage and must confine each invocation to its index.
|
||||
class ParallelFor {
|
||||
public:
|
||||
virtual ~ParallelFor() = default;
|
||||
virtual void execute(
|
||||
std::size_t count,
|
||||
const std::function<void(std::size_t)>& body) const = 0;
|
||||
};
|
||||
|
||||
class SerialParallelFor final : public ParallelFor {
|
||||
public:
|
||||
void execute(
|
||||
std::size_t count,
|
||||
const std::function<void(std::size_t)>& body) const override;
|
||||
};
|
||||
|
||||
class TbbParallelFor final : public ParallelFor {
|
||||
public:
|
||||
void execute(
|
||||
std::size_t count,
|
||||
const std::function<void(std::size_t)>& body) const override;
|
||||
};
|
||||
|
||||
} // namespace fesa
|
||||
Reference in New Issue
Block a user