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

Transpilation: optional arguments #385

Merged
merged 6 commits into from
Oct 7, 2024
Merged

Conversation

MichaelSt98
Copy link
Collaborator

Allow/handle optional arguments for c-like-backends.
For

  • cgen - assume all optional arguments are passed (inherently unsafe, thus warn)
  • cppgen (and all backends derived from that) - proper handling via optional argument with default value nullptr
    • arguments that would have been passed by value are instead passed as pointer if they are optional

Moreover, introduced capabilities to jit compile C++ files (in addition to C files).

Copy link

Documentation for this branch can be viewed at https://sites.ecmwf.int/docs/loki/385/index.html

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 99.13043% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.49%. Comparing base (cc179b3) to head (3e6e7b8).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
loki/build/compiler.py 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #385      +/-   ##
==========================================
+ Coverage   95.48%   95.49%   +0.01%     
==========================================
  Files         185      185              
  Lines       38646    38744      +98     
==========================================
+ Hits        36902    37000      +98     
  Misses       1744     1744              
Flag Coverage Δ
lint_rules 96.39% <ø> (ø)
loki 95.48% <99.13%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Collaborator

@reuterbal reuterbal left a comment

Choose a reason for hiding this comment

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

Very neat! A few minor nitpicks but otherwise good to go

loki/backend/cgen.py Outdated Show resolved Hide resolved
loki/backend/cgen.py Show resolved Hide resolved
loki/build/obj.py Outdated Show resolved Hide resolved
loki/transformations/transpile/fortran_c.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@reuterbal reuterbal left a comment

Choose a reason for hiding this comment

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

Many thanks, looks great! I'll do a rebase and merge once green

@reuterbal reuterbal added the ready for merge This PR has been approved and is ready to be merged label Oct 7, 2024
Copy link
Collaborator

@mlange05 mlange05 left a comment

Choose a reason for hiding this comment

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

Very nice! Looks great, GTG. :shipit:

@reuterbal reuterbal merged commit 6ecf132 into main Oct 7, 2024
13 checks passed
@reuterbal reuterbal deleted the nams-cpp-like-optional-args branch October 7, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for merge This PR has been approved and is ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants