Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL] Add PVC-VG support to sycl_ext_oneapi_device_architecture #12688

Merged
merged 3 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
1 change: 1 addition & 0 deletions sycl/source/detail/device_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ constexpr std::pair<const int, oneapi_exp_arch> IntelGPUArchitectures[] = {
{0x030e0005, oneapi_exp_arch::intel_gpu_acm_g11},
{0x030e4000, oneapi_exp_arch::intel_gpu_acm_g12},
{0x030f0007, oneapi_exp_arch::intel_gpu_pvc},
{0x030f4007, oneapi_exp_arch::intel_gpu_pvc_vg},
};

// Only for Intel CPU architectures
Expand Down
Loading