.reference

git-svn-id: svn://ultimatepp.org/upp/trunk@10643 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2017-01-05 07:37:06 +00:00
parent 5997aa0277
commit 8fce75becd
4 changed files with 16 additions and 5 deletions

View file

@ -7,7 +7,7 @@ struct Model { // some computation model that is not stateless, abstract definit
virtual int Compute() = 0;
};
struct Model1 : Model { // concrete model (there would be more)
struct Model1 : Model { // concrete model (there would be more that this one)
int n;
virtual void Start(int i) { n = i; }
@ -19,9 +19,11 @@ CONSOLE_APP_MAIN
Vector<int> data;
data.SetCount(3000);
// generate data using some model:
CoWorkerResources<One<Model>> res;
for(auto& r : res)
r.Create<Model1>();
r.Create<Model1>(); // all should be the same
CoPartition(0, data.GetCount(), [&data, &res](int l, int h) {
Model& m = *~res; // gets resource unique for worker