Skip to content

update relu_kernel.mlir#236

Merged
n0thingNoob merged 11 commits intomainfrom
testbench
Jan 17, 2026
Merged

update relu_kernel.mlir#236
n0thingNoob merged 11 commits intomainfrom
testbench

Conversation

@n0thingNoob
Copy link
Copy Markdown
Collaborator

Using the relu.cpp in for_loop to replace the original relu kernel

Copilot AI review requested due to automatic review settings January 15, 2026 00:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the ReLU kernel test to use a C++ integer-based implementation (relu_int.cpp) instead of the previous C implementation (relu.c). The change simplifies the kernel and updates all test expectations accordingly.

Changes:

  • Updated compilation from C (clang, C11) to C++ (clang++, C++17)
  • Replaced source file from relu.c to relu_int.cpp
  • Updated test expectations (MAPPING, YAML, ASM checks) to match the simpler integer-based ReLU kernel output

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

//
// Check the mapped MLIR contains proper structure and neura operations.
// Check the mapped MLIR contains key operations with full statements.
// RUN: FileCheck %s --input-file=%t-mapping.mlir -check-prefix=MAPPING
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The FileCheck command for the MAPPING prefix is duplicated on line 29 and line 34. Line 34 appears to be redundant as line 29 already checks the same file with the same prefix. Consider removing the duplicate on line 34, or if both are intentional, add a comment explaining why the same check needs to run twice.

Copilot uses AI. Check for mistakes.
// RUN: clang -S -emit-llvm -O3 -fno-vectorize -fno-unroll-loops -std=c11 \
// RUN: -I %S/../../benchmark/CGRA-Bench/kernels/relu -DSMALL_DATASET \
// RUN: -o %t-kernel-full.ll %S/../../benchmark/CGRA-Bench/kernels/relu/relu.c
// Compile the int ReLU C++ kernel to LLVM IR.
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The comment says "int ReLU" but doesn't specify what makes it different from the previous version. Consider adding more context about what "int ReLU" means (e.g., "integer-based ReLU" or "ReLU operating on integer arrays") to improve clarity for future readers.

Suggested change
// Compile the int ReLU C++ kernel to LLVM IR.
// Compile the integer-based ReLU C++ kernel (operating on integer arrays) to LLVM IR.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@tancheng tancheng left a comment

Choose a reason for hiding this comment

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

Shouldn't we upload relu_int.cpp into testbench submodule and sync it in this PR?

@n0thingNoob
Copy link
Copy Markdown
Collaborator Author

Shouldn't we upload relu_int.cpp into testbench submodule and sync it in this PR?

Yes, I am doing that right now.

@n0thingNoob n0thingNoob merged commit a81acc2 into main Jan 17, 2026
2 checks passed
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