Skip to content

Conversation

@JDBetteridge
Copy link
Contributor

This is WIP, I need this for a separate piece of work

@JDBetteridge JDBetteridge added compiler WIP Still work in progress labels Nov 5, 2025
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

❌ Patch coverage is 31.25000% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.20%. Comparing base (77c6edc) to head (7b2209c).

Files with missing lines Patch % Lines
devito/arch/archinfo.py 27.27% 16 Missing ⚠️
devito/arch/compiler.py 33.33% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2784      +/-   ##
==========================================
- Coverage   83.07%   78.20%   -4.88%     
==========================================
  Files         248      248              
  Lines       50623    50644      +21     
  Branches     4460     4462       +2     
==========================================
- Hits        42053    39604    -2449     
- Misses       7808    10206    +2398     
- Partials      762      834      +72     
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX ?
pytest-gpu-nvc-nvidiaX ?

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@EdCaunt EdCaunt left a comment

Choose a reason for hiding this comment

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

Looks good to me (pending Fabio's typo)

@JDBetteridge JDBetteridge changed the title compiler: Add shared object versioning to pgcc Remove PGI compiler and add shared object versioning to nvcc Nov 6, 2025
@JDBetteridge JDBetteridge force-pushed the JDBetteridge/tweak_compilers branch 2 times, most recently from f2d5ce1 to ecee115 Compare November 7, 2025 01:10
@JDBetteridge JDBetteridge force-pushed the JDBetteridge/tweak_compilers branch from ecee115 to e89e262 Compare November 7, 2025 01:12
except (FileNotFoundError, CalledProcessError):
pass
finally:
if out.returncode == 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can probably use re to oneline it but that's fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opted for this to make it consistent with the BASH method used to extract the version used in the dockerfiles. There might be better ways of obtaining this information 😅

start = out.stdout.find(',', start)
stop = out.stdout.find('\n', start)
with suppress(InvalidVersion):
cuda_version = parse(out.stdout[start:stop])
Copy link
Contributor

Choose a reason for hiding this comment

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

IS this more robust than Version(....) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AFAICT they are identical: https://packaging.pypa.io/en/stable/version.html#packaging.version.parse

parse just seemed to be more descriptive here.

for soname in versioned
])
super().add_libraries(filterfalse(lambda s: s.startswith(':'), new))

Copy link
Contributor

Choose a reason for hiding this comment

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

Would make CudaCompiler inherit from NvidiaCompiler to habe a single version/cxxstd

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems like a good idea, however:

  • nvc is derived from the old Portland compiler
  • nvcc is only for compiling CUDA code and leverages a host compiler gcc, clang, etc...

That is to say: nvcc isn't a type of nvc and I don't think inheritance is appropriate here, especially since the NvidiaCompiler differs significantly from the GCC compiler, which is unfortunately the base of the "generic" Compiler class . There are several issues with the inheritance pattern used in the compiler.py file and it would be nice to do a bit of a tidy up, like I previously did here. But that can wait for another PR, I think!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler WIP Still work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants