Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanradanov committed Jun 24, 2023
1 parent 71a2b1f commit 7515cc6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/polygeist-opt/pgo.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ module {
// CHECK: %[[VAL_0:.*]] = llvm.mlir.constant(2 : i32) : i32
// CHECK: %[[VAL_1:.*]] = llvm.mlir.constant(0 : i32) : i32
// CHECK: %[[VAL_2:.*]] = llvm.mlir.constant(1 : i32) : i32
// CHECK: %[[VAL_3:.*]] = llvm.mlir.addressof @kernelId.0 : !llvm.ptr<array<70 x i8>>
// CHECK: %[[VAL_4:.*]] = llvm.getelementptr %[[VAL_3]][0, 0] : (!llvm.ptr<array<70 x i8>>) -> !llvm.ptr<i8>
// CHECK: %[[VAL_3:.*]] = llvm.mlir.addressof @kernelId.0 : !llvm.ptr<array<[[LEN:.*]] x i8>>
// CHECK: %[[VAL_4:.*]] = llvm.getelementptr %[[VAL_3]][0, 0] : (!llvm.ptr<array<[[LEN]] x i8>>) -> !llvm.ptr<i8>
// CHECK: %[[VAL_5:.*]] = llvm.call @mgpurtPGOGetAlternative(%[[VAL_4]], %[[VAL_0]]) : (!llvm.ptr<i8>, i32) -> i32
// CHECK: %[[VAL_6:.*]] = llvm.icmp "eq" %[[VAL_5]], %[[VAL_1]] : i32
// CHECK: llvm.cond_br %[[VAL_6]], ^bb1, ^bb2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: cgeist %s --cuda-lower --cuda-gpu-arch=sm_60 -nocudalib -nocudainc %resourcedir --function=* -S -emit-llvm-dialect -output-intermediate-gpu=1 -emit-cuda -c | FileCheck %s
// TODO only do this test if we have a cuda build

#include "Inputs/cuda.h"
#include "../Inputs/cuda.h"
#include "__clang_cuda_builtin_vars.h"

__device__ float dev_array[2];
Expand Down
7 changes: 6 additions & 1 deletion tools/cgeist/Test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)

# suffixes: A list of file extensions to treat as test files. This is overriden
# by individual lit.local.cfg files in the test subdirectories.

config.suffixes = ['.c', '.cpp', '.cu']

# excludes: A list of directories or files to exclude from the testsuite even
# if they match the suffixes pattern.
#config.excludes = ['Inputs']
config.excludes = []
if config.polygeist_enable_cuda == "0":
config.excludes += ['CUDA']
if config.polygeist_enable_rocm == "0":
config.excludes += ['ROCm']

# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)
Expand Down
2 changes: 2 additions & 0 deletions tools/cgeist/Test/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.mlir_clang_obj_root = "@MLIR_CLANG_BINARY_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.llvm_obj_root = path(r"@LLVM_BINARY_DIR@")
config.polygeist_enable_cuda = "@POLYGEIST_ENABLE_CUDA@"
config.polygeist_enable_rocm = "@POLYGEIST_ENABLE_ROCM@"

# Support substitution of the tools and build_mode with user parameters.
# This is used when we can't determine the tool dir at configuration time.
Expand Down

0 comments on commit 7515cc6

Please sign in to comment.