Skip to content

Commit 526d235

Browse files
committed
imex-runner.py: Add option --filecheck that can be used instead of piping to FileCheck.
Add gpu fp64 support checker with l0 api. Replace %gpu_skip with imex-runner.py's --requires option. Skip gpu test that require fp64 if igpu does not have fp64 support.
1 parent 6b2df26 commit 526d235

File tree

136 files changed

+1126
-1002
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+1126
-1002
lines changed

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ else()
2323
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules")
2424
endif()
2525

26+
# CMAKE_SYSTEM_NAME needs to be checked after "project"
27+
if(${CMAKE_VERSION} VERSION_LESS 3.25)
28+
# CMake starting with version 3.25 sets var LINUX to true if target system is linux
29+
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
30+
set(LINUX TRUE)
31+
endif()
32+
endif()
33+
message(STATUS "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
34+
if(LINUX)
35+
message(STATUS "Building for target: LINUX")
36+
endif()
37+
2638
# Expected LLVM SHA
2739
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/build_tools/llvm_version.txt EXPECTED_LLVM_SHA)
2840
message(STATUS "Expected llvm sha: \"${EXPECTED_LLVM_SHA}\"")

lib/ExecutionEngine/SYCLRUNTIME/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ add_mlir_library(sycl-runtime
2727
EXCLUDE_FROM_LIBMLIR
2828
)
2929

30-
target_compile_options (sycl-runtime PUBLIC -fexceptions)
30+
check_cxx_compiler_flag("-frtti" CXX_HAS_FRTTI_FLAG)
31+
if(NOT CXX_HAS_FRTTI_FLAG)
32+
message(FATAL_ERROR "CXX compiler does not accept flag -frtti")
33+
endif()
34+
target_compile_options (sycl-runtime PUBLIC -fexceptions -frtti)
3135

3236
target_include_directories(sycl-runtime PRIVATE
3337
${MLIR_INCLUDE_DIRS}

test/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ if(IMEX_ENABLE_L0_RUNTIME)
3131
)
3232
endif()
3333

34+
if(IMEX_ENABLE_L0_RUNTIME OR IMEX_ENABLE_SYCL_RUNTIME)
35+
list(APPEND IMEX_TEST_DEPENDS
36+
l0-fp64-checker
37+
)
38+
endif()
39+
3440
# "Gen" is the root of all generated test cases
3541
add_subdirectory(Gen)
3642

test/Gen/PlaidML/OpTest.Relu.mlir.in

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
// RUN: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-cpu.pp \
66
// RUN: --runner imex-cpu-runner -e main \
77
// RUN: --shared-libs=%mlir_runner_utils,%irunner_utils \
8-
// RUN: --entry-point-result=void | FileCheck %s
9-
// RUN: %gpu_skip || %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
8+
// RUN: --entry-point-result=void --filecheck
9+
// RUN: %python_executable %imex_runner --requires=l0-runtime -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
1010
// RUN: --runner imex-cpu-runner -e main \
1111
// RUN: --entry-point-result=void \
12-
// RUN: --shared-libs=%mlir_runner_utils,%irunner_utils,%levelzero_runtime | FileCheck %s
12+
// RUN: --shared-libs=%mlir_runner_utils,%irunner_utils,%levelzero_runtime --filecheck
13+
// RUN: %python_executable %imex_runner --requires=sycl-runtime -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
14+
// RUN: --runner imex-cpu-runner -e main \
15+
// RUN: --entry-point-result=void \
16+
// RUN: --shared-libs=%mlir_runner_utils,%irunner_utils,%sycl_runtime --filecheck
1317
#map0 = affine_map<(d0, d1) -> (d0, d1)>
1418
#map1 = affine_map<(d0, d1) -> ()>
1519
module @relu {

test/Gen/PlaidML/lit.local.cfg

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,3 @@ local_excludes = [
22
'OpTest.Relu.bf16.mlir'
33
]
44
config.excludes.update(local_excludes)
5-
6-
if config.gpu_skip == 'true':
7-
config.substitutions.append(('%gpu_skip', 'true'))
8-
else:
9-
config.substitutions.append(('%gpu_skip', 'false'))

test/Integration/Dialect/Linalg/Vulkan/linalg-to-gpu-vulkan.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
convert-parallel-loops-to-gpu
2020
)
2121
// insert-gpu-allocs pass can have client-api = opencl or vulkan args
22-
func.func(insert-gpu-allocs)
22+
func.func(insert-gpu-allocs{client-api=vulkan})
2323
canonicalize
2424
normalize-memrefs
2525
// Unstride memrefs does not seem to be needed.
@@ -30,8 +30,8 @@
3030
cse
3131

3232
// The following set-spirv-* passes can have client-api = opencl or vulkan args
33-
set-spirv-capabilities
34-
gpu.module(set-spirv-abi-attrs)
33+
set-spirv-capabilities{client-api=vulkan}
34+
gpu.module(set-spirv-abi-attrs{client-api=vulkan})
3535
canonicalize
3636
)
3737
// End

test/Jax/gordon/jit__logsm_from_logmhalo_jax_kern_0_before_linalg.mlir

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
// RUN: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-cpu.pp --runner imex-cpu-runner -e main --shared-libs=%mlir_runner_utils --entry-point-result=void | FileCheck %s
2-
// RUN: %gpu_skip || %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
1+
// RUN: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-cpu.pp \
2+
// RUN: --runner imex-cpu-runner -e main \
3+
// RUN: --shared-libs=%mlir_runner_utils,%mlir_c_runner_utils \
4+
// RUN: --entry-point-result=void --filecheck
5+
// RUN: %python_executable %imex_runner --requires=l0-runtime -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
6+
// RUN: --runner imex-cpu-runner -e main \
7+
// RUN: --entry-point-result=void \
8+
// RUN: --shared-libs=%mlir_runner_utils,%mlir_c_runner_utils,%levelzero_runtime --filecheck
9+
// RUN: %python_executable %imex_runner --requires=sycl-runtime -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
310
// RUN: --runner imex-cpu-runner -e main \
411
// RUN: --entry-point-result=void \
5-
// RUN: --shared-libs=%mlir_runner_utils,%sycl_runtime | FileCheck %s
6-
// RUN: %gpu_skip || %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
7-
// RUN: --runner imex-cpu-runner -e main \
8-
// RUN: --entry-point-result=void \
9-
// RUN: --shared-libs=%mlir_runner_utils,%levelzero_runtime | FileCheck %s
10-
12+
// RUN: --shared-libs=%mlir_runner_utils,%mlir_c_runner_utils,%sycl_runtime --filecheck
1113
#map0 = affine_map<() -> ()>
1214
#map1 = affine_map<(d0) -> ()>
1315
#map2 = affine_map<(d0) -> (d0)>

test/Jax/gordon/lit.local.cfg

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
if config.gpu_skip == 'true':
2-
config.substitutions.append(('%gpu_skip', 'true'))
3-
else:
4-
config.substitutions.append(('%gpu_skip', 'false'))
1+
local_excludes = []
2+
config.excludes.update(local_excludes)

test/Jax/janet/jit__get_age_weights_from_tables.8_linalg.mlir

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
// RUN: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-cpu.pp --runner imex-cpu-runner -e main --shared-libs=%mlir_runner_utils --entry-point-result=void | FileCheck %s
2-
// RUN: %gpu_skip || %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
1+
// RUN: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-cpu.pp \
2+
// RUN: --runner imex-cpu-runner -e main \
3+
// RUN: --shared-libs=%mlir_runner_utils,%mlir_c_runner_utils \
4+
// RUN: --entry-point-result=void --filecheck
5+
// RUN: %python_executable %imex_runner --requires=l0-runtime -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
6+
// RUN: --runner imex-cpu-runner -e main \
7+
// RUN: --entry-point-result=void \
8+
// RUN: --shared-libs=%mlir_runner_utils,%mlir_c_runner_utils,%levelzero_runtime --filecheck
9+
// RUN: %python_executable %imex_runner --requires=sycl-runtime -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
310
// RUN: --runner imex-cpu-runner -e main \
411
// RUN: --entry-point-result=void \
5-
// RUN: --shared-libs=%mlir_runner_utils,%sycl_runtime | FileCheck %s
6-
// RUN: %gpu_skip || %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
7-
// RUN: --runner imex-cpu-runner -e main \
8-
// RUN: --entry-point-result=void \
9-
// RUN: --shared-libs=%mlir_runner_utils,%levelzero_runtime | FileCheck %s
10-
12+
// RUN: --shared-libs=%mlir_runner_utils,%mlir_c_runner_utils,%sycl_runtime --filecheck
1113
#map0 = affine_map<(d0) -> (d0)>
1214
#map1 = affine_map<(d0) -> ()>
1315
#map2 = affine_map<() -> ()>

test/Jax/janet/jit__get_lgt_birth.7_linalg.mlir

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
// RUN: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-cpu.pp --runner imex-cpu-runner -e main --shared-libs=%mlir_runner_utils --entry-point-result=void | FileCheck %s
2-
// RUN: %gpu_skip || %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
1+
// RUN: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-cpu.pp \
2+
// RUN: --runner imex-cpu-runner -e main \
3+
// RUN: --shared-libs=%mlir_runner_utils,%mlir_c_runner_utils \
4+
// RUN: --entry-point-result=void --filecheck
5+
// RUN: %python_executable %imex_runner --requires=l0-runtime -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
6+
// RUN: --runner imex-cpu-runner -e main \
7+
// RUN: --entry-point-result=void \
8+
// RUN: --shared-libs=%mlir_runner_utils,%mlir_c_runner_utils,%levelzero_runtime --filecheck
9+
// RUN: %python_executable %imex_runner --requires=sycl-runtime -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
310
// RUN: --runner imex-cpu-runner -e main \
411
// RUN: --entry-point-result=void \
5-
// RUN: --shared-libs=%mlir_runner_utils,%sycl_runtime | FileCheck %s
6-
// RUN: %gpu_skip || %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
7-
// RUN: --runner imex-cpu-runner -e main \
8-
// RUN: --entry-point-result=void \
9-
// RUN: --shared-libs=%mlir_runner_utils,%levelzero_runtime | FileCheck %s
10-
12+
// RUN: --shared-libs=%mlir_runner_utils,%mlir_c_runner_utils,%sycl_runtime --filecheck
1113
#map0 = affine_map<(d0) -> ()>
1214
#map1 = affine_map<(d0) -> (d0)>
1315
#map2 = affine_map<() -> ()>

0 commit comments

Comments
 (0)