-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up and restructure objectfifo MLIR tests (#1966)
Co-authored-by: AndraBisca <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Pranathi Vasireddy <[email protected]>
- Loading branch information
1 parent
ab9760e
commit 5c503f2
Showing
120 changed files
with
3,952 additions
and
1,492 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
//===- objectfifo_bad.mlir --------------------------------------*- MLIR -*-===// | ||
// | ||
// This file is licensed under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
// Copyright (C) 2025, Advanced Micro Devices, Inc. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// RUN: not aie-opt -split-input-file %s 2>&1 | FileCheck %s | ||
|
||
// CHECK: 'aie.objectfifo' op does not have enough depths specified for producer and for each consumer. | ||
|
||
aie.device(xcve2302) { | ||
%tile12 = aie.tile(1, 2) | ||
%tile13 = aie.tile(1, 3) | ||
%tile23 = aie.tile(2, 3) | ||
|
||
aie.objectfifo @of_0 (%tile12, {%tile13, %tile23}, [2, 2]) : !aie.objectfifo<memref<16xi32>> | ||
} | ||
|
||
// ----- | ||
|
||
// CHECK: custom op 'aie.objectfifo' initial values should initialize all objects | ||
|
||
aie.device(xcve2302) { | ||
%tile12 = aie.tile(1, 2) | ||
%tile23 = aie.tile(2, 3) | ||
|
||
aie.objectfifo @of0 (%tile12, {%tile23}, 3 : i32) : !aie.objectfifo<memref<4xi32>> = [dense<[0, 1, 2, 3]> : memref<4xi32>] | ||
} | ||
|
||
// ----- | ||
|
||
// CHECK: custom op 'aie.objectfifo' initial value should be an elements attribute | ||
|
||
aie.device(xcve2302) { | ||
%tile12 = aie.tile(1, 2) | ||
%tile23 = aie.tile(2, 3) | ||
|
||
aie.objectfifo @of0 (%tile12, {%tile23}, 1 : i32) : !aie.objectfifo<memref<4xi32>> = [[0, 1, 2, 3]] | ||
} | ||
|
||
// ----- | ||
|
||
// CHECK: inferred shape of elements literal ({{\[}}2, 3]) does not match type ({{\[}}2, 2]) | ||
|
||
aie.device(xcve2302) { | ||
%tile12 = aie.tile(1, 2) | ||
%tile23 = aie.tile(2, 3) | ||
|
||
aie.objectfifo @of0 (%tile12, {%tile23}, 2 : i32) : !aie.objectfifo<memref<2x2xi32>> = [dense<[[4, 5], [6, 7]]> : memref<2x2xi32>, | ||
dense<[[0, 1, 2], [3, 4, 5]]> : memref<2x2xi32>] | ||
} | ||
|
||
// ----- | ||
|
||
// CHECK: `via_shared_mem` can only be used in 1-to-1 object FIFOs | ||
|
||
aie.device(xcve2302) { | ||
%tile20 = aie.tile(2, 0) | ||
%tile13 = aie.tile(1, 3) | ||
%tile23 = aie.tile(2, 3) | ||
|
||
aie.objectfifo @of_0 (%tile20, {%tile13, %tile23}, 2 : i32) {via_shared_mem = 1 : i32} : !aie.objectfifo<memref<16xi32>> | ||
} | ||
|
||
// ----- | ||
|
||
// CHECK: `via_shared_mem` and `via_DMA` cannot occur together | ||
|
||
aie.device(xcve2302) { | ||
%tile12 = aie.tile(1, 2) | ||
%tile13 = aie.tile(1, 3) | ||
|
||
aie.objectfifo @of_0 (%tile12, {%tile13}, 2 : i32) {via_shared_mem = 1 : i32, via_DMA = true} : !aie.objectfifo<memref<16xi32>> | ||
} |
Oops, something went wrong.