Skip to content
This repository was archived by the owner on Aug 11, 2023. It is now read-only.

Conversation

@Vtec234
Copy link
Contributor

@Vtec234 Vtec234 commented Jul 6, 2017

No description provided.

cl::sycl::id<1> lID = item.get();
return cl::sycl::id<1>(group.get(0) * localR.get(0) + lID.get(0));
cl::sycl::id<1> localID = item.get();
return cl::sycl::id<1>(groupID.get(0) * localR.get(0) + localID.get(0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these types are actually useles if you use auto... :-)

Auto-nice-ifying is the way to go to avoid these kinds of errors...

/* We create a linear (one dimensional) group range, which
* creates a thread per element of the vector. */
* creates a work-item per element of the vector. */
auto groupRange = range<1>(nItems / nLocals);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can even replace all the () by {} in the constructors to be nicer and more modern.


/* Helper function to compute a globalID from a group and item in a
* hierarchical parallel_for_work_item context */
static inline cl::sycl::id<1> get_global_id(cl::sycl::group<1>& group,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a missing function from the specification?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is, and we have sent feedback to the Khronos group.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, I remember and Victor worked on this. I put this into triSYCL long time ago because it was obvious to me it was forgotten from the spec... :-(

@DuncanMcBain DuncanMcBain merged commit dcc3ae1 into codeplaysoftware:master Jul 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants