Skip to content

Commit

Permalink
Merge pull request #584 from Pennycook/fix-random-filler
Browse files Browse the repository at this point in the history
Fix typos in RandomFiller example
  • Loading branch information
tomdeakin authored Jul 18, 2024
1 parent e508252 commit e9d7d58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions adoc/code/myfunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ class RandomFiller {
randomNum_ = r(hwRand);
}
void operator()(item<1> item) const { ptr_[item.get_id()] = get_random(); }
int get_random() { return randomNum_; }
int get_random() const { return randomNum_; }

private:
accessor<int> ptr_;
int randomNum_;
};

void workFunction(buffer<int, 1>& b, queue& q, const range<1> r) {
myQueue.submit([&](handler& cgh) {
accessor ptr { buf, cgh };
q.submit([&](handler& cgh) {
accessor ptr { b, cgh };
RandomFiller filler { ptr };

cgh.parallel_for(r, filler);
Expand Down

0 comments on commit e9d7d58

Please sign in to comment.