-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AIEX] Add symbol-based IpuDmaWaitOp (#1220)
- Loading branch information
Showing
7 changed files
with
210 additions
and
16 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
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,23 @@ | ||
//===- dma_to_ipu_invalid.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 | ||
// | ||
// (c) Copyright 2024 Advanced Micro Devices, Inc. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// RUN: aie-opt --aie-dma-to-ipu --verify-diagnostics %s | ||
|
||
module { | ||
aie.device(ipu) { | ||
memref.global "public" @toMem : memref<16xi32> | ||
func.func @sequence() { | ||
// expected-error@+2 {{failed to legalize operation 'aiex.ipu.dma_wait' that was explicitly marked illegal}} | ||
// expected-error@+1 {{couldn't find shim_dma_allocation op}} | ||
aiex.ipu.dma_wait {symbol = @toMem} | ||
return | ||
} | ||
} | ||
} |
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,27 @@ | ||
//===- invalid.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) 2024, Advanced Micro Devices, Inc. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// RUN: aie-opt --split-input-file --verify-diagnostics %s | ||
|
||
func.func @ipu_dma_wait_no_device() { | ||
// expected-error@+1 {{'aiex.ipu.dma_wait' op couldn't find parent of type DeviceOp}} | ||
aiex.ipu.dma_wait {symbol = @out0} | ||
return | ||
} | ||
|
||
// ----- | ||
|
||
aie.device(ipu) { | ||
func.func @ipu_dma_wait_no_symbol() { | ||
// expected-error@+1 {{'aiex.ipu.dma_wait' op couldn't find symbol in parent device}} | ||
aiex.ipu.dma_wait {symbol = @out0} | ||
return | ||
} | ||
} |
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,22 @@ | ||
//===- roundtrip.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) 2024, Advanced Micro Devices, Inc. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// RUN: aie-opt --split-input-file %s | FileCheck %s | ||
|
||
// CHECK-LABEL: func.func @ipu_dma_wait | ||
// CHECK: aiex.ipu.dma_wait {symbol = @out0} | ||
|
||
aie.device(ipu) { | ||
memref.global "public" @out0 : memref<16xi32> | ||
func.func @ipu_dma_wait() { | ||
aiex.ipu.dma_wait {symbol = @out0} | ||
return | ||
} | ||
} |