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

Enabled P/Invoke source generation with LibraryImport. #946

Merged
merged 3 commits into from
Mar 14, 2023

Conversation

MoFtZ
Copy link
Collaborator

@MoFtZ MoFtZ commented Feb 18, 2023

.NET 7 introduced a replacement for DllImport that uses source generation.

This PR updates CuRand and CuBlas implementations to use the ILGPU DLL Library Import helper. Note that this introduces a breaking API change - CuBlasAPIVersion and CuRandAPIVersion are moved from the ILGPU.Algorithms.Cuda namespace to ILGPU.Algorithms.Cuda.API.

Then, that helper code has been updated to generate the new LibraryImport attribute for .NET 7 or greater. The string handling has been updated to the new StringMarshalling style, with a fallback behaviour.

@m4rs-mt m4rs-mt added this to the v1.4 milestone Mar 13, 2023
@m4rs-mt m4rs-mt added the feature A new feature (or feature request) label Mar 13, 2023
@MoFtZ MoFtZ merged commit b4ed1a4 into m4rs-mt:master Mar 14, 2023
@MoFtZ MoFtZ deleted the feature/library-import branch March 14, 2023 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature (or feature request)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants