• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: mlir-opt -pass-pipeline="gpu.module(lower-affine)" %s | FileCheck %s
2
3#map0gpufunc = affine_map<(d0) -> (d0)>
4gpu.module @kernels {
5  gpu.func @foo(%arg0 : index, %arg1 : memref<?xf32>) -> f32 {
6    %0 = affine.apply #map0gpufunc(%arg0)
7    %1 = load %arg1[%0] : memref<?xf32>
8    gpu.return %1 : f32
9  }
10
11//      CHECK: gpu.func
12// CHECK-SAME: %[[ARG0:.*]]: index
13//  CHECK-NOT:   affine.apply
14//      CHECK:   load %{{.*}}[%[[ARG0]]]
15}
16