Skip to content

Commit 2167d96

Browse files
committed
Merge branch 'sycl' into san-spec-constant-devicety
2 parents 9766fb1 + acbca47 commit 2167d96

File tree

27 files changed

+252
-317
lines changed

27 files changed

+252
-317
lines changed

devops/compat_ci_exclude.sycl-rel-6_2

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ DiscardEvents/invalid_event_exceptions.cpp
1212
# Throw exception instead of returning garbage
1313
Basic/info.cpp
1414

15+
# https://github.com/intel/llvm/pull/19238 removed the device aspect
16+
# corresponding to the opportunistic_group support, in favor of it being merged
17+
# into the fragment_group aspect. Since this was a full refactoring and renaming
18+
# of an experimental extension, we accept the breaking change.
19+
NonUniformGroups/opportunistic_group.cpp
20+
1521
# https://github.com/intel/llvm/pull/17442 changed the behavior of
1622
# ext_oneapi_can_compile to refer to whether a source-based kernel_bundle can
1723
# be used with compile rather than build. This makes the OpenCL kernel compiler
@@ -39,9 +45,6 @@ KernelAndProgram/disable-caching.cpp
3945
# binaries built with sanitizers?
4046
Sanitizer
4147

42-
# https://github.com/intel/llvm/pull/19238
43-
NonUniformGroups/opportunistic_group.cpp
44-
4548
# https://github.com/intel/llvm/pull/17955, experimental extension
4649
AsyncAlloc/device/async_alloc_from_pool.cpp
4750
AsyncAlloc/device/async_alloc_zero_init.cpp

