Skip to content

Commit a2b3149

Browse files
committed
Merge branch 'sycl' into pre-ci-ur-2394
2 parents 846839d + bee8a39 commit a2b3149

19 files changed

+193
-27
lines changed

libdevice/sanitizer/asan_rtl.cpp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ static __SYCL_CONSTANT__ const char __generic_to[] =
8080

8181
#define ASAN_DEBUG(X) \
8282
do { \
83-
auto launch_info = (__SYCL_GLOBAL__ const LaunchInfo *)__AsanLaunchInfo; \
83+
auto launch_info = \
84+
(__SYCL_GLOBAL__ const AsanRuntimeData *)__AsanLaunchInfo; \
8485
if (launch_info->Debug) { \
8586
X; \
8687
} \
@@ -125,7 +126,7 @@ inline void ConvertGenericPointer(uptr &addr, uint32_t &as) {
125126
}
126127

127128
inline uptr MemToShadow_CPU(uptr addr) {
128-
auto launch_info = (__SYCL_GLOBAL__ const LaunchInfo *)__AsanLaunchInfo;
129+
auto launch_info = (__SYCL_GLOBAL__ const AsanRuntimeData *)__AsanLaunchInfo;
129130
return launch_info->GlobalShadowOffset + (addr >> ASAN_SHADOW_SCALE);
130131
}
131132

@@ -134,7 +135,7 @@ inline uptr MemToShadow_DG2(uptr addr, uint32_t as) {
134135
ConvertGenericPointer(addr, as);
135136
}
136137

137-
auto launch_info = (__SYCL_GLOBAL__ const LaunchInfo *)__AsanLaunchInfo;
138+
auto launch_info = (__SYCL_GLOBAL__ const AsanRuntimeData *)__AsanLaunchInfo;
138139
if (as == ADDRESS_SPACE_GLOBAL) { // global
139140
uptr shadow_ptr;
140141
if (addr & 0xFFFF000000000000ULL) { // Device USM
@@ -214,7 +215,7 @@ inline uptr MemToShadow_PVC(uptr addr, uint32_t as) {
214215
ConvertGenericPointer(addr, as);
215216
}
216217

217-
auto launch_info = (__SYCL_GLOBAL__ const LaunchInfo *)__AsanLaunchInfo;
218+
auto launch_info = (__SYCL_GLOBAL__ const AsanRuntimeData *)__AsanLaunchInfo;
218219
if (as == ADDRESS_SPACE_GLOBAL) { // global
219220
uptr shadow_ptr;
220221
if (addr & 0xFF00000000000000) { // Device USM
@@ -301,7 +302,7 @@ inline uptr MemToShadow(uptr addr, uint32_t as) {
301302
#elif defined(__LIBDEVICE_DG2__)
302303
shadow_ptr = MemToShadow_DG2(addr, as);
303304
#else
304-
auto launch_info = (__SYCL_GLOBAL__ const LaunchInfo *)__AsanLaunchInfo;
305+
auto launch_info = (__SYCL_GLOBAL__ const AsanRuntimeData *)__AsanLaunchInfo;
305306
if (launch_info->DeviceTy == DeviceType::CPU) {
306307
shadow_ptr = MemToShadow_CPU(addr);
307308
} else if (launch_info->DeviceTy == DeviceType::GPU_PVC) {
@@ -379,12 +380,12 @@ void __asan_internal_report_save(ErrorType error_type) {
379380
__spirv_BuiltInWorkgroupId.y * __spirv_BuiltInNumWorkgroups.z +
380381
__spirv_BuiltInWorkgroupId.z;
381382

382-
auto &SanitizerReport = ((__SYCL_GLOBAL__ LaunchInfo *)__AsanLaunchInfo)
383+
auto &SanitizerReport = ((__SYCL_GLOBAL__ AsanRuntimeData *)__AsanLaunchInfo)
383384
->Report[WG_LID % ASAN_MAX_NUM_REPORTS];
384385

385386
if (atomicCompareAndSet(
386-
&(((__SYCL_GLOBAL__ LaunchInfo *)__AsanLaunchInfo)->ReportFlag), 1,
387-
0) == 0 &&
387+
&(((__SYCL_GLOBAL__ AsanRuntimeData *)__AsanLaunchInfo)->ReportFlag),
388+
1, 0) == 0 &&
388389
atomicCompareAndSet(&SanitizerReport.Flag, Desired, Expected) ==
389390
Expected) {
390391
SanitizerReport.ErrorTy = error_type;
@@ -415,13 +416,13 @@ void __asan_internal_report_save(
415416
__spirv_BuiltInWorkgroupId.y * __spirv_BuiltInNumWorkgroups.z +
416417
__spirv_BuiltInWorkgroupId.z;
417418

418-
auto &SanitizerReport = ((__SYCL_GLOBAL__ LaunchInfo *)__AsanLaunchInfo)
419+
auto &SanitizerReport = ((__SYCL_GLOBAL__ AsanRuntimeData *)__AsanLaunchInfo)
419420
->Report[WG_LID % ASAN_MAX_NUM_REPORTS];
420421

421422
if ((is_recover ||
422423
atomicCompareAndSet(
423-
&(((__SYCL_GLOBAL__ LaunchInfo *)__AsanLaunchInfo)->ReportFlag), 1,
424-
0) == 0) &&
424+
&(((__SYCL_GLOBAL__ AsanRuntimeData *)__AsanLaunchInfo)->ReportFlag),
425+
1, 0) == 0) &&
425426
atomicCompareAndSet(&SanitizerReport.Flag, Desired, Expected) ==
426427
Expected) {
427428

@@ -853,7 +854,7 @@ __asan_set_shadow_dynamic_local(uptr ptr, uint32_t num_args) {
853854

854855
ASAN_DEBUG(__spirv_ocl_printf(__mem_set_shadow_dynamic_local_begin));
855856

856-
auto *launch_info = (__SYCL_GLOBAL__ const LaunchInfo *)__AsanLaunchInfo;
857+
auto *launch_info = (__SYCL_GLOBAL__ const AsanRuntimeData *)__AsanLaunchInfo;
857858
if (num_args != launch_info->NumLocalArgs) {
858859
__spirv_ocl_printf(__mem_report_arg_count_incorrect, num_args,
859860
launch_info->NumLocalArgs);
@@ -887,7 +888,7 @@ __asan_unpoison_shadow_dynamic_local(uptr ptr, uint32_t num_args) {
887888

888889
ASAN_DEBUG(__spirv_ocl_printf(__mem_unpoison_shadow_dynamic_local_begin));
889890

890-
auto *launch_info = (__SYCL_GLOBAL__ const LaunchInfo *)__AsanLaunchInfo;
891+
auto *launch_info = (__SYCL_GLOBAL__ const AsanRuntimeData *)__AsanLaunchInfo;
891892
if (num_args != launch_info->NumLocalArgs) {
892893
__spirv_ocl_printf(__mem_report_arg_count_incorrect, num_args,
893894
launch_info->NumLocalArgs);
@@ -926,7 +927,7 @@ DEVICE_EXTERN_C_NOINLINE void __asan_set_shadow_private(uptr begin, uptr size,
926927

927928
ASAN_DEBUG(__spirv_ocl_printf(__mem_set_shadow_private_begin));
928929

929-
auto *launch_info = (__SYCL_GLOBAL__ const LaunchInfo *)__AsanLaunchInfo;
930+
auto *launch_info = (__SYCL_GLOBAL__ const AsanRuntimeData *)__AsanLaunchInfo;
930931
if (launch_info->PrivateShadowOffset == 0)
931932
return;
932933

sycl/doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,14 +1977,20 @@ Removing this restriction is something we may look at for future revisions of
19771977
The command submission functions defined in
19781978
link:../experimental/sycl_ext_oneapi_enqueue_functions.asciidoc[sycl_ext_oneapi_enqueue_functions]
19791979
can be used adding nodes to a graph when creating a graph from queue recording.
1980-
New methods are also defined that enable submitting an executable graph,
1980+
New methods are also defined that enable submitting an executable graph,
19811981
e.g. directly to a queue without returning an event.
19821982

19831983
==== sycl_ext_oneapi_free_function_kernels
19841984

1985-
`sycl_ext_oneapi_free_function_kernels`, defined in
1985+
`sycl_ext_oneapi_free_function_kernels`, defined in
19861986
link:../proposed/sycl_ext_oneapi_free_function_kernels.asciidoc[sycl_ext_oneapi_free_function_kernels]
1987-
can be used with SYCL Graphs.
1987+
can be used with SYCL Graphs.
1988+
1989+
==== sycl_ext_oneapi_work_group_memory
1990+
1991+
Using the `work_group_memory` object defined in
1992+
link:../experimental/sycl_ext_oneapi_work_group_memory.asciidoc[sycl_ext_oneapi_work_group_memory]
1993+
inside graph kernel nodes is supported.
19881994

19891995
==== sycl_ext_oneapi_work_group_scratch_memory
19901996

sycl/include/sycl/detail/backend_traits_cuda.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
#pragma once
1616

17-
#include <sycl/context.hpp>
1817
#include <sycl/detail/backend_traits.hpp>
1918
#include <sycl/device.hpp>
2019
#include <sycl/event.hpp>
@@ -35,6 +34,9 @@ typedef unsigned int CUdeviceptr;
3534

3635
namespace sycl {
3736
inline namespace _V1 {
37+
38+
class context;
39+
3840
namespace detail {
3941

4042
// TODO the interops for context, device, event, platform and program

sycl/include/sycl/detail/backend_traits_hip.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
#pragma once
1616

17-
#include <sycl/context.hpp>
1817
#include <sycl/detail/backend_traits.hpp>
1918
#include <sycl/device.hpp>
2019
#include <sycl/event.hpp>
@@ -29,6 +28,9 @@ typedef void *HIPdeviceptr;
2928

3029
namespace sycl {
3130
inline namespace _V1 {
31+
32+
class context;
33+
3234
namespace detail {
3335

3436
// TODO the interops for context, device, event, platform and program

sycl/include/sycl/detail/backend_traits_level_zero.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#pragma once
1717

1818
#include <sycl/backend_types.hpp> // for backend
19-
#include <sycl/context.hpp> // for context
2019
#include <sycl/detail/backend_traits.hpp> // for BackendI...
2120
#include <sycl/device.hpp> // for device
2221
#include <sycl/event.hpp> // for event
@@ -45,6 +44,7 @@ typedef struct _ze_module_handle_t *ze_module_handle_t;
4544
namespace sycl {
4645
inline namespace _V1 {
4746
class queue;
47+
class context;
4848

4949
namespace detail {
5050

sycl/include/sycl/detail/backend_traits_opencl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#pragma once
1717

1818
#include <sycl/backend_types.hpp> // for backend
19-
#include <sycl/context.hpp> // for context
2019
#include <sycl/detail/backend_traits.hpp> // for BackendInput, BackendReturn
2120
#include <sycl/detail/cl.h> // for _cl_event, cl_event, cl_de...
2221
#include <sycl/detail/ur.hpp> // for assertion and ur handles
@@ -35,6 +34,7 @@ template <bundle_state State> class kernel_bundle;
3534
class queue;
3635
template <typename T, int Dimensions, typename AllocatorT, typename Enable>
3736
class buffer;
37+
class context;
3838

3939
namespace detail {
4040

sycl/include/sycl/handler.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
#include <sycl/access/access.hpp>
1212
#include <sycl/accessor.hpp>
13-
#include <sycl/context.hpp>
1413
#include <sycl/detail/cg_types.hpp>
1514
#include <sycl/detail/cl.h>
1615
#include <sycl/detail/common.hpp>
@@ -170,6 +169,7 @@ class kernel_impl;
170169
class queue_impl;
171170
class stream_impl;
172171
class event_impl;
172+
class context_impl;
173173
template <typename DataT, int Dimensions, access::mode AccessMode,
174174
access::target AccessTarget, access::placeholder IsPlaceholder>
175175
class image_accessor;

sycl/include/sycl/image.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <sycl/aliases.hpp> // for cl_float, cl_half
1313
#include <sycl/backend_types.hpp> // for backend, backe...
1414
#include <sycl/buffer.hpp> // for range
15-
#include <sycl/context.hpp> // for context
1615
#include <sycl/detail/aligned_allocator.hpp> // for aligned_allocator
1716
#include <sycl/detail/backend_traits.hpp> // for InteropFeature...
1817
#include <sycl/detail/common.hpp> // for convertToArrayOfN
@@ -43,6 +42,7 @@ inline namespace _V1 {
4342

4443
// forward declarations
4544
class handler;
45+
class context;
4646

4747
template <int D, typename A> class image;
4848

sycl/include/sycl/kernel_bundle.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#pragma once
1010

1111
#include <sycl/backend_types.hpp> // for backend, backend_return_t
12-
#include <sycl/context.hpp> // for context
1312
#include <sycl/detail/export.hpp> // for __SYCL_EXPORT
1413
#include <sycl/detail/kernel_desc.hpp> // for get_spec_constant_symboli...
1514
#include <sycl/detail/owner_less_base.hpp> // for OwnerLessBase
@@ -46,6 +45,7 @@ template <backend Backend> class backend_traits;
4645
template <backend Backend, bundle_state State>
4746
auto get_native(const kernel_bundle<State> &Obj)
4847
-> backend_return_t<Backend, kernel_bundle<State>>;
48+
class context;
4949

5050
namespace detail {
5151
class kernel_id_impl;

sycl/include/sycl/queue.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <sycl/async_handler.hpp> // for async_handler
1515
#include <sycl/backend_types.hpp> // for backend, backe...
1616
#include <sycl/buffer.hpp> // for buffer
17-
#include <sycl/context.hpp> // for context
1817
#include <sycl/detail/assert_happened.hpp> // for AssertHappened
1918
#include <sycl/detail/cg_types.hpp> // for check_fn_signa...
2019
#include <sycl/detail/common.hpp> // for code_location

0 commit comments

Comments
 (0)