Keyboard Input support for picceler#61
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds runtime keyboard input support to Picceler through read_string(prompt) and read_number(prompt), wiring new Picceler ops through MLIR generation and runtime-call lowering. It also relaxes neighborhood size handling so some image ops can use runtime SSA values instead of only compile-time constants.
Changes:
- Added
read_string/read_numberops, MLIRGen support, runtime functions, and an example program. - Changed neighborhood op interfaces and affine lowering to work with runtime
mlir::Valueneighborhood sizes. - Added small QoL cleanups including runtime debug logging via
spdlog, an integer constant helper, and.clang-tidyfiltering.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tablegen/ops.td |
Declares new input-related Picceler ops. |
tablegen/interfaces.td |
Updates neighborhood interface to return runtime MLIR values. |
src/picceler_to_affine_pass.cpp |
Consumes dynamic neighborhood sizes in affine lowering. |
src/picceler_ops_to_func_calls_pass.cpp |
Lowers input ops and existing I/O ops to runtime calls via dialect conversion. |
src/ops/erode.cpp |
Computes erode neighborhood size from runtime radius SSA value. |
src/ops/dilate.cpp |
Computes dilate neighborhood size from runtime radius SSA value. |
src/ops/convolution.cpp |
Adapts convolution neighborhood sizing to the new interface. |
src/ops/common.cpp |
Adds shared i64 constant creation helper. |
src/ops.cpp |
Includes error support for generated/interface code. |
src/mlir_gen.cpp |
Emits new input ops and allows runtime float-to-i64 coercion. |
lib/src/runtime.cpp |
Adds keyboard input runtime functions and updates debug logging. |
lib/include/runtime.h |
Declares new runtime input functions. |
include/ops.h |
Exposes error/result and integer constant helper declarations. |
examples/read_input.pic |
Adds an example using keyboard input to drive an image operation. |
.clang-tidy |
Reformats checks and excludes generated TableGen headers. |
emdevv
approved these changes
May 31, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR will introduce support for reading from the keyboard, see
read_input.picfor a clear example of this.We currently support two functions,
read_stringandread_numberboth supporting a(prompt)argument. Also it removes a lot of code that used to verify that input to ops was constant, as this is no longer the case all the time, but some analysis in when compile time information is presented, that optimizations happen, should be conducted at some point in the futureAlso added some QoL improvements to the code
This addresses the #52 issue