[BUGFIX, BREAKING] Make activation base class abstract, fix PReLU implementation#223
Merged
sdatkinson merged 4 commits intomainfrom Feb 12, 2026
Merged
[BUGFIX, BREAKING] Make activation base class abstract, fix PReLU implementation#223sdatkinson merged 4 commits intomainfrom
sdatkinson merged 4 commits intomainfrom
Conversation
jfsantos
pushed a commit
to jfsantos/NeuralAmpModelerCore
that referenced
this pull request
Feb 12, 2026
…lementation (sdatkinson#223) * Make activation apply method pure virtual instead of no-op default * Fix bugs * Refactor to throw std::invalid_argument in debug mode, add tests
sdatkinson
added a commit
that referenced
this pull request
Feb 14, 2026
* Add profiling instrumentation for NAM building blocks Adds a profiling framework (NAM/profiling.h, NAM/profiling.cpp) with NAM_PROFILE_START()/NAM_PROFILE_ADD() macros and 14 timing categories. Supports both desktop (std::chrono) and ARM Cortex-M7 (DWT cycle counter) backends. Profiling is compile-time gated via -DNAM_PROFILING. Instruments wavenet _Layer::Process() and _LayerArray::ProcessInner() with per-category timing, and adds profiling reset/print calls to the benchmodel tool. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fixed build flags for benchmodel * Added a command line tool to output memory usage for a given .nam file * Bugfix - checking that condition_dsp is not null in the JSON (#220) * [BUGFIX, BREAKING] Make activation base class abstract, fix PReLU implementation (#223) * Make activation apply method pure virtual instead of no-op default * Fix bugs * Refactor to throw std::invalid_argument in debug mode, add tests * Add TONE3000 support note in README.md (#224) * Replace hardcoded profiling struct with dynamic registry The Timings struct hardcoded 14 named fields, requiring manual updates to reset(), total(), print_results(), and every call site whenever a category was added or removed. Replace with a flat-array registry where types are registered at file scope via register_type(), returning an integer index for O(1) accumulation in the hot path. Also adds NAM_PROFILE_RESTART() macro to replace a raw #ifdef block in wavenet.cpp. --------- Co-authored-by: João Felipe Santos <santosjf@pm.me> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Steven Atkinson <steven@atkinson.mn>
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.
Fixes an issue where PReLU was (wrongly, silently) falling back to a no-op default.
Unfortunately, the
apply(*data, size)signature is a bad choice for generalized activations like PReLU, where the shape of the array ought to be specifically matched. This adds to my other gripes like the contiguous-memory assumption that was the root cause of #101Added tests that assert that the known unhappy path is caught.
Breaking change (w.r.t. v0.3) is that the base class is now abstract.