Skip to content

Commit 6b7052d

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web' (12 commits)
2 parents 8dde7c4 + ca92dc1 commit 6b7052d

40 files changed

+656
-603
lines changed

.github/workflows/sycl-linux-precommit.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
- '.github/workflows/sycl-macos-*.yml'
2323
- '.github/workflows/sycl-nightly.yml'
2424
- '.github/workflows/sycl-rel-nightly.yml'
25+
- '.github/workflows/sycl-rel-nightly-launch.yml'
2526
- '.github/workflows/trivy.yml'
2627
- 'devops/containers/**'
2728
- 'devops/actions/build_container/**'
@@ -120,7 +121,7 @@ jobs:
120121
- name: Intel Battlemage Graphics
121122
runner: '["Linux", "bmg"]'
122123
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
123-
target_devices: level_zero:gpu
124+
target_devices: level_zero:gpu;level_zero_v2:gpu
124125
- name: SPIR-V Backend / Intel Battlemage Graphics
125126
runner: '["Linux", "bmg"]'
126127
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN

.github/workflows/sycl-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ jobs:
333333
echo "TAG=$(date +'%Y-%m-%d')-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
334334
fi
335335
- name: Upload binaries
336-
uses: softprops/[email protected].0
336+
uses: softprops/[email protected].2
337337
with:
338338
files: |
339339
sycl_linux.tar.gz

.github/workflows/sycl-rel-nightly-launch.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,20 @@
44

55
name: Scheduled sycl-rel-nightly launch
66

7+
permissions: read-all
8+
79
on:
8-
schedule:
9-
# The sycl-rel-nightly.yml workflow file on the sycl-rel-6_2 branch is most
10-
# likely stale. Do not schedule before it's updated.
10+
# The sycl-rel-nightly.yml workflow file on the sycl-rel-6_2 branch is most
11+
# likely stale. Do not schedule before it's updated.
12+
# schedule:
1113
# - cron: '0 3 * * *'
1214
workflow_dispatch:
1315

1416
jobs:
1517
launch:
1618
if: github.repository == 'intel/llvm'
19+
permissions:
20+
actions: write
1721
runs-on: ubuntu-latest
1822
steps:
1923
- name: Launch

.github/workflows/sycl-windows-precommit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ on:
2121
- '.github/workflows/sycl-macos-*.yml'
2222
- '.github/workflows/sycl-nightly.yml'
2323
- '.github/workflows/sycl-rel-nightly.yml'
24+
- '.github/workflows/sycl-rel-nightly-launch.yml'
2425
- '.github/workflows/trivy.yml'
2526
- 'devops/containers/**'
2627
- 'devops/actions/build_container/**'

