Skip to content

Conversation

@sergey-semenov
Copy link
Contributor

No description provided.

Comment on lines 530 to +532
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
/// \return a string containing name of SYCL kernel.
detail::ABINeutralKernelNameStrT getKernelName();
detail::string_view getKernelName();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why aren't you dropping this entire #ifndef?

std::vector<detail::LocalAccessorImplPtr> MLocalAccStorage;
std::vector<std::shared_ptr<detail::stream_impl>> MStreamStorage;
detail::ABINeutralKernelNameStrT MKernelName;
detail::string_view MKernelName;
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
detail::string_view MKernelName;
// std::string_view ABI differs under `-D_GLIBCXX_USE_CXX11_ABI=0`,
// use our implementation:
detail::string_view MKernelName;

// possible.
#endif
decltype(auto) KernelName = KernelNameStrRefT{DeviceKernelInfo.Name};
decltype(auto) KernelName = std::string_view{DeviceKernelInfo.Name};
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
decltype(auto) KernelName = std::string_view{DeviceKernelInfo.Name};
std::string_view KernelName = DeviceKernelInfo.Name;

auto [Iter, Inserted] =
m_DeviceKernelInfoMap.try_emplace(KernelNameStrT{Info.Name.data()}, Info);
auto [Iter, Inserted] = m_DeviceKernelInfoMap.try_emplace(
std::string_view{Info.Name.data()}, Info);
Copy link
Contributor

Choose a reason for hiding this comment

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

I had tried to add detail::string_view::operator std::string_view but it resulted in ambiguities with some comparison operators (I think). Now that we can remove old ones, maybe a better fix would be to change detail::string_view to have this conversion and rely on it happening implicitly for comparisons.

size_t size() const { return MDeviceGlobals.size(); }

size_t count(const KernelNameStrT &UniqueId) const {
size_t count(const std::string_view &UniqueId) const {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why const reference?

#include <sycl/detail/kernel_name_str_t.hpp>
#include <sycl/kernel_bundle.hpp>

#include <cstring>
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm somewhat surprised we need this.

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.

2 participants