Skip to content

Add relu.cpp example in test/neura/for_loop#127

Closed
zsjiang99 wants to merge 2 commits intocoredac:mainfrom
zsjiang99:main
Closed

Add relu.cpp example in test/neura/for_loop#127
zsjiang99 wants to merge 2 commits intocoredac:mainfrom
zsjiang99:main

Conversation

@zsjiang99
Copy link
Copy Markdown
Collaborator

@zsjiang99 zsjiang99 commented Sep 20, 2025

Write a relu.cpp file in this path.

@zsjiang99 zsjiang99 requested a review from tancheng September 20, 2025 01:05
output[i] += 0;
}
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, cheng. I’ve modified other parts of relu.cpp, but I’ll need a bit more time to provide the MLIR test.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, take your time.

The corresponding mlir test has no mlir IRs there, it is just a bunch of commands to transform your provided C++ to our neura dialect.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean that we only need to provide the RUN part, but not the CHECK part?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHECK part is also necessary, but they are just what generated by the corresponding command. For example,

// RUN: mlir-neura-opt %t-kernel.mlir\
// RUN:   --assign-accelerator \
// RUN:   --lower-llvm-to-neura \
// RUN:   --canonicalize-live-in \
// RUN:   --leverage-predicated-value \
// RUN:  | FileCheck %s

the FileCheck %s is for making sure the code/IR after CHECK and CHECK-NEXT are generated from above commands.

// RUN: | FileCheck %s --check-prefix=CHECK-FUSED is for making sure the code/IR after CHECK-FUSED and CHECK-FUSED-NEXT are generated from following commands:

// RUN: mlir-neura-opt %t-kernel.mlir\
// RUN:   --assign-accelerator \
// RUN:   --lower-llvm-to-neura \
// RUN:   --canonicalize-live-in \
// RUN:   --leverage-predicated-value \
// RUN:   --transform-ctrl-to-data-flow \
// RUN:   --fold-constant \
// RUN:   --fuse-pattern \
// RUN:  | FileCheck %s --check-prefix=CHECK-FUSED

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I see. I will try to make a mlir test for relu.cpp.

@tancheng
Copy link
Copy Markdown
Contributor

tancheng commented Oct 7, 2025

We can close this PR as the test is already there? @ShangkunLi @zsjiang99?

@ShangkunLi
Copy link
Copy Markdown
Collaborator

We can close this PR as the test is already there? @ShangkunLi @zsjiang99?

This test has already been added in

// RUN: clang++ -S -emit-llvm -O1 -o %t-relu.ll relu.cpp

@tancheng tancheng closed this Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants