-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] Image_accessor Host Implementation #271
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not clear that there is some concrete implementation as promised in the commit title.
Also a few remarks.
sycl/include/CL/sycl/accessor.hpp
Outdated
static_assert( | ||
AccessMode == access::mode::read || AccessMode == access::mode::write || | ||
AccessMode == access::mode::discard_write, | ||
"Access modes can be read/write/discard_write for image accessor."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Access modes can be read/write/discard_write for image accessor."); | |
"Access modes can be only read/write/discard_write for image accessor."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
sycl/include/CL/sycl/accessor.hpp
Outdated
"Dimensions can be 1/2/3 for image accessor."); | ||
|
||
template <bool B, class T = void> | ||
using enable_if_t = typename std::enable_if<B, T>::type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been centralized in detail::
now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, it's not done yet.
This refactoring is a part of #221, which is not merged yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So i'll keep the code as is then? We can do the change once #221 is checked in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#221 is checked in, so please, re-use existing alias.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
sycl/include/CL/sycl/accessor.hpp
Outdated
typename = enable_if_t<(Dims > 0 && Dims <= 3) && IsHostImageAcc>> | ||
image_accessor(image<Dims, AllocatorT> &ImageRef, int ImageElementSize) | ||
#ifdef __SYCL_DEVICE_ONLY__ | ||
{ // No constructor needed for the device side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually a constructor you are defining here...
Do you mean = delete;
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just change the comment to fit the goal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had similar issue with buffer accessor few months ago, removing '{ }' did not work because the constructor was needed even for DEVICE because the filtering of DEVICE code happened much later.
I don't remember the details.
Garima, did you try " = delete", or having ';' instead of '{ }' ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It reports the error when i try to use instantiate it.
error: call to deleted constructor of 'image_accessor
I'll edit the commit message to be more adherent to the code. You are right. |
Let me know if something else is needed for this review. |
APIs. - Enabled get_access methods in image class. - Base class for accessor to image/image_array/host_image access target for host compiler introduced with basic implementation. - Implemented a few APIs for Image accessors for host compiler - get_count and get_size. - Test code to be added after scheduler support is added for image class. Signed-off-by: Garima Gupta <garima.gupta@intel.com>
All my issues were resolved, but I'd like @romanovvlad to approve before merging.
access target for host compiler.
class.
Signed-off-by: Garima Gupta garima.gupta@intel.com