sycl/cmake/modules/FetchEmhash.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ find_file(EMHASH_SYS_LOC "hash_table8.hpp" PATH_SUFFIXES "emhash")
66
if(NOT EMHASH_SYS_LOC)
77
set(EMHASH_REPO https://github.com/ktprime/emhash)
88
message(STATUS "Will fetch emhash from ${EMHASH_REPO}")
9+
include(FetchContent)
910
FetchContent_Declare(emhash
1011
GIT_REPOSITORY ${EMHASH_REPO}
1112
GIT_TAG 3ba9abdfdc2e0430fcc2fd8993cad31945b6a02b

sycl/include/sycl/detail/info_desc_helpers.hpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,6 @@ template <typename T> struct is_backend_info_desc : std::false_type {};
6262
#include <sycl/info/event_profiling_traits.def>
6363
#undef __SYCL_PARAM_TRAITS_SPEC
6464

65-
template <typename Param> struct IsSubGroupInfo : std::false_type {};
66-
template <>
67-
struct IsSubGroupInfo<info::kernel_device_specific::max_num_sub_groups>
68-
: std::true_type {};
69-
template <>
70-
struct IsSubGroupInfo<info::kernel_device_specific::compile_num_sub_groups>
71-
: std::true_type {};
72-
template <>
73-
struct IsSubGroupInfo<info::kernel_device_specific::max_sub_group_size>
74-
: std::true_type {};
75-
template <>
76-
struct IsSubGroupInfo<info::kernel_device_specific::compile_sub_group_size>
77-
: std::true_type {};
78-
template <typename Param> struct IsKernelInfo : std::false_type {};
79-
template <>
80-
struct IsKernelInfo<info::kernel_device_specific::ext_codeplay_num_regs>
81-
: std::true_type {};
82-
8365
#define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, UrCode) \
8466
template <> \
8567
struct is_##DescType##_info_desc<info::DescType::Desc> : std::true_type { \

sycl/include/sycl/detail/string_view.hpp

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ class string_view {
2727
#endif
2828

2929
public:
30-
string_view() noexcept = default;
31-
string_view(const string_view &strn) noexcept = default;
32-
string_view(string_view &&strn) noexcept = default;
33-
string_view(std::string_view strn) noexcept
30+
constexpr string_view() noexcept = default;
31+
constexpr string_view(const string_view &strn) noexcept = default;
32+
constexpr string_view(string_view &&strn) noexcept = default;
33+
constexpr string_view(std::string_view strn) noexcept
3434
: str(strn.data())
3535
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
3636
,
@@ -47,10 +47,10 @@ class string_view {
4747
{
4848
}
4949

50-
string_view &operator=(string_view &&strn) noexcept = default;
50+
constexpr string_view &operator=(string_view &&strn) noexcept = default;
5151
string_view &operator=(const string_view &strn) noexcept = default;
5252

53-
string_view &operator=(std::string_view strn) noexcept {
53+
constexpr string_view &operator=(std::string_view strn) noexcept {
5454
str = strn.data();
5555
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
5656
len = strn.size();
@@ -66,9 +66,9 @@ class string_view {
6666
return *this;
6767
}
6868

69-
const char *data() const noexcept { return str ? str : ""; }
69+
constexpr const char *data() const noexcept { return str ? str : ""; }
7070

71-
explicit operator std::string_view() const noexcept {
71+
constexpr explicit operator std::string_view() const noexcept {
7272
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
7373
return std::string_view(str, len);
7474
#else
@@ -77,31 +77,39 @@ class string_view {
7777
}
7878

7979
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
80-
friend bool operator==(string_view lhs, std::string_view rhs) noexcept {
80+
friend constexpr bool operator==(string_view lhs,
81+
std::string_view rhs) noexcept {
8182
return rhs == std::string_view(lhs);
8283
}
83-
friend bool operator==(std::string_view lhs, string_view rhs) noexcept {
84+
friend constexpr bool operator==(std::string_view lhs,
85+
string_view rhs) noexcept {
8486
return lhs == std::string_view(rhs);
8587
}
8688

87-
friend bool operator!=(string_view lhs, std::string_view rhs) noexcept {
89+
friend constexpr bool operator!=(string_view lhs,
90+
std::string_view rhs) noexcept {
8891
return rhs != std::string_view(lhs);
8992
}
90-
friend bool operator!=(std::string_view lhs, string_view rhs) noexcept {
93+
friend constexpr bool operator!=(std::string_view lhs,
94+
string_view rhs) noexcept {
9195
return lhs != std::string_view(rhs);
9296
}
9397
#else
94-
friend bool operator==(string_view lhs, std::string_view rhs) noexcept {
98+
friend constexpr bool operator==(string_view lhs,
99+
std::string_view rhs) noexcept {
95100
return rhs == lhs.data();
96101
}
97-
friend bool operator==(std::string_view lhs, string_view rhs) noexcept {
102+
friend constexpr bool operator==(std::string_view lhs,
103+
string_view rhs) noexcept {
98104
return lhs == rhs.data();
99105
}
100106

101-
friend bool operator!=(string_view lhs, std::string_view rhs) noexcept {
107+
friend constexpr bool operator!=(string_view lhs,
108+
std::string_view rhs) noexcept {
102109
return rhs != lhs.data();
103110
}
104-
friend bool operator!=(std::string_view lhs, string_view rhs) noexcept {
111+
friend constexpr bool operator!=(std::string_view lhs,
112+
string_view rhs) noexcept {
105113
return lhs != rhs.data();
106114
}
107115
#endif

sycl/include/sycl/device.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,6 @@ class __SYCL_EXPORT device : public detail::OwnerLessBase<device> {
208208
/// Queries this SYCL device for information requested by the template
209209
/// parameter param
210210
///
211-
/// Specializations of info::param_traits must be defined in accordance with
212-
/// the info parameters in Table 4.20 of SYCL Spec to facilitate returning the
213-
/// type associated with the param parameter.
214-
///
215211
/// \return device info of type described in Table 4.20.
216212
template <typename Param>
217213
typename detail::is_device_info_desc<Param>::return_type get_info() const {

sycl/include/sycl/handler.hpp

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,16 @@ class RoundedRangeKernel {
349349
KernelFunc(item);
350350
}
351351
}
352+
353+
// Copy the properties_tag getter from the original kernel to propagate
354+
// property(s)
355+
template <
356+
typename T = KernelType,
357+
typename = std::enable_if_t<ext::oneapi::experimental::detail::
358+
HasKernelPropertiesGetMethod<T>::value>>
359+
auto get(ext::oneapi::experimental::properties_tag) const {
360+
return KernelFunc.get(ext::oneapi::experimental::properties_tag{});
361+
}
352362
};
353363

354364
template <typename TransformedArgType, int Dims, typename KernelType>
@@ -364,6 +374,16 @@ class RoundedRangeKernelWithKH {
364374
KernelFunc(item, KH);
365375
}
366376
}
377+
378+
// Copy the properties_tag getter from the original kernel to propagate
379+
// property(s)
380+
template <
381+
typename T = KernelType,
382+
typename = std::enable_if_t<ext::oneapi::experimental::detail::
383+
HasKernelPropertiesGetMethod<T>::value>>
384+
auto get(ext::oneapi::experimental::properties_tag) const {
385+
return KernelFunc.get(ext::oneapi::experimental::properties_tag{});
386+
}
367387
};
368388

369389
using std::enable_if_t;
@@ -1293,8 +1313,8 @@ class __SYCL_EXPORT handler {
12931313
KernelWrapper<WrapAs::parallel_for, KName, decltype(Wrapper),
12941314
TransformedArgType, PropertiesT>::wrap(this, Wrapper);
12951315
#ifndef __SYCL_DEVICE_ONLY__
1296-
verifyUsedKernelBundleInternal(
1297-
detail::string_view{detail::getKernelName<NameT>()});
1316+
constexpr detail::string_view Name{detail::getKernelName<NameT>()};
1317+
verifyUsedKernelBundleInternal(Name);
12981318
// We are executing over the rounded range, but there are still
12991319
// items/ids that are are constructed in ther range rounded
13001320
// kernel use items/ids in the user range, which means that
@@ -1318,9 +1338,9 @@ class __SYCL_EXPORT handler {
13181338
KernelWrapper<WrapAs::parallel_for, NameT, KernelType, TransformedArgType,
13191339
PropertiesT>::wrap(this, KernelFunc);
13201340
#ifndef __SYCL_DEVICE_ONLY__
1321-
constexpr std::string_view Name{detail::getKernelName<NameT>()};
1341+
constexpr detail::string_view Name{detail::getKernelName<NameT>()};
13221342

1323-
verifyUsedKernelBundleInternal(detail::string_view{Name});
1343+
verifyUsedKernelBundleInternal(Name);
13241344
processProperties<detail::isKernelESIMD<NameT>(), PropertiesT>(Props);
13251345
detail::checkValueRange<Dims>(UserRange);
13261346
setNDRangeDescriptor(std::move(UserRange));
@@ -1611,8 +1631,8 @@ class __SYCL_EXPORT handler {
16111631
throwOnKernelParameterMisuse<KernelName, KernelType>();
16121632
}
16131633
throwIfActionIsCreated();
1614-
verifyUsedKernelBundleInternal(
1615-
detail::string_view{detail::getKernelName<NameT>()});
1634+
constexpr detail::string_view Name{detail::getKernelName<NameT>()};
1635+
verifyUsedKernelBundleInternal(Name);
16161636
setType(detail::CGType::Kernel);
16171637

16181638
detail::checkValueRange<Dims>(params...);
@@ -1655,8 +1675,8 @@ class __SYCL_EXPORT handler {
16551675
// Ignore any set kernel bundles and use the one associated with the
16561676
// kernel.
16571677
setHandlerKernelBundle(Kernel);
1658-
verifyUsedKernelBundleInternal(
1659-
detail::string_view{detail::getKernelName<NameT>()});
1678+
constexpr detail::string_view Name{detail::getKernelName<NameT>()};
1679+
verifyUsedKernelBundleInternal(Name);
16601680
setType(detail::CGType::Kernel);
16611681

16621682
detail::checkValueRange<Dims>(params...);
@@ -2108,8 +2128,8 @@ class __SYCL_EXPORT handler {
21082128
kernel_single_task<NameT>(KernelFunc);
21092129
#ifndef __SYCL_DEVICE_ONLY__
21102130
throwIfActionIsCreated();
2111-
verifyUsedKernelBundleInternal(
2112-
detail::string_view{detail::getKernelName<NameT>()});
2131+
constexpr detail::string_view Name{detail::getKernelName<NameT>()};
2132+
verifyUsedKernelBundleInternal(Name);
21132133
// No need to check if range is out of INT_MAX limits as it's compile-time
21142134
// known constant
21152135
setNDRangeDescriptor(range<1>{1});

sycl/include/sycl/info/info_desc.hpp

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -74,24 +74,6 @@ enum class partition_property : intptr_t {
7474
ext_intel_partition_by_cslice = UR_DEVICE_PARTITION_BY_CSLICE
7575
};
7676

77-
// FIXME: maybe this should live elsewhere, maybe it should be implemented
78-
// differently
79-
inline partition_property
80-
ConvertPartitionProperty(const ur_device_partition_t &Partition) {
81-
switch (Partition) {
82-
case UR_DEVICE_PARTITION_EQUALLY:
83-
return partition_property::partition_equally;
84-
case UR_DEVICE_PARTITION_BY_COUNTS:
85-
return partition_property::partition_by_counts;
86-
case UR_DEVICE_PARTITION_BY_AFFINITY_DOMAIN:
87-
return partition_property::partition_by_affinity_domain;
88-
case UR_DEVICE_PARTITION_BY_CSLICE:
89-
return partition_property::ext_intel_partition_by_cslice;
90-
default:
91-
return partition_property::no_partition;
92-
}
93-
}
94-
9577
enum class partition_affinity_domain : intptr_t {
9678
not_applicable = 0,
9779
numa = UR_DEVICE_AFFINITY_DOMAIN_FLAG_NUMA,
@@ -102,24 +84,6 @@ enum class partition_affinity_domain : intptr_t {
10284
next_partitionable = UR_DEVICE_AFFINITY_DOMAIN_FLAG_NEXT_PARTITIONABLE
10385
};
10486

105-
inline partition_affinity_domain
106-
ConvertAffinityDomain(const ur_device_affinity_domain_flags_t Domain) {
107-
switch (Domain) {
108-
case UR_DEVICE_AFFINITY_DOMAIN_FLAG_NUMA:
109-
return partition_affinity_domain::numa;
110-
case UR_DEVICE_AFFINITY_DOMAIN_FLAG_L1_CACHE:
111-
return partition_affinity_domain::L1_cache;
112-
case UR_DEVICE_AFFINITY_DOMAIN_FLAG_L2_CACHE:
113-
return partition_affinity_domain::L2_cache;
114-
case UR_DEVICE_AFFINITY_DOMAIN_FLAG_L3_CACHE:
115-
return partition_affinity_domain::L3_cache;
116-
case UR_DEVICE_AFFINITY_DOMAIN_FLAG_L4_CACHE:
117-
return partition_affinity_domain::L4_cache;
118-
default:
119-
return info::partition_affinity_domain::not_applicable;
120-
}
121-
}
122-
12387
enum class local_mem_type : int { none, local, global };
12488

12589
enum class fp_config : uint32_t {
@@ -141,12 +105,6 @@ enum class execution_capability : unsigned int {
141105
};
142106

143107
namespace device {
144-
// TODO implement the following SYCL 2020 device info descriptors:
145-
// atomic_fence_order_capabilities, atomic_fence_scope_capabilities, aspects,
146-
// il_version.
147-
148-
struct atomic_fence_order_capabilities;
149-
struct atomic_fence_scope_capabilities;
150108

151109
#define __SYCL_PARAM_TRAITS_DEPRECATED(Desc, Message) \
152110
struct __SYCL2020_DEPRECATED(Message) Desc;
@@ -203,17 +161,6 @@ namespace event_profiling {
203161
} // namespace event_profiling
204162
#undef __SYCL_PARAM_TRAITS_SPEC
205163

206-
// Provide an alias to the return type for each of the info parameters
207-
template <typename T, T param> class param_traits {};
208-
209-
template <typename T, T param> struct compatibility_param_traits {};
210-
211-
#define __SYCL_PARAM_TRAITS_SPEC(param_type, param, ret_type) \
212-
template <> class param_traits<param_type, param_type::param> { \
213-
public: \
214-
using return_type = ret_type; \
215-
};
216-
#undef __SYCL_PARAM_TRAITS_SPEC
217164
} // namespace info
218165

219166
#define __SYCL_PARAM_TRAITS_SPEC(Namespace, DescType, Desc, ReturnT, UrCode) \

sycl/source/detail/buffer_impl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace detail {
2121
#ifdef XPTI_ENABLE_INSTRUMENTATION
2222
uint8_t GBufferStreamID;
2323
#endif
24-
void *buffer_impl::allocateMem(ContextImplPtr Context, bool InitFromUserData,
24+
void *buffer_impl::allocateMem(context_impl *Context, bool InitFromUserData,
2525
void *HostPtr,
2626
ur_event_handle_t &OutEventToWait) {
2727
bool HostPtrReadOnly = false;
@@ -30,9 +30,9 @@ void *buffer_impl::allocateMem(ContextImplPtr Context, bool InitFromUserData,
3030
"Internal error. Allocating memory on the host "
3131
"while having use_host_ptr property");
3232
return MemoryManager::allocateMemBuffer(
33-
std::move(Context), this, HostPtr, HostPtrReadOnly,
34-
BaseT::getSizeInBytes(), BaseT::MInteropEvent, BaseT::MInteropContext,
35-
MProps, OutEventToWait);
33+
Context, this, HostPtr, HostPtrReadOnly, BaseT::getSizeInBytes(),
34+
BaseT::MInteropEvent, BaseT::MInteropContext.get(), MProps,
35+
OutEventToWait);
3636
}
3737
void buffer_impl::constructorNotification(const detail::code_location &CodeLoc,
3838
void *UserObj, const void *HostObj,

sycl/source/detail/buffer_impl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ class buffer_impl final : public SYCLMemObjT {
129129
: BaseT(MemObject, SyclContext, OwnNativeHandle,
130130
std::move(AvailableEvent), std::move(Allocator)) {}
131131

132-
void *allocateMem(ContextImplPtr Context, bool InitFromUserData,
133-
void *HostPtr, ur_event_handle_t &OutEventToWait) override;
132+
void *allocateMem(context_impl *Context, bool InitFromUserData, void *HostPtr,
133+
ur_event_handle_t &OutEventToWait) override;
134134
void constructorNotification(const detail::code_location &CodeLoc,
135135
void *UserObj, const void *HostObj,
136136
const void *Type, uint32_t Dim,

0 commit comments

Comments
 (0)