Open
Conversation
…iles This refactoring separates DSP-related memory operations from the main memory_op files: - Created memory_op_dsp.h: Contains DSP-specific struct declarations (resize_memory_op_mt, set_memory_op_mt, delete_memory_op_mt) - Created memory_op_dsp.cpp: Contains DSP-specific implementation and template instantiations - Modified memory_op.h: Added include for memory_op_dsp.h and removed DSP-related code - Modified memory_op.cpp: Removed DSP-related headers and implementation - Updated Makefile.Objects: Added memory_op_dsp.o to OBJS_BASE - Removed unused CMakeLists.txt The refactoring maintains all existing functionality while improving code organization by separating DSP-specific code from general memory operations. Modified files: - source/Makefile.Objects - source/source_base/module_device/memory_op.cpp - source/source_base/module_device/memory_op.h New files: - source/source_base/module_device/memory_op_dsp.cpp - source/source_base/module_device/memory_op_dsp.h Removed files: - source/source_base/module_device/CMakeLists.txt (unused)
This refactoring implements dependency inversion for DSP selector: - Created dsp_selector.h and dsp_selector.cpp: Define abstract interface and default implementation for DSP selector - Created dsp_config.cpp: Initialize DSP selector with rank calculation - Modified memory_op_dsp.cpp: Use new DSP selector instead of direct PARAM dependency - Modified input_conv.cpp: Call init_dsp_selector during parameter conversion - Modified parameter.h: Add init_dsp_selector declaration - Updated CMakeLists.txt and Makefile.Objects: Add new files to build system The refactoring eliminates direct dependency between module_device and source_io by using an abstract interface for DSP rank selection. Changes made: - Implemented abstract DspSelector interface - Created DefaultDspSelector implementation - Added create_default_selector factory function - Modified code to use standard C++ exceptions instead of ModuleBase::WARNING_QUIT - Updated build configuration to include new files This change improves code modularity and maintainability by following the dependency inversion principle.
…ve unnecessary device dependency
Collaborator
|
Need testing about whether this can exactly run on DPS hardware. @Cstandardlib |
Cstandardlib
reviewed
Apr 9, 2026
|
|
||
| namespace base_device | ||
| { | ||
| namespace memory |
Collaborator
There was a problem hiding this comment.
This dsp_selector belongs to base_device::memory, but will be used by every function that needs to be run on DSP.
Collaborator
Author
There was a problem hiding this comment.
I think that's fine.
Collaborator
|
Code logic seems a bit strange. This seems to make things much more complex |
Collaborator
Author
It is a new style of coding, we need to have more discussion on this topic. |
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.
refactor: device module