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

Support more image_channel_types in image_accessors read/write API for half4 datatype on host device. #1502

Merged
merged 8 commits into from
Apr 22, 2020

Conversation

garimagu
Copy link
Contributor

@garimagu garimagu commented Apr 11, 2020

Also, clean up done of image_accessor_readwrite test to enable it for GPU.

sycl/include/CL/sycl/detail/image_accessor_util.hpp Outdated Show resolved Hide resolved
sycl/include/CL/sycl/detail/image_accessor_util.hpp Outdated Show resolved Hide resolved
int main() {
// Checking only for dimension=1.
// create image:
char HostPtr[100];
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest using std::array with size = sizeof(sycl::cl_half4). And avoid using magic number on line 99 and 80.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you are referring to range<1>{10} as the magic number.
The number of bytes needed in HostPtr is related to the image Element size . (See function: getImageElementSize () in image_impl.cpp )
With image of order rgba , with channel_type::fp16, each image element will take 8 bytes.
With image of order rgba, with channel_type::snorm_int8, each image element will take 4 bytes.
So when range is 10, We will need a total of 80 bytes (40 bytes for second case) in HostPtr and to safely write/read all elements.
You are right that 10 is a random number taken. The value of 100 is more of a safe limit taken. To make it exact I will have to initialize it for each image kind separately.

sycl/test/basic_tests/image_accessor_readwrite_half.cpp Outdated Show resolved Hide resolved
… API for

half4 datatype on host device.

Signed-off-by: Garima Gupta <garima.gupta@intel.com>
Enabled it for GPU.

Signed-off-by: Garima Gupta <garima.gupta@intel.com>
Signed-off-by: Garima Gupta <garima.gupta@intel.com>
Signed-off-by: Garima Gupta <garima.gupta@intel.com>
Signed-off-by: Garima Gupta <garima.gupta@intel.com>
Signed-off-by: Garima Gupta <garima.gupta@intel.com>
fp16.

Signed-off-by: Garima Gupta <garima.gupta@intel.com>
Signed-off-by: Garima Gupta <garima.gupta@intel.com>
@garimagu garimagu force-pushed the halfdatatype_host_accessor branch from edd3f55 to 7d48115 Compare April 15, 2020 17:10
@garimagu
Copy link
Contributor Author

@AlexeySachkov @romanovvlad Let me know if you feel something is further needed in this PR.

@garimagu
Copy link
Contributor Author

@romanovvlad Hi Vlad, Please have a quick look whenever you get sometime.

@garimagu
Copy link
Contributor Author

@romanovvlad @AlexeySachkov @bader
Please let me know if something is missing in this?

@bader bader merged commit 9b1d8b8 into intel:sycl Apr 22, 2020
alexbatashev pushed a commit to alexbatashev/llvm that referenced this pull request Apr 29, 2020
…versioning

* origin/sycl:
  [XPTI][Framework] Reference implementation of the Xpti framework to be used with instrumentation in SYCL (intel#1557)
  [SYCL] Initial ABI checks implementation (intel#1528)
  [SYCL] Support connection with multiple plugins (intel#1490)
  [SYCL] Add a new header file with the reduction class definition (intel#1558)
  [SYCL] Add test for SYCL kernels with accessor and spec constant (intel#1536)
  [SYCL][CUDA] Move interop tests (intel#1570)
  [Driver][SYCL] Remove COFF object format designator for Windows device compiles (intel#1574)
  [SYCL] Fix conflicting visibility attributes (intel#1571)
  [SYCL][DOC] Update the SYCL Runtime Interface document with design details (intel#680)
  [SYCL] Improve image accessors support on a host device (intel#1502)
  [SYCL] Make queue's non-USM event ownership temporary (intel#1561)
  [SYCL] Added support of rounding modes for non-host devices (intel#1463)
  [SYCL] SemaSYCL significant refactoring (intel#1517)
  [SYCL] Support 0-dim accessor in handler::copy(accessor, accessor) (intel#1551)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants