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

compiler: Support compiler flags for Cortex #2531

Merged
merged 3 commits into from
Feb 13, 2025
Merged

compiler: Support compiler flags for Cortex #2531

merged 3 commits into from
Feb 13, 2025

Conversation

georgebisbas
Copy link
Contributor

compiler: Support compiler flags for Cortex on Raspberry pi

@georgebisbas georgebisbas added the arch jitting, archinfo, ... label Feb 6, 2025
@georgebisbas georgebisbas self-assigned this Feb 6, 2025
Copy link

codecov bot commented Feb 6, 2025

Codecov Report

Attention: Patch coverage is 37.20930% with 27 lines in your changes missing coverage. Please review.

Project coverage is 87.30%. Comparing base (2e6c705) to head (990c187).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
devito/arch/compiler.py 25.00% 17 Missing and 1 partial ⚠️
devito/arch/archinfo.py 52.63% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2531      +/-   ##
==========================================
- Coverage   87.30%   87.30%   -0.01%     
==========================================
  Files         238      238              
  Lines       45990    46001      +11     
  Branches     4075     4075              
==========================================
+ Hits        40152    40161       +9     
- Misses       5150     5151       +1     
- Partials      688      689       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

def version(self):
return int(self.name.split('cortexa')[-1])

@cached_property
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this cached, but version is not? Surely the reverse should be true?

I presume it's meant to return 'cortex' or '76'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is meant to retun 76.

Why is this cached, but version is not? Surely the reverse should be true?

I did not think much of it. I just used the recipe of what already exists in Apple, Graviton etc

@@ -443,6 +443,9 @@ def __init_finalize__(self, **kwargs):
self.cflags = ['-mcpu=native'] + self.cflags
elif isinstance(platform, Graviton):
self.cflags = ['-mcpu=%s' % platform.march] + self.cflags
elif isinstance(platform, Cortex):
self.cflags += ['-march=%s' % platform.march]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: could be fstring

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I guess for homogeneity I should change the whole file? If this is a transition devito codebase is doing I am happy to do it.

@@ -468,11 +469,6 @@ class ArmCompiler(GNUCompiler):

def __init_finalize__(self, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this constructor can go

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole class is redundant now...but keeping for compatibility I guess.

@mloubout mloubout merged commit caaac39 into master Feb 13, 2025
31 checks passed
@mloubout mloubout deleted the arm_cortex branch February 13, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch jitting, archinfo, ...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants