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][Graph] Add common reference semantics #16788

Open
wants to merge 4 commits into
base: sycl
Choose a base branch
from

Conversation

fabiomestre
Copy link
Contributor

Adds missing common reference semantic functionality such as operator==, operator!= and hash functions to all sycl graph related classes.

@fabiomestre fabiomestre force-pushed the fabio/common_reference_semantics branch from d1ac215 to 8a2571d Compare January 27, 2025 14:26
@fabiomestre fabiomestre force-pushed the fabio/common_reference_semantics branch from 8a2571d to e786630 Compare January 27, 2025 14:27
@fabiomestre fabiomestre marked this pull request as ready for review January 27, 2025 14:37
@fabiomestre fabiomestre requested a review from a team as a code owner January 27, 2025 14:37
@fabiomestre fabiomestre requested a review from Bensuo January 27, 2025 14:37
@fabiomestre fabiomestre force-pushed the fabio/common_reference_semantics branch from e786630 to c547e3f Compare January 27, 2025 14:41

size_t
std::hash<sycl::ext::oneapi::experimental::dynamic_command_group>::operator()(
const sycl::ext::oneapi::experimental::dynamic_command_group &DynamicCGH)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const sycl::ext::oneapi::experimental::dynamic_command_group &DynamicCGH)
const sycl::ext::oneapi::experimental::dynamic_command_group &DynamicCG)

Comment on lines 1123 to 1124
unsigned long long getID() { return MID; }

Copy link
Contributor

Choose a reason for hiding this comment

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

Think this function can be const, also applies to same function in other classes.

Comment on lines 1204 to 1206
unsigned long long MID;
inline static std::atomic<unsigned long long> NextAvailableID = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit but I think it's worth having a comment for these that they are only used for std::hash

@@ -17,7 +17,7 @@
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
#include <sycl/detail/string_view.hpp>
#endif
#include <sycl/device.hpp> // for device
#include <sycl/device.hpp> // for device
Copy link
Contributor

Choose a reason for hiding this comment

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

This formatting change doesn't seem to match the rest, are we sure it is correct?

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 ran clang-format on the file and it changed that line. But there is no point in changing that unrelated comment so I reverted that change.

@@ -0,0 +1,194 @@
//==----------------------- CommandGraph.cpp -------------------------------==//
Copy link
Contributor

Choose a reason for hiding this comment

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

CommonReferenceSemantics.cpp

sycl::queue Queue;
experimental::command_graph Graph(Queue.get_context(), Queue.get_device());

auto factory = [&]() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Factor more consistent variable naming

* @param objFactory A function object that returns an object to be tested.
*/
template <typename T, typename LambdaType>
void testSemantics(LambdaType &&objFactory) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
void testSemantics(LambdaType &&objFactory) {
void testSemantics(LambdaType &&ObjFactory) {

and the doxy comment

@EwanC EwanC changed the title Add common reference semantics to sycl graphs [SYCL][Graph] Add common reference semantics Jan 28, 2025
@fabiomestre fabiomestre requested a review from a team as a code owner January 29, 2025 14:42
Adds missing common reference semantic functionality such
as operator==, operator!= and hash functions to all
sycl graph related classes.
@fabiomestre fabiomestre force-pushed the fabio/common_reference_semantics branch from 1db12ad to 8c9c0ea Compare January 29, 2025 15:24
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