Skip to content

[SYCL-MLIR]: Runtime workaround for paralllel_for #7303

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

Merged
merged 4 commits into from
Nov 7, 2022

Conversation

etiotto
Copy link

@etiotto etiotto commented Nov 7, 2022

The following test case (using a SYCL parallel_for) fails to run correctly due to a SYCL RT function (dim_loop_impl) which uses a complex templated implementation which "confuses" cgeist. As a workaround we can use the older SYCL RT implementation which used a regular for loop.

Test case:

void host_parallel_for(std::array<int, N> &A) {
  auto q = queue{};
  device d = q.get_device();
  std::cout << "Using " << d.get_info<info::device::name>() << "\n";
  auto range = sycl::range<1>{N};

  {
    auto buf = buffer<int, 1>{A.data(), range};
    q.submit([&](handler &cgh) {
      auto A = buf.get_access<access::mode::write>(cgh);
      cgh.parallel_for<class kernel_parallel_for>(
          range, [=](sycl::id<1> id) { A[3] = 33; });
    });
  }
}

@etiotto etiotto added the sycl-mlir Pull requests or issues for sycl-mlir branch label Nov 7, 2022
@etiotto etiotto self-assigned this Nov 7, 2022
@etiotto
Copy link
Author

etiotto commented Nov 7, 2022

Note: The original clang-format for the RT file I modifies was incorrect. I did not want to push changes related to code formatting so that is the reason the linting job fails.

All SYCL unit tests pass with this RT change.

@etiotto etiotto requested a review from victor-eds November 7, 2022 16:43
Signed-off-by: Tiotto, Ettore <[email protected]>
Copy link
Contributor

@victor-eds victor-eds left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Tiotto, Ettore <[email protected]>
@etiotto etiotto merged commit e74334e into intel:sycl-mlir Nov 7, 2022
@etiotto etiotto deleted the rt_workaround branch November 7, 2022 16:54
@victor-eds
Copy link
Contributor

@etiotto Pipeline is failing here

@whitneywhtsang
Copy link
Contributor

@etiotto Pipeline is failing here

Fixed by #7306.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sycl-mlir Pull requests or issues for sycl-mlir branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants