Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miranda: check request operation instead of using dynamic_cast #2411

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

heyitsanthony
Copy link
Contributor

For my simulation, approximately 15-20% of CPU time is spent resolving one dynamic_cast in miranda. This dynamic cast does not appear to be necessary because mirandaCPU dispatches GeneratorRequests based on the request's operation.

This patch replaces the dynamic_cast with an operation check and adds an assertion on the MemoryOpRequest's operation type. The assertion ensures a MemoryOpRequest is either READ or WRITE to avoid potential incorrect static_cast'ing into CustomOpRequests.

For my simulation, approximately 15-20% of CPU time is spent resolving one
dynamic_cast in miranda. This dynamic cast does not appear to be necessary
because mirandaCPU dispatches GeneratorRequests based on the request's
operation.

This patch replaces the dynamic_cast with an operation check and adds an
assertion on the MemoryOpRequest's operation type. The assertion ensures
a MemoryOpRequest is either READ or WRITE to avoid potential incorrect
static_cast'ing into CustomOpRequests.
@sst-autotester
Copy link
Contributor

Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
NO INSPECTION HAS BEEN PERFORMED ON THIS PULL REQUEST! - This PR must be inspected by setting label 'AT: PRE-TEST INSPECTED'.

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.

2 participants