Skip to content

Commit

Permalink
[SYCL] Add PVC-VG support to sycl_ext_oneapi_device_architecture
Browse files Browse the repository at this point in the history
This patch adds a support of PVC-VG platfrom (PVC w/o DPAS instruction)
to sycl_ext_oneapi_device_architecture extension
  • Loading branch information
dm-vodopyanov committed Feb 12, 2024
1 parent 2db1a4f commit 81295d9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clang/lib/Driver/ToolChains/SYCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,7 @@ StringRef SYCL::gen::resolveGenDevice(StringRef DeviceName) {
.Cases("intel_gpu_acm_g11", "intel_gpu_dg2_g11", "acm_g11")
.Cases("intel_gpu_acm_g12", "intel_gpu_dg2_g12", "acm_g12")
.Case("intel_gpu_pvc", "pvc")
.Case("intel_gpu_pvc_vg", "pvc_vg")
.Case("nvidia_gpu_sm_50", "sm_50")
.Case("nvidia_gpu_sm_52", "sm_52")
.Case("nvidia_gpu_sm_53", "sm_53")
Expand Down Expand Up @@ -972,6 +973,7 @@ SmallString<64> SYCL::gen::getGenDeviceMacro(StringRef DeviceName) {
.Case("acm_g11", "INTEL_GPU_ACM_G11")
.Case("acm_g12", "INTEL_GPU_ACM_G12")
.Case("pvc", "INTEL_GPU_PVC")
.Case("pvc_vg", "INTEL_GPU_PVC_VG")
.Case("sm_50", "NVIDIA_GPU_SM_50")
.Case("sm_52", "NVIDIA_GPU_SM_52")
.Case("sm_53", "NVIDIA_GPU_SM_53")
Expand Down
1 change: 1 addition & 0 deletions sycl/doc/UsersManual.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ and not recommended to use in production environment.
support are accepted, providing a streamlined interface for AOT. Only one of
these values at a time is supported.
* intel_gpu_pvc - Ponte Vecchio Intel graphics architecture
* intel_gpu_pvc_vg - Ponte Vecchio VG Intel graphics architecture
* intel_gpu_acm_g12, intel_gpu_dg2_g12 - Alchemist G12 Intel graphics architecture
* intel_gpu_acm_g11, intel_gpu_dg2_g11 - Alchemist G11 Intel graphics architecture
* intel_gpu_acm_g10, intel_gpu_dg2_g10 - Alchemist G10 Intel graphics architecture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,14 @@ intel_gpu_pvc
|-
|Ponte Vecchio Intel graphics architecture.

a|
[source]
----
intel_gpu_pvc_vg
----
|-
|Ponte Vecchio VG Intel graphics architecture.

a|
[source]
----
Expand Down
18 changes: 18 additions & 0 deletions sycl/include/sycl/ext/oneapi/experimental/device_architecture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ inline namespace _V1 {
namespace ext::oneapi::experimental {

enum class architecture {
// If new element is added to this enum:
//
// Update
// - sycl_ext_oneapi_device_architecture specification doc
// - "-fsycl-targets" description in sycl/doc/UsersManual.md
//
// Add
// - __SYCL_TARGET_<ARCH>__ to the compiler driver and to all places below.
// - the unique ID of the new architecture in SYCL RT source code to support
// querying the device architecture
//
x86_64,
intel_cpu_spr,
intel_cpu_gnr,
Expand Down Expand Up @@ -43,6 +54,7 @@ enum class architecture {
intel_gpu_acm_g12,
intel_gpu_dg2_g12 = intel_gpu_acm_g12,
intel_gpu_pvc,
intel_gpu_pvc_vg,
// NVIDIA architectures
nvidia_gpu_sm_50,
nvidia_gpu_sm_52,
Expand Down Expand Up @@ -185,6 +197,9 @@ static constexpr ext::oneapi::experimental::architecture max_architecture =
#ifndef __SYCL_TARGET_INTEL_GPU_PVC__
#define __SYCL_TARGET_INTEL_GPU_PVC__ 0
#endif
#ifndef __SYCL_TARGET_INTEL_GPU_PVC_VG__
#define __SYCL_TARGET_INTEL_GPU_PVC_VG__ 0
#endif
#ifndef __SYCL_TARGET_NVIDIA_GPU_SM50__
#define __SYCL_TARGET_NVIDIA_GPU_SM50__ 0
#endif
Expand Down Expand Up @@ -370,6 +385,7 @@ static constexpr bool is_allowable_aot_mode =
(__SYCL_TARGET_INTEL_GPU_ACM_G11__ == 1) ||
(__SYCL_TARGET_INTEL_GPU_ACM_G12__ == 1) ||
(__SYCL_TARGET_INTEL_GPU_PVC__ == 1) ||
(__SYCL_TARGET_INTEL_GPU_PVC_VG__ == 1) ||
(__SYCL_TARGET_NVIDIA_GPU_SM50__ == 1) ||
(__SYCL_TARGET_NVIDIA_GPU_SM52__ == 1) ||
(__SYCL_TARGET_NVIDIA_GPU_SM53__ == 1) ||
Expand Down Expand Up @@ -474,6 +490,8 @@ struct IsAOTForArchitectureClass {
__SYCL_TARGET_INTEL_GPU_ACM_G12__ == 1;
arr[static_cast<int>(arch::intel_gpu_pvc)] =
__SYCL_TARGET_INTEL_GPU_PVC__ == 1;
arr[static_cast<int>(arch::intel_gpu_pvc_vg)] =
__SYCL_TARGET_INTEL_GPU_PVC_VG__ == 1;
arr[static_cast<int>(arch::nvidia_gpu_sm_50)] =
__SYCL_TARGET_NVIDIA_GPU_SM50__ == 1;
arr[static_cast<int>(arch::nvidia_gpu_sm_52)] =
Expand Down

0 comments on commit 81295d9

Please sign in to comment.