-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][ESIMD] Deprecate block_load/store, add simd::copy_from/to. #3572
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
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
464c23e
[SYCL][ESIMD] Deprecate block_load/store, add simd::copy_from/to.
kbobrovs 8ec7dea
address review comments
kbobrovs 5f0e1d0
clang format
kbobrovs 00bf14f
more review comments
kbobrovs 6f6752c
Review comments.
kbobrovs 9a4c3b6
fix test failures, remove duplicated string from deprecation message
kbobrovs 72cddd1
Fix line numbers in negative tests.
kbobrovs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
86 changes: 86 additions & 0 deletions
86
sycl/include/CL/sycl/INTEL/esimd/detail/esimd_sycl_util.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
//==------------- esimd_sycl_util.hpp - DPC++ Explicit SIMD API -----------==// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// Utility functions related to interaction with generic SYCL and used for | ||
// implementing Explicit SIMD APIs. | ||
//===----------------------------------------------------------------------===// | ||
|
||
#pragma once | ||
|
||
#include <CL/sycl/accessor.hpp> | ||
|
||
__SYCL_INLINE_NAMESPACE(cl) { | ||
namespace sycl { | ||
namespace INTEL { | ||
namespace gpu { | ||
namespace detail { | ||
|
||
// Checks that given type is a SYCL accessor type. Sets its static field | ||
// \c value accordingly. Also, if the check is succesful, sets \c mode and | ||
// \c target static fields to the accessor type's access mode and access target | ||
// respectively. Otherwise they are set to -1. | ||
template <typename T> struct is_sycl_accessor : public std::false_type { | ||
static constexpr sycl::access::mode mode = | ||
static_cast<sycl::access::mode>(-1); | ||
static constexpr sycl::access::target target = | ||
static_cast<sycl::access::target>(-1); | ||
}; | ||
|
||
template <typename DataT, int Dimensions, sycl::access::mode AccessMode, | ||
sycl::access::target AccessTarget, | ||
sycl::access::placeholder IsPlaceholder, typename PropertyListT> | ||
struct is_sycl_accessor<sycl::accessor< | ||
DataT, Dimensions, AccessMode, AccessTarget, IsPlaceholder, PropertyListT>> | ||
: public std::true_type { | ||
static constexpr sycl::access::mode mode = AccessMode; | ||
static constexpr sycl::access::target target = AccessTarget; | ||
}; | ||
|
||
using accessor_mode_cap_val_t = bool; | ||
|
||
// Denotes an accessor's capability - whether it can read or write. | ||
struct accessor_mode_cap { | ||
static inline constexpr accessor_mode_cap_val_t can_read = false; | ||
static inline constexpr accessor_mode_cap_val_t can_write = true; | ||
}; | ||
|
||
template <sycl::access::mode Mode, accessor_mode_cap_val_t Cap> | ||
constexpr bool accessor_mode_has_capability() { | ||
static_assert(Cap == accessor_mode_cap::can_read || | ||
Cap == accessor_mode_cap::can_write, | ||
"unsupported capability"); | ||
|
||
if constexpr (Mode == sycl::access::mode::atomic || | ||
Mode == sycl::access::mode::read_write || | ||
Mode == sycl::access::mode::discard_read_write) | ||
return true; // atomic and *read_write accessors can read/write | ||
|
||
return (Cap == accessor_mode_cap::can_read) == | ||
kbobrovs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
(Mode == sycl::access::mode::read); | ||
} | ||
|
||
// Checks that given type is a SYCL accessor type with given capability and | ||
// target. | ||
template <typename T, accessor_mode_cap_val_t Capability, | ||
sycl::access::target AccessTarget> | ||
struct is_sycl_accessor_with | ||
: public std::conditional_t< | ||
accessor_mode_has_capability<is_sycl_accessor<T>::mode, | ||
Capability>() && | ||
(is_sycl_accessor<T>::target == AccessTarget), | ||
std::true_type, std::false_type> {}; | ||
|
||
template <typename T, accessor_mode_cap_val_t Capability, | ||
sycl::access::target AccessTarget, typename RetT> | ||
using EnableIfAccessor = sycl::detail::enable_if_t< | ||
detail::is_sycl_accessor_with<T, Capability, AccessTarget>::value, RetT>; | ||
|
||
} // namespace detail | ||
} // namespace gpu | ||
} // namespace INTEL | ||
} // namespace sycl | ||
} // __SYCL_INLINE_NAMESPACE(cl) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.