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

Consider providing conversions from agent types to indices #186

Open
jaredhoberock opened this issue Apr 22, 2016 · 0 comments
Open

Consider providing conversions from agent types to indices #186

jaredhoberock opened this issue Apr 22, 2016 · 0 comments

Comments

@jaredhoberock
Copy link
Collaborator

jaredhoberock commented Apr 22, 2016

Allowing execution agent types to convert to their indices might simplify very simple loops where the execution category of the agent is irrelevant:

A saxpy loop

bulk_invoke(par(n), [=](parallel_agent& self)
{
  auto i = self.index();
  z[i] = a * x[i] + y[i];
});

would become

bulk_invoke(par(n), [=](size_t idx)
{
  z[i] = a * x[i] + y[i];
});

The size of the agent's group would be lost, as well as functionality such as concurrent_agent::wait().

This also seems like it would be a little redundant with Intel's proposed for_loop control structure.

@jaredhoberock jaredhoberock added this to the Release0.X milestone Aug 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant