Skip to content

Keyboard Input support for picceler#61

Merged
Robertkq merged 5 commits into
mainfrom
Robertkq/keyboard_input
May 31, 2026
Merged

Keyboard Input support for picceler#61
Robertkq merged 5 commits into
mainfrom
Robertkq/keyboard_input

Conversation

@Robertkq

@Robertkq Robertkq commented May 31, 2026

Copy link
Copy Markdown
Owner

This PR will introduce support for reading from the keyboard, see read_input.pic for a clear example of this.

We currently support two functions, read_string and read_number both 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 future

Also added some QoL improvements to the code

This addresses the #52 issue

@Robertkq Robertkq requested review from atamas19, emdevv and toskatron May 31, 2026 09:48
@Robertkq Robertkq self-assigned this May 31, 2026
Copilot AI review requested due to automatic review settings May 31, 2026 09:48

Copilot AI left a comment

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.

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_number ops, MLIRGen support, runtime functions, and an example program.
  • Changed neighborhood op interfaces and affine lowering to work with runtime mlir::Value neighborhood sizes.
  • Added small QoL cleanups including runtime debug logging via spdlog, an integer constant helper, and .clang-tidy filtering.

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.

Comment thread src/picceler_ops_to_func_calls_pass.cpp
Comment thread src/picceler_ops_to_func_calls_pass.cpp
Comment thread lib/src/runtime.cpp
@Robertkq Robertkq merged commit d05c801 into main May 31, 2026
3 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.

4 participants