Skip to content

Commit 9f48bd6

Browse files
committed
do it in the testing infra instead
Signed-off-by: Sarnie, Nick <[email protected]>
1 parent 2d28503 commit 9f48bd6

File tree

6 files changed

+44
-55
lines changed

6 files changed

+44
-55
lines changed

.github/workflows/sycl-linux-precommit.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ jobs:
162162
runner: '["Linux", "amdgpu"]'
163163
image: ghcr.io/intel/llvm/ubuntu2204_build:latest
164164
image_extra_opts: --device=/dev/dri --device=/dev/kfd
165-
extra_cmake_args: -DHIP_PLATFORM="AMD" -DAMD_ARCH="gfx1031"
166165
- name: CUDA system
167166
runner: '["Linux", "cuda"]'
168167
image: ghcr.io/intel/llvm/ubuntu2204_build:latest

.github/workflows/sycl-linux-run-tests.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ on:
2121
type: string
2222
required: True
2323
extra_cmake_args:
24-
description: |
25-
If empty, then HIP_PLATFORM and AMD_ARCH would be automatically added
26-
if inputs.target_devices contains 'ext_oneapi_hip'
2724
type: string
2825
required: False
2926
tests_selector:
@@ -282,13 +279,6 @@ jobs:
282279
run: |
283280
if [ -n "$CMAKE_EXTRA_ARGS" ]; then
284281
echo "opts=$CMAKE_EXTRA_ARGS" >> $GITHUB_OUTPUT
285-
else
286-
if [ "${{ contains(inputs.target_devices, 'ext_oneapi_hip') }}" == "true" ]; then
287-
amd_arch="$( env ONEAPI_DEVICE_SELECTOR=hip:gpu sycl-ls --verbose 2>&1 | grep 'Architecture:' | sed 's|\s*Architecture: amd_gpu_||g' )"
288-
echo 'opts=-DHIP_PLATFORM="AMD" -DAMD_ARCH='$amd_arch'' >> $GITHUB_OUTPUT
289-
else
290-
echo 'opts=' >> $GITHUB_OUTPUT
291-
fi
292282
fi
293283
- name: Configure E2E tests
294284
if: inputs.tests_selector == 'e2e'

sycl/test-e2e/Matrix/joint_matrix_hip_gfx90a.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// RUN: %{build} -fsycl -fsycl-targets=amd_gpu_gfx90a %s -o %t.out
9+
// RUN: %clangxx -fsycl -fsycl-targets=amd_gpu_gfx90a %s -o %t.out
1010
// RUN: %{run} %t.out
1111

12-
// REQUIRES: gpu-amd-gfx90a
12+
// REQUIRES: arch-amd_gpu_gfx90a
1313

1414
#include "joint_matrix_hip_apply.hpp"
1515
#include "joint_matrix_hip_copy.hpp"

sycl/test-e2e/Matrix/joint_matrix_hip_half_gfx90a.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// RUN: %{build} -fsycl -fsycl-targets=amd_gpu_gfx90a %s -o %t.out
9+
// RUN: %clangxx -fsycl -fsycl-targets=amd_gpu_gfx90a %s -o %t.out
1010
// RUN: %{run} %t.out
1111

12-
// REQUIRES: gpu-amd-gfx90a
12+
// REQUIRES: arch-amd_gpu_gfx90a
1313
// REQUIRES: aspect-fp16
1414

1515
#include "joint_matrix_hip_apply.hpp"

sycl/test-e2e/Matrix/runtime_query_hip_gfx90a.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// REQUIRES: gpu-amd-gfx90a
10-
// RUN: %{build} -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx90a -o %t.out
9+
// REQUIRES: arch-amd_gpu_gfx90a
10+
// RUN: %clangxx -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx90a -o %t.out
1111
// RUN: %{run} %t.out
1212

1313
#include <sycl/detail/core.hpp>

