-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/buddy-compiler/buddy-mlir i…
…nto vector
- Loading branch information
Showing
7 changed files
with
70 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,6 @@ | |
|
||
# Clangd cache | ||
.cache | ||
|
||
# Clangd configurations | ||
.clangd |
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,10 @@ | ||
# Python Virtual Environment Setup Guide for Buddy-mlir | ||
|
||
We recommend you to use anaconda3 to create python virtual environment. You should install python packages as buddy-mlir/requirements. | ||
|
||
```bash | ||
$ conda create -n <your virtual environment name> python=3.11 | ||
$ conda activate <your virtual environment name> | ||
$ cd buddy-mlir | ||
$ pip install -r requirements.txt | ||
``` |
File renamed without changes.
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,4 @@ | ||
log.mlir | ||
log.ll | ||
log.s | ||
a.out |
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,43 @@ | ||
//===- GenMemRef.cpp ------------------------------------------------------===// | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// $ export LLVM_DIR=$PWD/../../llvm/ | ||
// $ export LLVM_BUILD_DIR=$LLVM_DIR/build | ||
// $ c++ GenMemRef.cpp \ | ||
-I $LLVM_DIR/llvm/include/ -I $LLVM_BUILD_DIR/include/ \ | ||
-I $LLVM_DIR/mlir/include/ -I $LLVM_BUILD_DIR/tools/mlir/include/ \ | ||
-L$LLVM_BUILD_DIR/lib -lMLIRIR -lMLIRParser -lMLIRSupport -lLLVMCore \ | ||
-lLLVMSupport -lncurses -ltinfo -lstdc++ -lLLVMDemangle \ | ||
-o a.out | ||
// $ ./a.out | ||
|
||
#include "mlir/Dialect/MemRef/IR/MemRef.h" | ||
#include "mlir/IR/BuiltinTypes.h" | ||
#include "mlir/IR/MLIRContext.h" | ||
|
||
int main() { | ||
mlir::MLIRContext context; | ||
mlir::OpBuilder builder(&context); | ||
mlir::Type eleType = builder.getF64Type(); | ||
// Target memref type: | ||
// `memref<?xf64, strided<[1], offset: ?>>` | ||
mlir::MemRefType memrefType = mlir::MemRefType::get( | ||
{mlir::ShapedType::kDynamic}, eleType, | ||
mlir::StridedLayoutAttr::get( | ||
&context, /*offset=*/mlir::ShapedType::kDynamic, /*strides=*/{1})); | ||
memrefType.dump(); | ||
return 0; | ||
} |
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