Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiomestre committed Jan 29, 2025
1 parent eb2f79b commit 8c9c0ea
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sycl/include/sycl/ext/oneapi/experimental/graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
#include <sycl/ext/oneapi/experimental/detail/properties/graph_properties.hpp> // for graph properties classes
#include <sycl/nd_range.hpp> // for range, nd_range
#include <sycl/properties/property_traits.hpp> // for is_property, is_property_of
Expand Down
4 changes: 2 additions & 2 deletions sycl/source/detail/graph_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2171,8 +2171,8 @@ size_t std::hash<sycl::ext::oneapi::experimental::node>::operator()(

size_t
std::hash<sycl::ext::oneapi::experimental::dynamic_command_group>::operator()(
const sycl::ext::oneapi::experimental::dynamic_command_group &DynamicCGH)
const sycl::ext::oneapi::experimental::dynamic_command_group &DynamicCG)
const {
auto ID = sycl::detail::getSyclObjImpl(DynamicCGH)->getID();
auto ID = sycl::detail::getSyclObjImpl(DynamicCG)->getID();
return std::hash<decltype(ID)>()(ID);
}
12 changes: 8 additions & 4 deletions sycl/source/detail/graph_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ class graph_impl : public std::enable_shared_from_this<graph_impl> {
return MBarrierDependencyMap[Queue];
}

unsigned long long getID() { return MID; }
unsigned long long getID() const { return MID; }

private:
/// Iterate over the graph depth-first and run \p NodeFunc on each node.
Expand Down Expand Up @@ -1202,6 +1202,7 @@ class graph_impl : public std::enable_shared_from_this<graph_impl> {
MBarrierDependencyMap;

unsigned long long MID;
// Used for std::hash in order to create a unique hash for the instance.
inline static std::atomic<unsigned long long> NextAvailableID = 0;
};

Expand Down Expand Up @@ -1302,7 +1303,7 @@ class exec_graph_impl {

void updateImpl(std::shared_ptr<node_impl> NodeImpl);

unsigned long long getID() { return MID; }
unsigned long long getID() const { return MID; }

private:
/// Create a command-group for the node and add it to command-buffer by going
Expand Down Expand Up @@ -1417,6 +1418,7 @@ class exec_graph_impl {
std::multimap<node_impl::id_type, std::shared_ptr<node_impl>> MIDCache;

unsigned long long MID;
// Used for std::hash in order to create a unique hash for the instance.
inline static std::atomic<unsigned long long> NextAvailableID = 0;
};

Expand Down Expand Up @@ -1505,7 +1507,7 @@ class dynamic_parameter_impl {
int ArgIndex,
const sycl::detail::AccessorBaseHost *Acc);

unsigned long long getID() { return MID; }
unsigned long long getID() const { return MID; }

// Weak ptrs to node_impls which will be updated
std::vector<std::pair<std::weak_ptr<node_impl>, int>> MNodes;
Expand All @@ -1517,6 +1519,7 @@ class dynamic_parameter_impl {

private:
unsigned long long MID;
// Used for std::hash in order to create a unique hash for the instance.
inline static std::atomic<unsigned long long> NextAvailableID = 0;
};

Expand Down Expand Up @@ -1559,10 +1562,11 @@ class dynamic_command_group_impl
/// List of nodes using this dynamic command-group.
std::vector<std::weak_ptr<node_impl>> MNodes;

unsigned long long getID() { return MID; }
unsigned long long getID() const { return MID; }

private:
unsigned long long MID;
// Used for std::hash in order to create a unique hash for the instance.
inline static std::atomic<unsigned long long> NextAvailableID = 0;
};
} // namespace detail
Expand Down
6 changes: 6 additions & 0 deletions sycl/test/abi/sycl_symbols_windows.dump
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,12 @@
??0dynamic_parameter_base@detail@experimental@oneapi@ext@_V1@sycl@@QEAA@$$QEAV0123456@@Z
??0dynamic_parameter_base@detail@experimental@oneapi@ext@_V1@sycl@@QEAA@AEBV0123456@@Z
??0dynamic_parameter_base@detail@experimental@oneapi@ext@_V1@sycl@@QEAA@V?$command_graph@$0A@@23456@_KPEBX@Z
??4?$hash@Vdynamic_command_group@experimental@oneapi@ext@_V1@sycl@@@std@@QEAAAEAU01@AEBU01@@Z
??4?$hash@Vdynamic_command_group@experimental@oneapi@ext@_V1@sycl@@@std@@QEAAAEAU01@$$QEAU01@@Z
??R?$hash@Vdynamic_command_group@experimental@oneapi@ext@_V1@sycl@@@std@@QEBA_KAEBVdynamic_command_group@experimental@oneapi@ext@_V1@sycl@@@Z
??R?$hash@Vnode@experimental@oneapi@ext@_V1@sycl@@@std@@QEBA_KAEBVnode@experimental@oneapi@ext@_V1@sycl@@@Z
??4?$hash@Vnode@experimental@oneapi@ext@_V1@sycl@@@std@@QEAAAEAU01@$$QEAU01@@Z
??4?$hash@Vnode@experimental@oneapi@ext@_V1@sycl@@@std@@QEAAAEAU01@AEBU01@@Z
??0event@_V1@sycl@@AEAA@V?$shared_ptr@Vevent_impl@detail@_V1@sycl@@@std@@@Z
??0event@_V1@sycl@@QEAA@$$QEAV012@@Z
??0event@_V1@sycl@@QEAA@AEBV012@@Z
Expand Down

0 comments on commit 8c9c0ea

Please sign in to comment.