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

[SYCL] Fix an error on host when big image is used on opencl:gpu #4668

Merged
merged 1 commit into from
Oct 1, 2021

Conversation

v-klochkov
Copy link
Contributor

An exception was thrown on host because during the host allocation
the image seemed too big for host even though the target device
could process such big image. Because the limits to image height,
width,depth are arbitrary on HOST, they have been relaxed to MAX_INT.

The existing check for image sizes is still sufficient when image
is passed to device because the image parameters are verified twice:
one time for host and another time for device.

Signed-off-by: Vyacheslav N Klochkov vyacheslav.n.klochkov@intel.com

An exception was thrown on host because during the host allocation
the image seemed too big for host even though the target device
could process such big image. Because the limits to image height,
width,depth are arbitrary on HOST, they have been relaxed to MAX_INT.

The existing check for image sizes is still sufficient when image
is passed to device because the image parameters are verified twice:
one time for host and another time for device.

Signed-off-by: Vyacheslav N Klochkov <vyacheslav.n.klochkov@intel.com>
@v-klochkov v-klochkov requested a review from a team as a code owner September 29, 2021 16:41
@v-klochkov v-klochkov merged commit 3061bc7 into intel:sycl Oct 1, 2021
@v-klochkov v-klochkov deleted the image_size_check branch October 1, 2021 05:36
alexbatashev added a commit to alexbatashev/llvm that referenced this pull request Oct 3, 2021
* sycl: (108 commits)
  [SYCL][XPTI] Revisit resource management strategy (intel#4494)
  [SYCL][ESIMD] Fix misprint: ESIMD_L1_FLUASH_RO_DATA -> ESIMD_L1_FLUSH_RO_DATA (intel#4681)
  [SYCL] Make kernel_bundle interop more conformant (intel#4672)
  [SYCL] Submission with kernel parameter ignores set kernel bundle (intel#4667)
  [SYCL] Add support for std::byte to vec class  (intel#4637)
  [BuildBot] Uplift CPU/FPGAEMU RT version for CI Process (intel#4671)
  [SYCL] Fix an error on host when big image is used on opencl:gpu (intel#4668)
  [SYCL] Exclude exported symbols from kernel bundles (intel#4660)
  Revert "[SYCL] Allow overriding plugin libraries (intel#4067)" (intel#4659)
  [SYCL] Handle exceptions on mutually exclusive handler operations (intel#4639)
  [sycl-post-link] Don't split module if function pointer has a user that's not CallInst (intel#4657)
  [SYCL][HIP] Fix MemBufferFill for nvidia platform (intel#4629)
  [SYCL][Doc] Describe DPC++ CUDA install w/ non-standard toolkit loc (intel#4663)
  [SYCL] Fix device code instrumentation (intel#4615)
  Remove myself as a code owner (intel#4653)
  [SYCL] Fix overwriting insert to sub_group_mask (intel#4656)
  [x86][Matrix] Replace packed_a with row_major in matrix testcases (intel#4641)
  [SYCL][Doc] Add device global extension spec (intel#4233)
  [sycl-post-link] Adds property listing exported functions (intel#4626)
  [Driver][SYCL] Do not consider non-archive files for FPGA binary checks (intel#4644)
  ...
alexbatashev added a commit to alexbatashev/llvm that referenced this pull request Oct 3, 2021
* sycl: (107 commits)
  [SYCL][XPTI] Revisit resource management strategy (intel#4494)
  [SYCL][ESIMD] Fix misprint: ESIMD_L1_FLUASH_RO_DATA -> ESIMD_L1_FLUSH_RO_DATA (intel#4681)
  [SYCL] Make kernel_bundle interop more conformant (intel#4672)
  [SYCL] Submission with kernel parameter ignores set kernel bundle (intel#4667)
  [SYCL] Add support for std::byte to vec class  (intel#4637)
  [BuildBot] Uplift CPU/FPGAEMU RT version for CI Process (intel#4671)
  [SYCL] Fix an error on host when big image is used on opencl:gpu (intel#4668)
  [SYCL] Exclude exported symbols from kernel bundles (intel#4660)
  Revert "[SYCL] Allow overriding plugin libraries (intel#4067)" (intel#4659)
  [SYCL] Handle exceptions on mutually exclusive handler operations (intel#4639)
  [sycl-post-link] Don't split module if function pointer has a user that's not CallInst (intel#4657)
  [SYCL][HIP] Fix MemBufferFill for nvidia platform (intel#4629)
  [SYCL][Doc] Describe DPC++ CUDA install w/ non-standard toolkit loc (intel#4663)
  [SYCL] Fix device code instrumentation (intel#4615)
  Remove myself as a code owner (intel#4653)
  [SYCL] Fix overwriting insert to sub_group_mask (intel#4656)
  [x86][Matrix] Replace packed_a with row_major in matrix testcases (intel#4641)
  [SYCL][Doc] Add device global extension spec (intel#4233)
  [sycl-post-link] Adds property listing exported functions (intel#4626)
  [Driver][SYCL] Do not consider non-archive files for FPGA binary checks (intel#4644)
  ...
// query, thus it becomes user's responsibility to choose proper image
// parameters depending on similar query to (non-host device) and amount
// of available/allocatable memory.
return INT_MAX;
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be std::numeric_limits<std::size_t>::max().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, done in #4699

v-klochkov added a commit to v-klochkov/llvm-test-suite that referenced this pull request Oct 4, 2021
The corresponding fix in SYCL: intel/llvm/pull/4668

Signed-off-by: Vyacheslav N Klochkov <vyacheslav.n.klochkov@intel.com>
v-klochkov added a commit to intel/llvm-test-suite that referenced this pull request Oct 5, 2021
* [SYCL] Add a test for images having max sizes

The corresponding fix in SYCL: intel/llvm/pull/4668

Signed-off-by: Vyacheslav N Klochkov <vyacheslav.n.klochkov@intel.com>
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
)

* [SYCL] Add a test for images having max sizes

The corresponding fix in SYCL: intel/pull/4668

Signed-off-by: Vyacheslav N Klochkov <vyacheslav.n.klochkov@intel.com>
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.

3 participants