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

Label all SYCL fences #4258

Merged
merged 4 commits into from
Aug 25, 2021
Merged

Conversation

masterleinad
Copy link
Contributor

Previously, the final level calling fence functions for SYCL didn't have labels. This pull request shifts the respective Profiling calls down.
This requires that USMObjectMem needs another identifier for the instance_id to report its fences. Also, the static fence can't really use the lowest level function anymore since we don't store the instance id with the queues. I decided to just copy the fence implementation for this case duplicating a few lines of code. Note that this case was treated in the Profiling interface separately already.

I also noticed that we use Kokkos::SYCL or Kokkos::Experimental::SYCL rather inconsistently in strings so I went for the latter everywhere since the majority of cases already used Kokkos::Experimental::SYCL.

@masterleinad masterleinad added this to In progress in Kokkos Release 3.5 via automation Aug 24, 2021
Copy link
Contributor

@DavidPoliakoff DavidPoliakoff left a comment

Choose a reason for hiding this comment

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

Looks fine by me

core/src/SYCL/Kokkos_SYCL.cpp Show resolved Hide resolved
@masterleinad masterleinad added this to Awaiting Feedback in Developer: Daniel Arndt Aug 25, 2021
@masterleinad masterleinad moved this from In progress to Awaiting Feedback in Kokkos Release 3.5 Aug 25, 2021

return m_scratchFlags;
}

template <typename WAT>
void SYCLInternal::fence_helper(WAT& wat, const std::string& name,
Copy link
Member

Choose a reason for hiding this comment

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

What does "wat" stand for?

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 @nliber meant it as an abbreviation for "wait and throw", implying that the template argument should be a type that implements wait_and_throw().

I was moving it here to escape circular header dependencies. We can discuss if not inlining this is problematic or not, of course.

Comment on lines +136 to +142
try {
(*queue)->wait_and_throw();
} catch (sycl::exception const& e) {
Kokkos::Impl::throw_runtime_exception(
std::string("There was a synchronous SYCL error:\n") +=
e.what());
}
Copy link
Member

Choose a reason for hiding this comment

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

Why are you not using SYCLInternal::fence_helper here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#4258 (comment) says

[...] Also, the static fence can't really use the lowest level function anymore since we don't store the instance id with the queues. I decided to just copy the fence implementation for this case duplicating a few lines of code. Note that this case was treated in the Profiling interface separately already.

@crtrott crtrott merged commit 0530271 into kokkos:develop Aug 25, 2021
Kokkos Release 3.5 automation moved this from Awaiting Feedback to Done Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Developer: Daniel Arndt
Awaiting Feedback
Development

Successfully merging this pull request may close these issues.

None yet

5 participants