Skip to content

Commit c4288a9

Browse files
[SYCL] Add Panther Lake H & U to sycl_ext_oneapi_device_architecture (#16294)
This patch adds two new GPU architectures - Panther Lake H and Panther Lake U to sycl_ext_device_architecture extension. Some small required NFC refactoring was also performed.
1 parent b8e899e commit c4288a9

File tree

12 files changed

+92
-25
lines changed

12 files changed

+92
-25
lines changed

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,6 +1408,8 @@ StringRef SYCL::gen::resolveGenDevice(StringRef DeviceName) {
14081408
.Cases("intel_gpu_arl_h", "intel_gpu_12_74_4", "arl_h")
14091409
.Cases("intel_gpu_bmg_g21", "intel_gpu_20_1_4", "bmg_g21")
14101410
.Cases("intel_gpu_lnl_m", "intel_gpu_20_4_4", "lnl_m")
1411+
.Cases("intel_gpu_ptl_h", "intel_gpu_30_0_4", "ptl_h")
1412+
.Cases("intel_gpu_ptl_u", "intel_gpu_30_1_1", "ptl_u")
14111413
.Case("nvidia_gpu_sm_50", "sm_50")
14121414
.Case("nvidia_gpu_sm_52", "sm_52")
14131415
.Case("nvidia_gpu_sm_53", "sm_53")
@@ -1498,6 +1500,8 @@ SmallString<64> SYCL::gen::getGenDeviceMacro(StringRef DeviceName) {
14981500
.Case("arl_h", "INTEL_GPU_ARL_H")
14991501
.Case("bmg_g21", "INTEL_GPU_BMG_G21")
15001502
.Case("lnl_m", "INTEL_GPU_LNL_M")
1503+
.Case("ptl_h", "INTEL_GPU_PTL_H")
1504+
.Case("ptl_u", "INTEL_GPU_PTL_U")
15011505
.Case("sm_50", "NVIDIA_GPU_SM_50")
15021506
.Case("sm_52", "NVIDIA_GPU_SM_52")
15031507
.Case("sm_53", "NVIDIA_GPU_SM_53")

clang/test/Driver/sycl-oneapi-gpu-intelgpu.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,14 @@
152152
// RUN: FileCheck %s --check-prefixes=DEVICE,MACRO -DDEV_STR=lnl_m -DMAC_STR=LNL_M
153153
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_20_4_4 -### %s 2>&1 | \
154154
// RUN: FileCheck %s --check-prefixes=DEVICE,MACRO -DDEV_STR=lnl_m -DMAC_STR=LNL_M
155+
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_ptl_h -### %s 2>&1 | \
156+
// RUN: FileCheck %s --check-prefixes=DEVICE,MACRO -DDEV_STR=ptl_h -DMAC_STR=PTL_H
157+
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_30_0_4 -### %s 2>&1 | \
158+
// RUN: FileCheck %s --check-prefixes=DEVICE,MACRO -DDEV_STR=ptl_h -DMAC_STR=PTL_H
159+
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_ptl_u -### %s 2>&1 | \
160+
// RUN: FileCheck %s --check-prefixes=DEVICE,MACRO -DDEV_STR=ptl_u -DMAC_STR=PTL_U
161+
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_30_1_1 -### %s 2>&1 | \
162+
// RUN: FileCheck %s --check-prefixes=DEVICE,MACRO -DDEV_STR=ptl_u -DMAC_STR=PTL_U
155163
// MACRO: clang{{.*}} "-triple" "spir64_gen-unknown-unknown"
156164
// MACRO: "-D__SYCL_TARGET_INTEL_GPU_[[MAC_STR]]__"
157165
// MACRO: clang{{.*}} "-fsycl-is-host"

llvm/include/llvm/SYCLLowerIR/DeviceConfigFile.td

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,14 @@ class IntelTargetInfo<string Name, list<Aspect> Aspects, list<int> subGroupSizes
188188
: TargetInfo<Name, IntelBaseAspects # Aspects, subGroupSizesList>;
189189
// Note: only the "canonical" target names are listed here - see
190190
// SYCL::gen::resolveGenDevice().
191-
def : IntelTargetInfo<"intel_gpu_bmg_g21", Fp16Fp64Atomic64, Sg16_32>;
191+
//
192+
// TODO: instructions on how to get "???" values below are required. Currently
193+
// device architectures below which have "???" in it are not fully supported.
194+
//
195+
// def : IntelTargetInfo<"intel_gpu_ptl_u", ???, ???>;
196+
// def : IntelTargetInfo<"intel_gpu_ptl_h", ???, ???>;
192197
def : IntelTargetInfo<"intel_gpu_lnl_m", Fp16Fp64Atomic64, Sg16_32>;
198+
def : IntelTargetInfo<"intel_gpu_bmg_g21", Fp16Fp64Atomic64, Sg16_32>;
193199
def : IntelTargetInfo<"intel_gpu_arl_h", Fp16Fp64Atomic64, Sg8_16_32>;
194200
def : IntelTargetInfo<"intel_gpu_mtl_h", Fp16Fp64Atomic64, Sg8_16_32>;
195201
def : IntelTargetInfo<"intel_gpu_mtl_u", Fp16Fp64Atomic64, Sg8_16_32>;

sycl/doc/UsersManual.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ and not recommended to use in production environment.
4747
Special target values specific to Intel, NVIDIA and AMD Processor Graphics
4848
support are accepted, providing a streamlined interface for AOT. Only one of
4949
these values at a time is supported.
50+
* intel_gpu_ptl_u, intel_gpu_30_1_1 - Panther Lake U Intel graphics architecture
51+
* intel_gpu_ptl_h, intel_gpu_30_0_4 - Panther Lake H Intel graphics architecture
5052
* intel_gpu_lnl_m, intel_gpu_20_4_4 - Lunar Lake Intel graphics architecture
5153
* intel_gpu_bmg_g21, intel_gpu_20_1_4 - Battlemage G21 Intel graphics architecture
5254
* intel_gpu_arl_h, intel_gpu_12_74_4 - Arrow Lake H Intel graphics architecture

sycl/doc/extensions/experimental/sycl_ext_oneapi_device_architecture.asciidoc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,22 @@ intel_gpu_lnl_m
394394
|-
395395
|Lunar Lake Intel graphics architecture.
396396

397+
a|
398+
[source]
399+
----
400+
intel_gpu_ptl_h
401+
----
402+
|-
403+
|Panther Lake H Intel graphics architecture.
404+
405+
a|
406+
[source]
407+
----
408+
intel_gpu_ptl_u
409+
----
410+
|-
411+
|Panther Lake U Intel graphics architecture.
412+
397413
a|
398414
[source]
399415
----
@@ -424,6 +440,8 @@ intel_gpu_12_71_4 = intel_gpu_mtl_h
424440
intel_gpu_12_74_4 = intel_gpu_arl_h
425441
intel_gpu_20_1_4 = intel_gpu_bmg_g21
426442
intel_gpu_20_4_4 = intel_gpu_lnl_m
443+
intel_gpu_30_0_4 = intel_gpu_ptl_h
444+
intel_gpu_30_1_1 = intel_gpu_ptl_u
427445
----
428446
|-
429447
|Aliases for Intel graphics architectures.

sycl/include/sycl/ext/oneapi/experimental/architectures.def renamed to sycl/include/sycl/ext/oneapi/experimental/device_architecture.def

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
1-
2-
// If new element is added to this enum:
3-
//
4-
// Update
5-
// - "detail::min_<category>_architecture" below if needed
6-
// - "detail::max_<category>_architecture" below if needed
7-
// - sycl_ext_oneapi_device_architecture specification doc
8-
// - "-fsycl-targets" description in sycl/doc/UsersManual.md
1+
// If new element is added below:
92
//
3+
// Follow
4+
// - the note about architecture IDs uniqueness below
5+
//
106
// Add
11-
// - new value for -fsycl-targets option to the compiler driver in
12-
// accordance with changes from sycl/doc/UsersManual.md and update the
13-
// compiler driver tests
14-
// - ___SYCL_TARGET_<ARCH>__ to the compiler driver and to all places below
15-
// - the unique ID of the new architecture to the SYCL RT source code to
16-
// support querying the device architecture through
17-
// device::get_info<ext::oneapi::experimental::info::device::architecture>
187
// - alias of architecture if this is Intel GPU architecture in format
198
// intel_gpu_<intel_gpu_arch_version>
20-
// - supported aspects of architecture in
21-
// llvm/include/llvm/SYCLLowerIR/DeviceConfigFile.td
229
//
2310
// Important note about keeping architecture IDs below unique:
2411
// - the architecture ID must be a hex number with 16 digits
@@ -86,6 +73,8 @@ __SYCL_ARCHITECTURE(intel_gpu_mtl_h, 0x0000000311c00400) // Meteor Lake
8673
__SYCL_ARCHITECTURE(intel_gpu_arl_h, 0x0000000312800400) // Arrow Lake H
8774
__SYCL_ARCHITECTURE(intel_gpu_bmg_g21, 0x0000000500400400) // Battlemage G21
8875
__SYCL_ARCHITECTURE(intel_gpu_lnl_m, 0x0000000501000400) // Lunar Lake
76+
__SYCL_ARCHITECTURE(intel_gpu_ptl_h, 0x0000000780000400) // Panther Lake H
77+
__SYCL_ARCHITECTURE(intel_gpu_ptl_u, 0x0000000780400100) // Panther Lake U
8978
//
9079
// NVIDIA architectures
9180
//
@@ -181,4 +170,6 @@ __SYCL_ARCHITECTURE_ALIAS(intel_gpu_12_70_4, intel_gpu_mtl_u)
181170
__SYCL_ARCHITECTURE_ALIAS(intel_gpu_12_71_4, intel_gpu_mtl_h)
182171
__SYCL_ARCHITECTURE_ALIAS(intel_gpu_12_74_4, intel_gpu_arl_h)
183172
__SYCL_ARCHITECTURE_ALIAS(intel_gpu_20_1_4, intel_gpu_bmg_g21)
184-
__SYCL_ARCHITECTURE_ALIAS(intel_gpu_20_4_4, intel_gpu_lnl_m)
173+
__SYCL_ARCHITECTURE_ALIAS(intel_gpu_20_4_4, intel_gpu_lnl_m)
174+
__SYCL_ARCHITECTURE_ALIAS(intel_gpu_30_0_4, intel_gpu_ptl_h)
175+
__SYCL_ARCHITECTURE_ALIAS(intel_gpu_30_1_1, intel_gpu_ptl_u)

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

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,29 @@ inline namespace _V1 {
1717
namespace ext::oneapi::experimental {
1818

1919
enum class architecture : uint64_t {
20+
// If new device architecture is added to sycl_ext_oneapi_device_architecture:
21+
//
22+
// Update
23+
// - device_architecture.def file in the same directory
24+
// - "detail::min_<category>_architecture" below if needed
25+
// - "detail::max_<category>_architecture" below if needed
26+
// - sycl_ext_oneapi_device_architecture specification doc
27+
// - "-fsycl-targets" description in sycl/doc/UsersManual.md
28+
//
29+
// Add
30+
// - new value for -fsycl-targets option to the compiler driver in
31+
// accordance with changes from sycl/doc/UsersManual.md and update the
32+
// compiler driver tests
33+
// - ___SYCL_TARGET_<ARCH>__ to the compiler driver and to all places below
34+
// - the unique ID of the new architecture to the SYCL RT source code to
35+
// support querying the device architecture through
36+
// device::get_info<ext::oneapi::experimental::info::device::architecture>
37+
// - supported aspects of architecture in
38+
// llvm/include/llvm/SYCLLowerIR/DeviceConfigFile.td
39+
//
2040
#define __SYCL_ARCHITECTURE(NAME, VAL) NAME = VAL,
2141
#define __SYCL_ARCHITECTURE_ALIAS(NAME, VAL) NAME = VAL,
22-
#include <sycl/ext/oneapi/experimental/architectures.def>
42+
#include <sycl/ext/oneapi/experimental/device_architecture.def>
2343
#undef __SYCL_ARCHITECTURE
2444
#undef __SYCL_ARCHITECTURE_ALIAS
2545
};
@@ -52,7 +72,7 @@ static constexpr ext::oneapi::experimental::architecture
5272
ext::oneapi::experimental::architecture::intel_gpu_bdw;
5373
static constexpr ext::oneapi::experimental::architecture
5474
max_intel_gpu_architecture =
55-
ext::oneapi::experimental::architecture::intel_gpu_lnl_m;
75+
ext::oneapi::experimental::architecture::intel_gpu_ptl_u;
5676

5777
static constexpr ext::oneapi::experimental::architecture
5878
min_nvidia_gpu_architecture =
@@ -152,6 +172,12 @@ static constexpr ext::oneapi::experimental::architecture
152172
#ifndef __SYCL_TARGET_INTEL_GPU_LNL_M__
153173
#define __SYCL_TARGET_INTEL_GPU_LNL_M__ 0
154174
#endif
175+
#ifndef __SYCL_TARGET_INTEL_GPU_PTL_H__
176+
#define __SYCL_TARGET_INTEL_GPU_PTL_H__ 0
177+
#endif
178+
#ifndef __SYCL_TARGET_INTEL_GPU_PTL_U__
179+
#define __SYCL_TARGET_INTEL_GPU_PTL_U__ 0
180+
#endif
155181
#ifndef __SYCL_TARGET_NVIDIA_GPU_SM_50__
156182
#define __SYCL_TARGET_NVIDIA_GPU_SM_50__ 0
157183
#endif
@@ -352,6 +378,8 @@ static constexpr bool is_allowable_aot_mode =
352378
(__SYCL_TARGET_INTEL_GPU_ARL_H__ == 1) ||
353379
(__SYCL_TARGET_INTEL_GPU_BMG_G21__ == 1) ||
354380
(__SYCL_TARGET_INTEL_GPU_LNL_M__ == 1) ||
381+
(__SYCL_TARGET_INTEL_GPU_PTL_H__ == 1) ||
382+
(__SYCL_TARGET_INTEL_GPU_PTL_U__ == 1) ||
355383
(__SYCL_TARGET_NVIDIA_GPU_SM_50__ == 1) ||
356384
(__SYCL_TARGET_NVIDIA_GPU_SM_52__ == 1) ||
357385
(__SYCL_TARGET_NVIDIA_GPU_SM_53__ == 1) ||
@@ -499,6 +527,12 @@ get_current_architecture_aot() {
499527
#if __SYCL_TARGET_INTEL_GPU_LNL_M__
500528
return ext::oneapi::experimental::architecture::intel_gpu_lnl_m;
501529
#endif
530+
#if __SYCL_TARGET_INTEL_GPU_PTL_H__
531+
return ext::oneapi::experimental::architecture::intel_gpu_ptl_h;
532+
#endif
533+
#if __SYCL_TARGET_INTEL_GPU_PTL_U__
534+
return ext::oneapi::experimental::architecture::intel_gpu_ptl_u;
535+
#endif
502536
#if __SYCL_TARGET_NVIDIA_GPU_SM_50__
503537
return ext::oneapi::experimental::architecture::nvidia_gpu_sm_50;
504538
#endif

sycl/source/detail/device_info.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,10 @@ constexpr std::pair<const int, oneapi_exp_arch> IntelGPUArchitectures[] = {
712712
{0x05010000, oneapi_exp_arch::intel_gpu_lnl_m}, // A0
713713
{0x05010001, oneapi_exp_arch::intel_gpu_lnl_m}, // A1
714714
{0x05010004, oneapi_exp_arch::intel_gpu_lnl_m}, // B0
715+
{0x07800000, oneapi_exp_arch::intel_gpu_ptl_h}, // A0
716+
{0x07800004, oneapi_exp_arch::intel_gpu_ptl_h}, // B0
717+
{0x07804000, oneapi_exp_arch::intel_gpu_ptl_u}, // A0
718+
{0x07804001, oneapi_exp_arch::intel_gpu_ptl_u}, // A1
715719
};
716720

717721
// Only for Intel CPU architectures

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,7 @@ const char *getArchName(const device &Device) {
14131413
case syclex::architecture::ARCH: \
14141414
return #ARCH;
14151415
#define __SYCL_ARCHITECTURE_ALIAS(ARCH, VAL)
1416-
#include <sycl/ext/oneapi/experimental/architectures.def>
1416+
#include <sycl/ext/oneapi/experimental/device_architecture.def>
14171417
#undef __SYCL_ARCHITECTURE
14181418
#undef __SYCL_ARCHITECTURE_ALIAS
14191419
}

sycl/test/include_deps/sycl_accessor.hpp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
// CHECK-NEXT: detail/info_desc_helpers.hpp
6363
// CHECK-NEXT: info/info_desc.hpp
6464
// CHECK-NEXT: ext/oneapi/experimental/device_architecture.hpp
65-
// CHECK-NEXT: ext/oneapi/experimental/architectures.def
65+
// CHECK-NEXT: ext/oneapi/experimental/device_architecture.def
6666
// CHECK-NEXT: ext/oneapi/experimental/forward_progress.hpp
6767
// CHECK-NEXT: ext/oneapi/matrix/query-types.hpp
6868
// CHECK-NEXT: ext/oneapi/matrix/matrix-unified-utils.hpp

sycl/test/include_deps/sycl_detail_core.hpp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
// CHECK-NEXT: detail/info_desc_helpers.hpp
6464
// CHECK-NEXT: info/info_desc.hpp
6565
// CHECK-NEXT: ext/oneapi/experimental/device_architecture.hpp
66-
// CHECK-NEXT: ext/oneapi/experimental/architectures.def
66+
// CHECK-NEXT: ext/oneapi/experimental/device_architecture.def
6767
// CHECK-NEXT: ext/oneapi/experimental/forward_progress.hpp
6868
// CHECK-NEXT: ext/oneapi/matrix/query-types.hpp
6969
// CHECK-NEXT: ext/oneapi/matrix/matrix-unified-utils.hpp

sycl/tools/sycl-ls/sycl-ls.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const char *getArchName(const device &Device) {
7777
case syclex::architecture::ARCH: \
7878
return #ARCH;
7979
#define __SYCL_ARCHITECTURE_ALIAS(ARCH, VAL)
80-
#include <sycl/ext/oneapi/experimental/architectures.def>
80+
#include <sycl/ext/oneapi/experimental/device_architecture.def>
8181
#undef __SYCL_ARCHITECTURE
8282
#undef __SYCL_ARCHITECTURE_ALIAS
8383
}

0 commit comments

Comments
 (0)