sycl/test-e2e/lit.cfg.py

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,6 @@ def open_check_file(file_name):
442442
)
443443
sp = subprocess.check_output(cmd, text=True, shell=True)
444444
for line in sp.splitlines():
445-
if "gfx90a" in line:
446-
config.available_features.add("gpu-amd-gfx90a")
447445
if not line.startswith("["):
448446
continue
449447
(backend, device) = line[1:].split("]")[0].split(":")
@@ -540,42 +538,6 @@ def open_check_file(file_name):
540538
config.cuda_libs_dir = os.path.join(os.environ["CUDA_PATH"], r"lib64")
541539
config.cuda_include = os.path.join(os.environ["CUDA_PATH"], "include")
542540

543-
# FIXME: This needs to be made per-device as well, possibly with a helper.
544-
if "hip:gpu" in config.sycl_devices and config.hip_platform == "AMD":
545-
if not config.amd_arch:
546-
lit_config.error(
547-
"Cannot run tests for HIP without an offload-arch. Please "
548-
+ "specify one via the 'amd_arch' parameter or 'AMD_ARCH' CMake "
549-
+ "variable."
550-
)
551-
llvm_config.with_system_environment("ROCM_PATH")
552-
config.available_features.add("hip_amd")
553-
arch_flag = (
554-
"-Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=" + config.amd_arch
555-
)
556-
config.substitutions.append(
557-
("%rocm_path", os.environ.get("ROCM_PATH", "/opt/rocm"))
558-
)
559-
elif "hip:gpu" in config.sycl_devices and config.hip_platform == "NVIDIA":
560-
config.available_features.add("hip_nvidia")
561-
arch_flag = ""
562-
else:
563-
arch_flag = ""
564-
565-
if lit_config.params.get("compatibility_testing", False):
566-
config.substitutions.append(("%clangxx", " true "))
567-
config.substitutions.append(("%clang", " true "))
568-
else:
569-
config.substitutions.append(
570-
(
571-
"%clangxx",
572-
" " + config.dpcpp_compiler + " " + config.cxx_flags + " " + arch_flag,
573-
)
574-
)
575-
config.substitutions.append(
576-
("%clang", " " + config.dpcpp_compiler + " " + config.c_flags)
577-
)
578-
579541
config.substitutions.append(("%threads_lib", config.sycl_threads_lib))
580542

581543
if lit_config.params.get("ze_debug"):
@@ -805,6 +767,44 @@ def open_check_file(file_name):
805767
else:
806768
config.intel_driver_ver[sycl_device] = {}
807769

770+
if "hip:gpu" in config.sycl_devices and config.hip_platform == "AMD":
771+
if not config.amd_arch:
772+
amd_arch_prefix = "arch-amd_gpu_"
773+
amd_device_arch = [i for i in config.sycl_dev_features["hip:gpu"] if amd_arch_prefix in i]
774+
if len(amd_device_arch) == 0:
775+
lit_config.error(
776+
"Cannot detect architecture for AMD HIP device, specify it explicitly"
777+
)
778+
if len(amd_device_arch) > 1:
779+
lit_config.warning("Multiple AMD HIP devices, using the architecture from the first one")
780+
config.amd_arch = amd_device_arch[0].replace(amd_arch_prefix, "")
781+
llvm_config.with_system_environment("ROCM_PATH")
782+
config.available_features.add("hip_amd")
783+
arch_flag = (
784+
"-Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=" + config.amd_arch
785+
)
786+
config.substitutions.append(
787+
("%rocm_path", os.environ.get("ROCM_PATH", "/opt/rocm"))
788+
)
789+
elif "hip:gpu" in config.sycl_devices and config.hip_platform == "NVIDIA":
790+
config.available_features.add("hip_nvidia")
791+
arch_flag = ""
792+
else:
793+
arch_flag = ""
794+
795+
if lit_config.params.get("compatibility_testing", False):
796+
config.substitutions.append(("%clangxx", " true "))
797+
config.substitutions.append(("%clang", " true "))
798+
else:
799+
config.substitutions.append(
800+
(
801+
"%clangxx",
802+
" " + config.dpcpp_compiler + " " + config.cxx_flags + " " + arch_flag,
803+
)
804+
)
805+
config.substitutions.append(
806+
("%clang", " " + config.dpcpp_compiler + " " + config.c_flags)
807+
)
808808
# Set timeout for a single test
809809
try:
810810
import psutil

0 commit comments

Comments
 (0)