Skip to content

Commit 2db1a4f

Browse files
authored
Initial support for ext_oneapi_composite_device. (#12178)
Initial implementation to support `sycl_ext_oneapi_composite_device` specified in #11846. Depends on oneapi-src/unified-runtime#1192. --------- Signed-off-by: Maronas, Marcos <[email protected]> Signed-off-by: Marcos Maronas <[email protected]>
1 parent 34ec82d commit 2db1a4f

File tree

22 files changed

+566
-9
lines changed

22 files changed

+566
-9
lines changed

llvm/include/llvm/SYCLLowerIR/DeviceConfigFile.td

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ def AspectExt_oneapi_fixed_size_group : Aspect<"ext_oneapi_fixed_size_group">;
6767
def AspectExt_oneapi_opportunistic_group : Aspect<"ext_oneapi_opportunistic_group">;
6868
def AspectExt_oneapi_tangle_group : Aspect<"ext_oneapi_tangle_group">;
6969
def AspectExt_intel_matrix : Aspect<"ext_intel_matrix">;
70+
def AspectExt_oneapi_is_composite : Aspect<"ext_oneapi_is_composite">;
71+
def AspectExt_oneapi_is_component : Aspect<"ext_oneapi_is_component">;
7072
// Deprecated aspects
7173
def AspectInt64_base_atomics : Aspect<"int64_base_atomics">;
7274
def AspectInt64_extended_atomics : Aspect<"int64_extended_atomics">;
@@ -116,7 +118,8 @@ def : TargetInfo<"__TestAspectList",
116118
AspectExt_oneapi_interop_memory_import, AspectExt_oneapi_interop_memory_export,
117119
AspectExt_oneapi_interop_semaphore_import, AspectExt_oneapi_interop_semaphore_export,
118120
AspectExt_oneapi_mipmap, AspectExt_oneapi_mipmap_anisotropy, AspectExt_oneapi_mipmap_level_reference, AspectExt_intel_esimd,
119-
AspectExt_oneapi_ballot_group, AspectExt_oneapi_fixed_size_group, AspectExt_oneapi_opportunistic_group, AspectExt_oneapi_tangle_group, AspectExt_intel_matrix],
121+
AspectExt_oneapi_ballot_group, AspectExt_oneapi_fixed_size_group, AspectExt_oneapi_opportunistic_group,
122+
AspectExt_oneapi_tangle_group, AspectExt_intel_matrix, AspectExt_oneapi_is_composite, AspectExt_oneapi_is_component],
120123
[]>;
121124
// This definition serves the only purpose of testing whether the deprecated aspect list defined in here and in SYCL RT
122125
// match.

sycl/doc/extensions/proposed/sycl_ext_oneapi_composite_device.asciidoc renamed to sycl/doc/extensions/experimental/sycl_ext_oneapi_composite_device.asciidoc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@ SYCL specification refer to that revision.
4343

4444
== Status
4545

46-
This is a proposed extension specification, intended to gather community
47-
feedback. Interfaces defined in this specification may not be implemented yet
48-
or may be in a preliminary state. The specification itself may also change in
49-
incompatible ways before it is finalized. *Shipping software products should
50-
not rely on APIs defined in this specification.*
46+
This is an experimental extension specification, intended to provide early
47+
access to features and gather community feedback. Interfaces defined in this
48+
specification are implemented in {dpcpp}, but they are not finalized and may
49+
change incompatibly in future versions of {dpcpp} without prior notice.
50+
*Shipping software products should not rely on APIs defined in this
51+
specification.*
5152

5253

5354
== Backend support status

sycl/include/sycl/detail/pi.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,10 @@ typedef enum {
437437
PI_EXT_ONEAPI_DEVICE_INFO_INTEROP_SEMAPHORE_EXPORT_SUPPORT = 0x2010F,
438438

439439
PI_EXT_ONEAPI_DEVICE_INFO_MATRIX_COMBINATIONS = 0x20110,
440+
441+
// Composite device
442+
PI_EXT_ONEAPI_DEVICE_INFO_COMPONENT_DEVICES = 0x20111,
443+
PI_EXT_ONEAPI_DEVICE_INFO_COMPOSITE_DEVICE = 0x20112,
440444
} _pi_device_info;
441445

