Skip to content

Add VOLK_NAMESPACE configuration to use C++ namespaces #222

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zeux
Copy link
Owner

@zeux zeux commented Feb 3, 2025

In some cases the use of global vk* symbols is inconvenient, as it can conflict with vk* functions defined by the loader; generally speaking this should not be required, but some dynamic library cases are difficult to support cleanly.

This problem can be solved when C++ is available: by building volk.h/c as C++ and wrapping functions in volk namespace, which is automatically used, the compiler can still find the functions so no change in source code is necessary, but the global symbols get C++ mangling that never overlaps with vk*.

This is not designed as a main mode of operation, but it can be useful when the default setup doesn't fully work.

zeux added 2 commits February 2, 2025 18:18
In some cases the use of global vk* symbols is inconvenient, as it can
conflict with vk* functions defined by the loader; generally speaking
this should not be required, but some dynamic library cases are
difficult to support cleanly.

This problem can be solved when C++ is available: by building volk.h/c
as C++ and wrapping functions in volk namespace, which is automatically
used, the compiler can still find the functions so no change in source
code is necessary, but the global symbols get C++ mangling that never
overlaps with vk*.

This is not designed as a main mode of operation, but it can be useful
when the default setup doesn't fully work.
@zeux
Copy link
Owner Author

zeux commented Feb 3, 2025

I can merge this if people find it useful.

@zeux
Copy link
Owner Author

zeux commented Feb 16, 2025

Note: this would need to be rebased against #225 (assuming anybody needs this) before merge, as that PR splits the extern "C" block into two.

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.

1 participant