Skip to content

Commit

Permalink
[SYCL][HIP] Support amd-gpu-gfx1034 as an acceptable value for -fsycl…
Browse files Browse the repository at this point in the history
…-targets (intel#8106)

* AMD GFX1034 is ROCm supported architecture and as such amd-gpu-gfx1034
is added as an acceptable value for -fsycl-targets.
*  Remove `Added in version` for supported architectures.
  • Loading branch information
mmoadeli authored Feb 3, 2023
1 parent 3df87e2 commit 5e86a41
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 80 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 @@ -693,6 +693,7 @@ StringRef SYCL::gen::resolveGenDevice(StringRef DeviceName) {
.Case("amd_gpu_gfx1030", "gfx1030")
.Case("amd_gpu_gfx1031", "gfx1031")
.Case("amd_gpu_gfx1032", "gfx1032")
.Case("amd_gpu_gfx1034", "gfx1034")
.Default("");
return Device;
}
Expand Down Expand Up @@ -757,6 +758,7 @@ SmallString<64> SYCL::gen::getGenDeviceMacro(StringRef DeviceName) {
.Case("gfx1030", "AMD_GPU_GFX1030")
.Case("gfx1031", "AMD_GPU_GFX1031")
.Case("gfx1032", "AMD_GPU_GFX1032")
.Case("gfx1034", "AMD_GPU_GFX1034")
.Default("");
if (!Ext.empty()) {
Macro = "__SYCL_TARGET_";
Expand Down
3 changes: 2 additions & 1 deletion clang/test/Driver/sycl-oneapi-gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,13 @@
// RUN: FileCheck %s --check-prefixes=DEVICE_AMD,MACRO_AMD -DDEV_STR=gfx1031 -DMAC_STR=GFX1031
// RUN: %clangxx -fsycl -fsycl-targets=amd_gpu_gfx1032 -### %s 2>&1 | \
// RUN: FileCheck %s --check-prefixes=DEVICE_AMD,MACRO_AMD -DDEV_STR=gfx1032 -DMAC_STR=GFX1032
// RUN: %clangxx -fsycl -fsycl-targets=amd_gpu_gfx1034 -### %s 2>&1 | \
// RUN: FileCheck %s --check-prefixes=DEVICE_AMD,MACRO_AMD -DDEV_STR=gfx1034 -DMAC_STR=GFX1034
// MACRO_AMD: clang{{.*}} "-triple" "amdgcn-amd-amdhsa"
// MACRO_AMD: "-D__SYCL_TARGET_AMD_GPU_[[MAC_STR]]__"
// DEVICE_AMD: clang-offload-wrapper{{.*}} "-compile-opts=--offload-arch=[[DEV_STR]]{{.*}}"
// MACRO_AMD: clang{{.*}} "-fsycl-is-host"
// MACRO_AMD: "-D__SYCL_TARGET_AMD_GPU_[[MAC_STR]]__"

/// -fsycl-targets=spir64_x86_64 should set a specific macro
// RUN: %clangxx -c -fsycl -fsycl-targets=spir64_x86_64 -### %s 2>&1 | \
// RUN: FileCheck %s --check-prefix=MACRO_X86_64
Expand Down
1 change: 1 addition & 0 deletions sycl/doc/UsersManual.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ and not recommended to use in production environment.
* amd_gpu_gfx1030 - AMD GCN GFX10.3 (RDNA 2) architecture
* amd_gpu_gfx1031 - GCN GFX10.3 (RDNA 2) architecture
* amd_gpu_gfx1032 - GCN GFX10.3 (RDNA 2) architecture
* amd_gpu_gfx1034 - GCN GFX10.3 (RDNA 2) architecture

## Language options

Expand Down
2 changes: 2 additions & 0 deletions sycl/doc/design/DeviceIf.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ recognizes:
* `amd_gpu_gfx1030`
* `amd_gpu_gfx1031`
* `amd_gpu_gfx1032`
* `amd_gpu_gfx1034`

The above listed device names may not be mixed with the existing target name
`spir64_gen` on the same command line. In addition, the user must not pass the
Expand Down Expand Up @@ -190,6 +191,7 @@ one of the following corresponding C++ macro names:
* `__SYCL_TARGET_AMD_GPU_GFX1030__`
* `__SYCL_TARGET_AMD_GPU_GFX1031__`
* `__SYCL_TARGET_AMD_GPU_GFX1032__`
* `__SYCL_TARGET_AMD_GPU_GFX1034__`

If the user invokes the compiler driver with `-fsycl-targets=spir64_x86_64`,
the compiler driver must predefine the following C++ macro name:
Expand Down
Loading

0 comments on commit 5e86a41

Please sign in to comment.