442446
typedef enum {

sycl/include/sycl/device_aspect_macros.hpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,16 @@
303303
#define __SYCL_ALL_DEVICES_HAVE_ext_intel_matrix__ 0
304304
#endif
305305

306+
#ifndef __SYCL_ALL_DEVICES_HAVE_ext_oneapi_is_composite__
307+
// __SYCL_ASPECT(ext_oneapi_is_composite, 59)
308+
#define __SYCL_ALL_DEVICES_HAVE_ext_oneapi_is_composite__ 0
309+
#endif
310+
311+
#ifndef __SYCL_ALL_DEVICES_HAVE_ext_oneapi_is_component__
312+
// __SYCL_ASPECT(ext_oneapi_is_component, 60)
313+
#define __SYCL_ALL_DEVICES_HAVE_ext_oneapi_is_component__ 0
314+
#endif
315+
306316
#ifndef __SYCL_ANY_DEVICE_HAS_host__
307317
// __SYCL_ASPECT(host, 0)
308318
#define __SYCL_ANY_DEVICE_HAS_host__ 0
@@ -597,3 +607,13 @@
597607
// __SYCL_ASPECT(ext_intel_matrix, 58)
598608
#define __SYCL_ANY_DEVICE_HAS_ext_intel_matrix__ 0
599609
#endif
610+
611+
#ifndef __SYCL_ANY_DEVICE_HAS_ext_oneapi_is_composite__
612+
// __SYCL_ASPECT(ext_oneapi_is_composite, 59)
613+
#define __SYCL_ANY_DEVICE_HAS_ext_oneapi_is_composite__ 0
614+
#endif
615+
616+
#ifndef __SYCL_ANY_DEVICE_HAS_ext_oneapi_is_component__
617+
// __SYCL_ASPECT(ext_oneapi_is_component, 60)
618+
#define __SYCL_ANY_DEVICE_HAS_ext_oneapi_is_component__ 0
619+
#endif
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//==---------- composite_device.hpp - SYCL Composite Device ----------------==//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#pragma once
10+
11+
#include <sycl/device.hpp>
12+
13+
#include <vector>
14+
15+
namespace sycl {
16+
inline namespace _V1 {
17+
namespace ext::oneapi::experimental {
18+
__SYCL_EXPORT std::vector<device> get_composite_devices();
19+
} // namespace ext::oneapi::experimental
20+
} // namespace _V1
21+
} // namespace sycl

sycl/include/sycl/info/aspects.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,5 @@ __SYCL_ASPECT(ext_oneapi_fixed_size_group, 55)
5353
__SYCL_ASPECT(ext_oneapi_opportunistic_group, 56)
5454
__SYCL_ASPECT(ext_oneapi_tangle_group, 57)
5555
__SYCL_ASPECT(ext_intel_matrix, 58)
56+
__SYCL_ASPECT(ext_oneapi_is_composite, 59)
57+
__SYCL_ASPECT(ext_oneapi_is_component, 60)

sycl/include/sycl/info/ext_oneapi_device_traits.def

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ __SYCL_PARAM_TRAITS_SPEC(ext::oneapi::experimental, device,
3636
__SYCL_PARAM_TRAITS_SPEC(ext::oneapi::experimental, device,
3737
mipmap_max_anisotropy, float,
3838
PI_EXT_ONEAPI_DEVICE_INFO_MIPMAP_MAX_ANISOTROPY)
39+
40+
// Composite devices
41+
__SYCL_PARAM_TRAITS_SPEC(ext::oneapi::experimental, device,
42+
component_devices, std::vector<sycl::device>,
43+
PI_EXT_ONEAPI_DEVICE_INFO_COMPONENT_DEVICES)
44+
__SYCL_PARAM_TRAITS_SPEC(ext::oneapi::experimental, device,
45+
composite_device, sycl::device,
46+
PI_EXT_ONEAPI_DEVICE_INFO_COMPOSITE_DEVICE)
47+
3948
#ifdef __SYCL_PARAM_TRAITS_TEMPLATE_SPEC_NEEDS_UNDEF
4049
#undef __SYCL_PARAM_TRAITS_TEMPLATE_SPEC
4150
#undef __SYCL_PARAM_TRAITS_TEMPLATE_SPEC_NEEDS_UNDEF

sycl/include/sycl/platform.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ class __SYCL_EXPORT platform : public detail::OwnerLessBase<platform> {
188188
/// \return the default context
189189
context ext_oneapi_get_default_context() const;
190190

191+
std::vector<device> ext_oneapi_get_composite_devices() const;
192+
191193
private:
192194
pi_native_handle getNative() const;
193195

sycl/include/sycl/sycl.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
#include <sycl/ext/oneapi/experimental/ballot_group.hpp>
8686
#include <sycl/ext/oneapi/experimental/bfloat16_math.hpp>
8787
#include <sycl/ext/oneapi/experimental/builtins.hpp>
88+
#include <sycl/ext/oneapi/experimental/composite_device.hpp>
8889
#include <sycl/ext/oneapi/experimental/cuda/barrier.hpp>
8990
#include <sycl/ext/oneapi/experimental/fixed_size_group.hpp>
9091
#include <sycl/ext/oneapi/experimental/opportunistic_group.hpp>

sycl/plugins/level_zero/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR)
44
message(STATUS "Download Level Zero loader and headers from github.com")
55

66
set(LEVEL_ZERO_LOADER_REPO "https://github.com/oneapi-src/level-zero.git")
7-
set(LEVEL_ZERO_LOADER_TAG v1.11.0)
7+
set(LEVEL_ZERO_LOADER_TAG v1.15.1)
88

99
# Disable due to a bug https://github.com/oneapi-src/level-zero/issues/104
1010
set(CMAKE_INCLUDE_CURRENT_DIR OFF)

0 commit comments

Comments
 (0)