sycl/doc/extensions/supported/sycl_ext_oneapi_accessor_properties.asciidoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,20 @@ class accessor {
335335
...
336336
```
337337

338+
The `handler::require` function is modified to reflect this type change:
339+
340+
```c++
341+
namespace sycl {
342+
class handler {
343+
public:
344+
template <typename DataT, int Dimensions, access_mode AccessMode,
345+
target AccessTarget, access::placeholder IsPlaceholder,
346+
typename property_listT>
347+
void require(accessor<DataT, Dimensions, AccessMode, AccessTarget, IsPlaceholder, property_listT> acc);
348+
};
349+
} // namespace sycl
350+
```
351+
338352
Modify the code listing to add variants of all the accessor constructors that take a property_list
339353
that instead take an accessor_property_list:
340354

sycl/include/sycl/ext/oneapi/experimental/enqueue_functions.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ event submit_with_event_impl(const queue &Q, PropertiesT Props,
109109
CommandGroupFunc &&CGF,
110110
const sycl::detail::code_location &CodeLoc) {
111111
return Q.submit_with_event<__SYCL_USE_FALLBACK_ASSERT>(
112-
Props, detail::type_erased_cgfo_ty{CGF}, nullptr, CodeLoc);
112+
Props, detail::type_erased_cgfo_ty{CGF}, CodeLoc);
113113
}
114114
} // namespace detail
115115

sycl/include/sycl/handler.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,8 +1588,11 @@ class __SYCL_EXPORT handler {
15881588
///
15891589
/// \param Acc is a SYCL accessor describing required memory region.
15901590
template <typename DataT, int Dims, access::mode AccMode,
1591-
access::target AccTarget, access::placeholder isPlaceholder>
1592-
void require(accessor<DataT, Dims, AccMode, AccTarget, isPlaceholder> Acc) {
1591+
access::target AccTarget, access::placeholder isPlaceholder,
1592+
typename propertyListT>
1593+
void require(
1594+
accessor<DataT, Dims, AccMode, AccTarget, isPlaceholder, propertyListT>
1595+
Acc) {
15931596
if (Acc.is_placeholder())
15941597
associateWithHandler(&Acc, AccTarget);
15951598
}

sycl/include/sycl/property_list.hpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ template <typename... PropsT> class accessor_property_list;
2525
} // namespace ext::oneapi
2626
namespace detail {
2727
class PropertyValidator;
28+
class SYCLMemObjT;
2829
} // namespace detail
2930

3031
/// Objects of the property_list class are containers for the SYCL properties
@@ -58,15 +59,28 @@ class property_list : protected detail::PropertyListBase {
5859
return has_property_helper<PropT>();
5960
}
6061

62+
template <typename... T> operator ext::oneapi::accessor_property_list<T...>();
63+
64+
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
65+
private:
66+
#endif
67+
68+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
69+
__SYCL_DEPRECATED("add_or_replace_accessor_properties() is not part of the "
70+
"SYCL API and will be removed in the future.")
71+
#endif
6172
void add_or_replace_accessor_properties(const property_list &PropertyList) {
6273
add_or_replace_accessor_properties_helper(PropertyList.MPropsWithData);
6374
}
75+
76+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
77+
__SYCL_DEPRECATED("delete_accessor_property() is not part of the SYCL API "
78+
"and will be removed in the future.")
79+
#endif
6480
void delete_accessor_property(const sycl::detail::PropWithDataKind &Kind) {
6581
delete_accessor_property_helper(Kind);
6682
}
6783

68-
template <typename... T> operator ext::oneapi::accessor_property_list<T...>();
69-
7084
private:
7185
property_list(
7286
std::bitset<detail::DataLessPropKind::DataLessPropKindSize> DataLessProps,
@@ -76,6 +90,7 @@ class property_list : protected detail::PropertyListBase {
7690
template <typename... PropsT>
7791
friend class ext::oneapi::accessor_property_list;
7892
friend class detail::PropertyValidator;
93+
friend class detail::SYCLMemObjT;
7994
};
8095

8196
namespace detail {

sycl/include/sycl/queue.hpp

Lines changed: 10 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ auto get_native(const SyclObjectT &Obj)
6666
namespace detail {
6767
class queue_impl;
6868

69-
inline event submitAssertCapture(const queue &, event &, queue *,
69+
inline event submitAssertCapture(const queue &, event &,
7070
const detail::code_location &);
7171

7272
// Function to postprocess submitted command
@@ -87,8 +87,10 @@ class __SYCL_EXPORT SubmissionInfo {
8787
sycl::detail::optional<SubmitPostProcessF> &PostProcessorFunc();
8888
const sycl::detail::optional<SubmitPostProcessF> &PostProcessorFunc() const;
8989

90+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
9091
std::shared_ptr<detail::queue_impl> &SecondaryQueue();
9192
const std::shared_ptr<detail::queue_impl> &SecondaryQueue() const;
93+
#endif
9294

9395
ext::oneapi::experimental::event_mode_enum &EventMode();
9496
const ext::oneapi::experimental::event_mode_enum &EventMode() const;
@@ -434,21 +436,18 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
434436
/// Submits a command group function object to the queue, in order to be
435437
/// scheduled for execution on the device.
436438
///
437-
/// On a kernel error, this command group function object is then scheduled
438-
/// for execution on a secondary queue.
439-
///
440439
/// \param CGF is a function object containing command group.
441-
/// \param SecondaryQueue is a fallback SYCL queue.
440+
/// \param SecondaryQueue is a fallback SYCL queue. (unused)
442441
/// \param CodeLoc is the code location of the submit call (default argument)
443442
/// \return a SYCL event object, which corresponds to the queue the command
444443
/// group is being enqueued on.
445444
template <typename T>
446445
std::enable_if_t<std::is_invocable_r_v<void, T, handler &>, event> submit(
447-
T CGF, queue &SecondaryQueue,
446+
T CGF, [[maybe_unused]] queue &SecondaryQueue,
448447
const detail::code_location &CodeLoc = detail::code_location::current()) {
449448
return submit_with_event<__SYCL_USE_FALLBACK_ASSERT>(
450449
sycl::ext::oneapi::experimental::empty_properties_t{},
451-
detail::type_erased_cgfo_ty{CGF}, &SecondaryQueue, CodeLoc);
450+
detail::type_erased_cgfo_ty{CGF}, CodeLoc);
452451
}
453452

454453
/// Prevents any commands submitted afterward to this queue from executing
@@ -3582,7 +3581,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
35823581
-> backend_return_t<BackendName, SyclObjectT>;
35833582

35843583
#if __SYCL_USE_FALLBACK_ASSERT
3585-
friend event detail::submitAssertCapture(const queue &, event &, queue *,
3584+
friend event detail::submitAssertCapture(const queue &, event &,
35863585
const detail::code_location &);
35873586
#endif
35883587

@@ -3686,47 +3685,6 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
36863685
const detail::code_location &CodeLoc,
36873686
bool IsTopCodeLoc) const;
36883687

3689-
/// Submits a command group function object to the queue, in order to be
3690-
/// scheduled for execution on the device.
3691-
///
3692-
/// \param Props is a property list with submission properties.
3693-
/// \param CGF is a function object containing command group.
3694-
/// \param SecondaryQueuePtr is a pointer to the secondary queue.
3695-
/// \param CodeLoc is the code location of the submit call (default argument)
3696-
/// \return a SYCL event object for the submitted command group.
3697-
//
3698-
// UseFallBackAssert as template param vs `#if` in function body is necessary
3699-
// to prevent ODR-violation between TUs built with different fallback assert
3700-
// modes.
3701-
template <bool UseFallbackAssert, typename PropertiesT>
3702-
event submit_with_event(PropertiesT Props,
3703-
const detail::type_erased_cgfo_ty &CGF,
3704-
queue *SecondaryQueuePtr,
3705-
const detail::code_location &CodeLoc =
3706-
detail::code_location::current()) const {
3707-
detail::tls_code_loc_t TlsCodeLocCapture(CodeLoc);
3708-
detail::v1::SubmissionInfo SI{};
3709-
ProcessSubmitProperties(Props, SI);
3710-
if (SecondaryQueuePtr)
3711-
SI.SecondaryQueue() = detail::getSyclObjImpl(*SecondaryQueuePtr);
3712-
if constexpr (UseFallbackAssert)
3713-
SI.PostProcessorFunc() =
3714-
[this, &SecondaryQueuePtr,
3715-
&TlsCodeLocCapture](bool IsKernel, bool KernelUsesAssert, event &E) {
3716-
if (IsKernel && !device_has(aspect::ext_oneapi_native_assert) &&
3717-
KernelUsesAssert && !device_has(aspect::accelerator)) {
3718-
// __devicelib_assert_fail isn't supported by Device-side Runtime
3719-
// Linking against fallback impl of __devicelib_assert_fail is
3720-
// performed by program manager class
3721-
// Fallback assert isn't supported for FPGA
3722-
submitAssertCapture(*this, E, SecondaryQueuePtr,
3723-
TlsCodeLocCapture.query());
3724-
}
3725-
};
3726-
return submit_with_event_impl(CGF, SI, TlsCodeLocCapture.query(),
3727-
TlsCodeLocCapture.isToplevel());
3728-
}
3729-
37303688
/// Submits a command group function object to the queue, in order to be
37313689
/// scheduled for execution on the device.
37323690
///
@@ -3756,7 +3714,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
37563714
// Linking against fallback impl of __devicelib_assert_fail is
37573715
// performed by program manager class
37583716
// Fallback assert isn't supported for FPGA
3759-
submitAssertCapture(*this, E, nullptr, TlsCodeLocCapture.query());
3717+
submitAssertCapture(*this, E, TlsCodeLocCapture.query());
37603718
}
37613719
};
37623720
return submit_with_event_impl(CGF, SI, TlsCodeLocCapture.query(),
@@ -3955,15 +3913,13 @@ class AssertInfoCopier;
39553913
* Submit copy task for assert failure flag and host-task to check the flag
39563914
* \param Event kernel's event to depend on i.e. the event represents the
39573915
* kernel to check for assertion failure
3958-
* \param SecondaryQueue secondary queue for submit process, null if not used
39593916
* \returns host tasks event
39603917
*
39613918
* This method doesn't belong to queue class to overcome msvc behaviour due to
39623919
* which it gets compiled and exported without any integration header and, thus,
39633920
* with no proper KernelInfo instance.
39643921
*/
39653922
event submitAssertCapture(const queue &Self, event &Event,
3966-
queue *SecondaryQueue,
39673923
const detail::code_location &CodeLoc) {
39683924
buffer<detail::AssertHappened, 1> Buffer{1};
39693925

@@ -4019,10 +3975,10 @@ event submitAssertCapture(const queue &Self, event &Event,
40193975

40203976
CopierEv = Self.submit_with_event<true>(
40213977
sycl::ext::oneapi::experimental::empty_properties_t{}, CopierCGF,
4022-
SecondaryQueue, CodeLoc);
3978+
CodeLoc);
40233979
CheckerEv = Self.submit_with_event<true>(
40243980
sycl::ext::oneapi::experimental::empty_properties_t{}, CheckerCGF,
4025-
SecondaryQueue, CodeLoc);
3981+
CodeLoc);
40263982

40273983
return CheckerEv;
40283984
}

sycl/source/detail/handler_impl.hpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ enum class HandlerSubmissionState : std::uint8_t {
3131

3232
class handler_impl {
3333
public:
34-
handler_impl(queue_impl &Queue, queue_impl *SubmissionSecondaryQueue,
35-
bool EventNeeded)
36-
: MSubmissionSecondaryQueue(SubmissionSecondaryQueue),
37-
MEventNeeded(EventNeeded), MQueueOrGraph{Queue} {};
34+
handler_impl(queue_impl &Queue, bool EventNeeded)
35+
: MEventNeeded(EventNeeded), MQueueOrGraph{Queue} {};
3836

3937
handler_impl(ext::oneapi::experimental::detail::graph_impl &Graph)
4038
: MQueueOrGraph{Graph} {}
@@ -65,10 +63,6 @@ class handler_impl {
6563
/// Registers mutually exclusive submission states.
6664
HandlerSubmissionState MSubmissionState = HandlerSubmissionState::NO_STATE;
6765

68-
/// Pointer to the secondary queue implementation. Nullptr if no
69-
/// secondary queue fallback was given in the associated submission.
70-
queue_impl *MSubmissionSecondaryQueue = nullptr;
71-
7266
/// Bool stores information about whether the event resulting from the
7367
/// corresponding work is required.
7468
bool MEventNeeded = true;

sycl/source/detail/queue_impl.cpp

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -304,14 +304,14 @@ void queue_impl::addEvent(const detail::EventImplPtr &EventImpl) {
304304

305305
detail::EventImplPtr
306306
queue_impl::submit_impl(const detail::type_erased_cgfo_ty &CGF,
307-
queue_impl *SecondaryQueue, bool CallerNeedsEvent,
308-
const detail::code_location &Loc, bool IsTopCodeLoc,
307+
bool CallerNeedsEvent, const detail::code_location &Loc,
308+
bool IsTopCodeLoc,
309309
const v1::SubmissionInfo &SubmitInfo) {
310310
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
311-
detail::handler_impl HandlerImplVal(*this, SecondaryQueue, CallerNeedsEvent);
311+
detail::handler_impl HandlerImplVal(*this, CallerNeedsEvent);
312312
handler Handler(HandlerImplVal);
313313
#else
314-
handler Handler(shared_from_this(), SecondaryQueue, CallerNeedsEvent);
314+
handler Handler(shared_from_this(), CallerNeedsEvent);
315315
#endif
316316
detail::handler_impl &HandlerImpl = *detail::getSyclObjImpl(Handler);
317317

@@ -390,8 +390,8 @@ queue_impl::submit_impl(const detail::type_erased_cgfo_ty &CGF,
390390
Stream->generateFlushCommand(ServiceCGH);
391391
};
392392
detail::type_erased_cgfo_ty CGF{L};
393-
detail::EventImplPtr FlushEvent = submit_impl(
394-
CGF, SecondaryQueue, /*CallerNeedsEvent*/ true, Loc, IsTopCodeLoc, {});
393+
detail::EventImplPtr FlushEvent =
394+
submit_impl(CGF, /*CallerNeedsEvent*/ true, Loc, IsTopCodeLoc, {});
395395
if (EventImpl)
396396
EventImpl->attachEventToCompleteWeak(FlushEvent);
397397
if (!isInOrder()) {
@@ -403,18 +403,6 @@ queue_impl::submit_impl(const detail::type_erased_cgfo_ty &CGF,
403403
return EventImpl;
404404
}
405405

406-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
407-
detail::EventImplPtr
408-
queue_impl::submit_impl(const detail::type_erased_cgfo_ty &CGF,
409-
const std::shared_ptr<queue_impl> & /*PrimaryQueue*/,
410-
const std::shared_ptr<queue_impl> &SecondaryQueue,
411-
bool CallerNeedsEvent, const detail::code_location &Loc,
412-
bool IsTopCodeLoc, const SubmissionInfo &SubmitInfo) {
413-
return submit_impl(CGF, SecondaryQueue.get(), CallerNeedsEvent, Loc,
414-
IsTopCodeLoc, SubmitInfo);
415-
}
416-
#endif
417-
418406
template <typename HandlerFuncT>
419407
event queue_impl::submitWithHandler(const std::vector<event> &DepEvents,
420408
bool CallerNeedsEvent,

0 commit comments

Comments
 (0)