Commit 6f3cd952 authored by Quentin Khan's avatar Quentin Khan
Browse files

FAdaptiveTask: add comments to dependency management

parent 6c4cedd5
......@@ -70,12 +70,29 @@ protected:
/** \brief Fallback if both other overloads are deleted by SFINAE */
void setup_kernel(...) {}
* \brief Data pool for mock dependency
* Generates addresses that can be used as OpenMP task dependencies. To do
* so, a list of char arrays (buckets) is created. Each char is a potential
* dependency. When an array is exhausted, an new one is appended to the
* list.
struct mock_dependency {
constexpr static const std::size_t bucket_size = 512;
/// Size of a bucket
enum : std::size_t {bucket_size = 512};
/// List of buckets. A bucket is implented as an array
std::list<std::array<char, bucket_size>> pool;
/// Index of the next dependency to hand out in the current bucket
std::size_t mock_dependency_index = bucket_size;
/// Yield a new dependency
char* next() {
// When the bucket is empty, add a new one
if(bucket_size == mock_dependency_index) {
mock_dependency_index = 0;
return (char*) (&(this->pool.back()[mock_dependency_index++]));
} mock_dep;
......@@ -93,7 +110,8 @@ protected:
/** \brief Get pointer to node ressource handling given dependency
* \brief Get pointer to node ressource handling given dependency type
* OpenMP task dependencies do not need to be correlated with real data,
* they only need to point to the same area in memory. This method maps a
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment