Skip to content

Commit cc59544

Browse files
committed
Merge remote-tracking branch 'origin' into private/asachkov/dont-include-kernel-bundle
2 parents 023dc0a + c58affd commit cc59544

File tree

10 files changed

+132
-103
lines changed

10 files changed

+132
-103
lines changed

sycl/include/sycl/ext/intel/experimental/pipes.hpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,41 @@ class pipe_base {
4646
pipe_base() = default;
4747
~pipe_base() = default;
4848

49+
__SYCL_EXPORT static sycl::detail::string
50+
get_pipe_name_impl(const void *HostPipePtr);
51+
52+
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
53+
static std::string get_pipe_name(const void *HostPipePtr) {
54+
return {get_pipe_name_impl(HostPipePtr).c_str()};
55+
}
56+
#else
4957
__SYCL_EXPORT static std::string get_pipe_name(const void *HostPipePtr);
58+
#endif
59+
5060
__SYCL_EXPORT static bool wait_non_blocking(const event &E);
5161
};
5262

63+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
64+
// We want all "new" uses/recompilation to use the "inline" version, yet we
65+
// still need to provide an exported symbol for the code that was compiled
66+
// before that. Make sure we use "inline" everywhere except when compiling
67+
// `pipes.cpp` so that we'd still provide this backward-compatibility ABI symbol
68+
// via `pipes.cpp` TU.
69+
#ifdef __SYCL_PIPES_CPP
70+
// Magic combination found by trial and error:
71+
__SYCL_EXPORT
72+
#ifdef WIN32
73+
inline
74+
#endif
75+
#else
76+
inline
77+
#endif
78+
std::string
79+
pipe_base::get_pipe_name(const void *HostPipePtr) {
80+
return {get_pipe_name_impl(HostPipePtr).c_str()};
81+
}
82+
#endif
83+
5384
template <class _name, class _dataT, int32_t _min_capacity = 0,
5485
class _propertiesT = decltype(oneapi::experimental::properties{}),
5586
class = void>

sycl/source/detail/pipes.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
10+
#define __SYCL_PIPES_CPP
11+
#endif
12+
913
#include <detail/event_impl.hpp>
1014
#include <detail/host_pipe_map_entry.hpp>
1115
#include <detail/program_manager/program_manager.hpp>
@@ -16,11 +20,11 @@ inline namespace _V1 {
1620
namespace ext {
1721
namespace intel {
1822
namespace experimental {
19-
20-
__SYCL_EXPORT std::string pipe_base::get_pipe_name(const void *HostPipePtr) {
21-
return sycl::_V1::detail::ProgramManager::getInstance()
22-
.getHostPipeEntry(HostPipePtr)
23-
->MUniqueId;
23+
__SYCL_EXPORT sycl::detail::string
24+
pipe_base::get_pipe_name_impl(const void *HostPipePtr) {
25+
return {std::string_view{sycl::_V1::detail::ProgramManager::getInstance()
26+
.getHostPipeEntry(HostPipePtr)
27+
->MUniqueId}};
2428
}
2529

2630
__SYCL_EXPORT bool pipe_base::wait_non_blocking(const event &E) {

sycl/source/detail/scheduler/commands.cpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3592,10 +3592,21 @@ ur_result_t ExecCGCommand::enqueueImpQueue() {
35923592

35933593
return UR_RESULT_SUCCESS;
35943594
}
3595-
case CGType::None:
3596-
throw sycl::exception(sycl::make_error_code(sycl::errc::runtime),
3597-
"CG type not implemented. " +
3598-
codeToString(UR_RESULT_ERROR_INVALID_OPERATION));
3595+
case CGType::None: {
3596+
if (RawEvents.empty()) {
3597+
// urEnqueueEventsWait with zero events acts like a barrier which is NOT
3598+
// what we want here. On the other hand, there is nothing to wait for, so
3599+
// we don't need to enqueue anything.
3600+
return UR_RESULT_SUCCESS;
3601+
}
3602+
const detail::AdapterPtr &Adapter = MQueue->getAdapter();
3603+
ur_event_handle_t Event;
3604+
ur_result_t Result = Adapter->call_nocheck<UrApiKind::urEnqueueEventsWait>(
3605+
MQueue->getHandleRef(), RawEvents.size(),
3606+
RawEvents.size() ? &RawEvents[0] : nullptr, &Event);
3607+
MEvent->setHandle(Event);
3608+
return Result;
3609+
}
35993610
}
36003611
return UR_RESULT_ERROR_INVALID_OPERATION;
36013612
}

sycl/source/handler.cpp

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -496,21 +496,8 @@ event handler::finalize() {
496496
MCodeLoc));
497497
break;
498498
case detail::CGType::None:
499-
if (detail::ur::trace(detail::ur::TraceLevel::TRACE_ALL)) {
500-
std::cout << "WARNING: An empty command group is submitted." << std::endl;
501-
}
502-
503-
// Empty nodes are handled by Graph like standard nodes
504-
// For Standard mode (non-graph),
505-
// empty nodes are not sent to the scheduler to save time
506-
if (impl->MGraph || (MQueue && MQueue->getCommandGraph())) {
507-
CommandGroup.reset(new detail::CG(detail::CGType::None,
508-
std::move(impl->CGData), MCodeLoc));
509-
} else {
510-
detail::EventImplPtr Event = std::make_shared<sycl::detail::event_impl>();
511-
MLastEvent = detail::createSyclObjFromImpl<event>(Event);
512-
return MLastEvent;
513-
}
499+
CommandGroup.reset(new detail::CG(detail::CGType::None,
500+
std::move(impl->CGData), MCodeLoc));
514501
break;
515502
}
516503

sycl/test-e2e/Basic/built-ins/marray_common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// RUN: %{build} %{mathflags} -o %t.out
44
// RUN: %{run} %t.out
5-
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t_preview.out %}
5+
// RUN: %if preview-breaking-changes-supported %{ %{build} %{mathflags} -fpreview-breaking-changes -o %t_preview.out %}
66
// RUN: %if preview-breaking-changes-supported %{ %{run} %t_preview.out%}
77

88
#ifdef _WIN32

sycl/test-e2e/Basic/empty_command.cpp

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,11 @@ void test_host_task_dep() {
2626
auto empty_cg_event =
2727
q.submit([&](handler &cgh) { cgh.depends_on(host_event); });
2828

29-
// FIXME: This should deadlock, but the dependency is ignored currently.
30-
empty_cg_event.wait();
31-
3229
assert(x == 0);
3330
start_execution.count_down();
3431

3532
empty_cg_event.wait();
36-
// FIXME: uncomment once the bug mentioned above is fixed.
37-
// assert(x == 42);
38-
39-
// I'm seeing some weird hang without this:
40-
host_event.wait();
33+
assert(x == 42);
4134
}
4235

4336
void test_device_event_dep() {
@@ -53,17 +46,12 @@ void test_device_event_dep() {
5346
auto empty_cg_event =
5447
q.submit([&](handler &cgh) { cgh.depends_on(device_event); });
5548

56-
// FIXME: This should deadlock, but the dependency is ignored currently.
57-
empty_cg_event.wait();
58-
5949
assert(*p == 0);
6050
start_execution.count_down();
6151

6252
empty_cg_event.wait();
63-
// FIXME: uncomment once the bug mentioned above is fixed.
64-
// assert(*p == 42);
53+
assert(*p == 42);
6554

66-
q.wait();
6755
sycl::free(p, q);
6856
}
6957

@@ -90,17 +78,12 @@ void test_accessor_dep() {
9078
auto empty_cg_event =
9179
q.submit([&](handler &cgh) { sycl::accessor a{b, cgh}; });
9280

93-
// FIXME: This should deadlock, but the dependency is ignored currently.
94-
empty_cg_event.wait();
95-
9681
assert(*p == 0);
9782
start_execution.count_down();
9883

9984
empty_cg_event.wait();
100-
// FIXME: uncomment once the bug mentioned above is fixed.
101-
// assert(*p == 42);
85+
assert(*p == 42);
10286

103-
q.wait();
10487
sycl::free(p, q);
10588
}
10689

sycl/test-e2e/WeakObject/weak_object_utils.hpp

Lines changed: 68 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,6 @@ template <template <typename> typename CallableT> void runTest(sycl::queue Q) {
105105
sycl::local_accessor<int, 2> LAcc2D{sycl::range<2>{1, 2}, CGH};
106106
sycl::local_accessor<int, 3> LAcc3D{sycl::range<3>{1, 2, 3}, CGH};
107107
sycl::stream Stream{1024, 32, CGH};
108-
sycl::unsampled_image_accessor<sycl::int4, 1, sycl::access_mode::read,
109-
sycl::image_target::host_task>
110-
UImgAcc1D{UImg1D, CGH};
111-
sycl::unsampled_image_accessor<sycl::int4, 2, sycl::access_mode::read,
112-
sycl::image_target::host_task>
113-
UImgAcc2D{UImg2D, CGH};
114-
sycl::unsampled_image_accessor<sycl::int4, 3, sycl::access_mode::read,
115-
sycl::image_target::host_task>
116-
UImgAcc3D{UImg3D, CGH};
117-
sycl::sampled_image_accessor<sycl::int4, 1, sycl::image_target::host_task>
118-
SImgAcc1D{SImg1D, CGH};
119-
sycl::sampled_image_accessor<sycl::int4, 2, sycl::image_target::host_task>
120-
SImgAcc2D{SImg2D, CGH};
121-
sycl::sampled_image_accessor<sycl::int4, 3, sycl::image_target::host_task>
122-
SImgAcc3D{SImg3D, CGH};
123108

124109
CallableT<decltype(DAcc1D)>()(DAcc1D);
125110
CallableT<decltype(DAcc2D)>()(DAcc2D);
@@ -128,13 +113,33 @@ template <template <typename> typename CallableT> void runTest(sycl::queue Q) {
128113
CallableT<decltype(LAcc2D)>()(LAcc2D);
129114
CallableT<decltype(LAcc3D)>()(LAcc3D);
130115
CallableT<decltype(Stream)>()(Stream);
131-
CallableT<decltype(UImgAcc1D)>()(UImgAcc1D);
132-
CallableT<decltype(UImgAcc2D)>()(UImgAcc2D);
133-
CallableT<decltype(UImgAcc3D)>()(UImgAcc3D);
134-
CallableT<decltype(SImgAcc1D)>()(SImgAcc1D);
135-
CallableT<decltype(SImgAcc2D)>()(SImgAcc2D);
136-
CallableT<decltype(SImgAcc3D)>()(SImgAcc3D);
137116
});
117+
if (Q.get_device().has(sycl::aspect::ext_intel_legacy_image)) {
118+
Q.submit([&](sycl::handler &CGH) {
119+
sycl::unsampled_image_accessor<sycl::int4, 1, sycl::access_mode::read,
120+
sycl::image_target::host_task>
121+
UImgAcc1D{UImg1D, CGH};
122+
sycl::unsampled_image_accessor<sycl::int4, 2, sycl::access_mode::read,
123+
sycl::image_target::host_task>
124+
UImgAcc2D{UImg2D, CGH};
125+
sycl::unsampled_image_accessor<sycl::int4, 3, sycl::access_mode::read,
126+
sycl::image_target::host_task>
127+
UImgAcc3D{UImg3D, CGH};
128+
sycl::sampled_image_accessor<sycl::int4, 1, sycl::image_target::host_task>
129+
SImgAcc1D{SImg1D, CGH};
130+
sycl::sampled_image_accessor<sycl::int4, 2, sycl::image_target::host_task>
131+
SImgAcc2D{SImg2D, CGH};
132+
sycl::sampled_image_accessor<sycl::int4, 3, sycl::image_target::host_task>
133+
SImgAcc3D{SImg3D, CGH};
134+
135+
CallableT<decltype(UImgAcc1D)>()(UImgAcc1D);
136+
CallableT<decltype(UImgAcc2D)>()(UImgAcc2D);
137+
CallableT<decltype(UImgAcc3D)>()(UImgAcc3D);
138+
CallableT<decltype(SImgAcc1D)>()(SImgAcc1D);
139+
CallableT<decltype(SImgAcc2D)>()(SImgAcc2D);
140+
CallableT<decltype(SImgAcc3D)>()(SImgAcc3D);
141+
});
142+
}
138143
}
139144

140145
template <template <typename> typename CallableT>
@@ -267,49 +272,54 @@ void runTestMulti(sycl::queue Q1) {
267272
sycl::local_accessor<int, 3> LAcc3D2{sycl::range<3>{1, 2, 3}, CGH};
268273
sycl::stream Stream1{1024, 32, CGH};
269274
sycl::stream Stream2{1024, 32, CGH};
270-
sycl::unsampled_image_accessor<sycl::int4, 1, sycl::access_mode::read,
271-
sycl::image_target::host_task>
272-
UImgAcc1D1{UImg1D1, CGH};
273-
sycl::unsampled_image_accessor<sycl::int4, 2, sycl::access_mode::read,
274-
sycl::image_target::host_task>
275-
UImgAcc2D1{UImg2D1, CGH};
276-
sycl::unsampled_image_accessor<sycl::int4, 3, sycl::access_mode::read,
277-
sycl::image_target::host_task>
278-
UImgAcc3D1{UImg3D1, CGH};
279-
sycl::unsampled_image_accessor<sycl::int4, 1, sycl::access_mode::read,
280-
sycl::image_target::host_task>
281-
UImgAcc1D2{UImg1D2, CGH};
282-
sycl::unsampled_image_accessor<sycl::int4, 2, sycl::access_mode::read,
283-
sycl::image_target::host_task>
284-
UImgAcc2D2{UImg2D2, CGH};
285-
sycl::unsampled_image_accessor<sycl::int4, 3, sycl::access_mode::read,
286-
sycl::image_target::host_task>
287-
UImgAcc3D2{UImg3D2, CGH};
288-
sycl::sampled_image_accessor<sycl::int4, 1, sycl::image_target::host_task>
289-
SImgAcc1D1{SImg1D1, CGH};
290-
sycl::sampled_image_accessor<sycl::int4, 2, sycl::image_target::host_task>
291-
SImgAcc2D1{SImg2D1, CGH};
292-
sycl::sampled_image_accessor<sycl::int4, 3, sycl::image_target::host_task>
293-
SImgAcc3D1{SImg3D1, CGH};
294-
sycl::sampled_image_accessor<sycl::int4, 1, sycl::image_target::host_task>
295-
SImgAcc1D2{SImg1D2, CGH};
296-
sycl::sampled_image_accessor<sycl::int4, 2, sycl::image_target::host_task>
297-
SImgAcc2D2{SImg2D2, CGH};
298-
sycl::sampled_image_accessor<sycl::int4, 3, sycl::image_target::host_task>
299-
SImgAcc3D2{SImg3D2, CGH};
300-
301275
CallableT<decltype(DAcc1D1)>()(DAcc1D1, DAcc1D2);
302276
CallableT<decltype(DAcc2D1)>()(DAcc2D1, DAcc2D2);
303277
CallableT<decltype(DAcc3D1)>()(DAcc3D1, DAcc3D2);
304278
CallableT<decltype(LAcc1D1)>()(LAcc1D1, LAcc1D2);
305279
CallableT<decltype(LAcc2D1)>()(LAcc2D1, LAcc2D2);
306280
CallableT<decltype(LAcc3D1)>()(LAcc3D1, LAcc3D2);
307281
CallableT<decltype(Stream1)>()(Stream1, Stream2);
308-
CallableT<decltype(UImgAcc1D1)>()(UImgAcc1D1, UImgAcc1D2);
309-
CallableT<decltype(UImgAcc2D1)>()(UImgAcc2D1, UImgAcc2D2);
310-
CallableT<decltype(UImgAcc3D1)>()(UImgAcc3D1, UImgAcc3D2);
311-
CallableT<decltype(SImgAcc1D1)>()(SImgAcc1D1, SImgAcc1D2);
312-
CallableT<decltype(SImgAcc2D1)>()(SImgAcc2D1, SImgAcc2D2);
313-
CallableT<decltype(SImgAcc3D1)>()(SImgAcc3D1, SImgAcc3D2);
314282
});
283+
284+
if (Q1.get_device().has(sycl::aspect::ext_intel_legacy_image)) {
285+
Q1.submit([&](sycl::handler &CGH) {
286+
sycl::unsampled_image_accessor<sycl::int4, 1, sycl::access_mode::read,
287+
sycl::image_target::host_task>
288+
UImgAcc1D1{UImg1D1, CGH};
289+
sycl::unsampled_image_accessor<sycl::int4, 2, sycl::access_mode::read,
290+
sycl::image_target::host_task>
291+
UImgAcc2D1{UImg2D1, CGH};
292+
sycl::unsampled_image_accessor<sycl::int4, 3, sycl::access_mode::read,
293+
sycl::image_target::host_task>
294+
UImgAcc3D1{UImg3D1, CGH};
295+
sycl::unsampled_image_accessor<sycl::int4, 1, sycl::access_mode::read,
296+
sycl::image_target::host_task>
297+
UImgAcc1D2{UImg1D2, CGH};
298+
sycl::unsampled_image_accessor<sycl::int4, 2, sycl::access_mode::read,
299+
sycl::image_target::host_task>
300+
UImgAcc2D2{UImg2D2, CGH};
301+
sycl::unsampled_image_accessor<sycl::int4, 3, sycl::access_mode::read,
302+
sycl::image_target::host_task>
303+
UImgAcc3D2{UImg3D2, CGH};
304+
sycl::sampled_image_accessor<sycl::int4, 1, sycl::image_target::host_task>
305+
SImgAcc1D1{SImg1D1, CGH};
306+
sycl::sampled_image_accessor<sycl::int4, 2, sycl::image_target::host_task>
307+
SImgAcc2D1{SImg2D1, CGH};
308+
sycl::sampled_image_accessor<sycl::int4, 3, sycl::image_target::host_task>
309+
SImgAcc3D1{SImg3D1, CGH};
310+
sycl::sampled_image_accessor<sycl::int4, 1, sycl::image_target::host_task>
311+
SImgAcc1D2{SImg1D2, CGH};
312+
sycl::sampled_image_accessor<sycl::int4, 2, sycl::image_target::host_task>
313+
SImgAcc2D2{SImg2D2, CGH};
314+
sycl::sampled_image_accessor<sycl::int4, 3, sycl::image_target::host_task>
315+
SImgAcc3D2{SImg3D2, CGH};
316+
317+
CallableT<decltype(UImgAcc1D1)>()(UImgAcc1D1, UImgAcc1D2);
318+
CallableT<decltype(UImgAcc2D1)>()(UImgAcc2D1, UImgAcc2D2);
319+
CallableT<decltype(UImgAcc3D1)>()(UImgAcc3D1, UImgAcc3D2);
320+
CallableT<decltype(SImgAcc1D1)>()(SImgAcc1D1, SImgAcc1D2);
321+
CallableT<decltype(SImgAcc2D1)>()(SImgAcc2D1, SImgAcc2D2);
322+
CallableT<decltype(SImgAcc3D1)>()(SImgAcc3D1, SImgAcc3D2);
323+
});
324+
}
315325
}

sycl/test-e2e/XPTI/image/accessors.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// REQUIRES: xptifw, opencl
2+
// REQUIRES: aspect-ext_intel_legacy_image
23
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
34
// RUN: %{build} -o %t.out
45
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s

sycl/test/abi/sycl_symbols_linux.dump

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2991,6 +2991,7 @@ _ZN4sycl3_V13ext5intel12experimental15online_compilerILNS3_15source_languageE1EE
29912991
_ZN4sycl3_V13ext5intel12experimental15online_compilerILNS3_15source_languageE1EE7compileIJSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISE_EEEEES8_IhSaIhEERKSE_DpRKT_
29922992
_ZN4sycl3_V13ext5intel12experimental9pipe_base13get_pipe_nameB5cxx11EPKv
29932993
_ZN4sycl3_V13ext5intel12experimental9pipe_base17wait_non_blockingERKNS0_5eventE
2994+
_ZN4sycl3_V13ext5intel12experimental9pipe_base18get_pipe_name_implEPKv
29942995
_ZN4sycl3_V13ext6oneapi10level_zero6detail11make_deviceERKNS0_8platformEm
29952996
_ZN4sycl3_V13ext6oneapi12experimental10mem_adviseENS0_5queueEPvmiRKNS0_6detail13code_locationE
29962997
_ZN4sycl3_V13ext6oneapi12experimental12create_imageENS3_16image_mem_handleERKNS3_16image_descriptorERKNS0_5queueE

sycl/test/abi/sycl_symbols_windows.dump

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4057,6 +4057,7 @@
40574057
?get_nodes@modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEBA?AV?$vector@Vnode@experimental@oneapi@ext@_V1@sycl@@V?$allocator@Vnode@experimental@oneapi@ext@_V1@sycl@@@std@@@std@@XZ
40584058
?get_num_channels@image_mem@experimental@oneapi@ext@_V1@sycl@@QEBAIXZ
40594059
?get_pipe_name@pipe_base@experimental@intel@ext@_V1@sycl@@KA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBX@Z
4060+
?get_pipe_name_impl@pipe_base@experimental@intel@ext@_V1@sycl@@KA?AVstring@detail@56@PEBX@Z
40604061
?get_pitch@image_plain@detail@_V1@sycl@@IEBA?AV?$range@$01@34@XZ
40614062
?get_platform@context@_V1@sycl@@QEBA?AVplatform@23@XZ
40624063
?get_platform@device@_V1@sycl@@QEBA?AVplatform@23@XZ

0 commit comments

Comments
 (0)