Skip to content

How to spawn a range of tasks? #4

@cheng-hsiang-chiu

Description

@cheng-hsiang-chiu

Hello,

Is it possible to spawn a range of tasks? In my application, I need to spawn tasks based on some runtime conditions. I would like to spawn tasks as the following pseudo code,

std::vector<tasks> TASKS = {t0, t1};
if (condition) TASKS.push_back(t2);

for (auto t : TASKS) {
      cilk_spawn t;
}

or the following(preferred),

cilk_spawn TASKS.begin() TASKS.end()

I did not find similar examples. Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions