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

Missing example for compiling to multiple implementations #52

Open
kunaltyagi opened this issue Jan 13, 2020 · 3 comments
Open

Missing example for compiling to multiple implementations #52

kunaltyagi opened this issue Jan 13, 2020 · 3 comments

Comments

@kunaltyagi
Copy link

if desired, it can compile the same source code to multiple different implementations

The above line from README suggests this but I couldn't find examples/tutorials/other references regarding the process to do so. Would it be possible to add more information regarding this?

I would also like to generate multiple versions (scalar, avx512, avx2, sse, cuda) to benchmark them (since sometimes avx drops the clock speed and can actually hurt performance in multi-threaded applications). Would it be possible to do this in the same binary?

@mp3guy
Copy link

mp3guy commented Jan 13, 2020

You could split the core code you want to benchmark into a library and then change the compiler options for each version you want to build in CMake?

@kunaltyagi
Copy link
Author

then change the compiler options for each version you want to build in CMake

That would not be ideal (for my case, but a sound advice). Ideally, I would want a single binary to preserve existing pipeline (such as comparing results).

Is it possible to pass a "tag" to tell enoki which version to prefer using overloading? Something like how C++17's execution policy would be ideal. (Then I can use testing frameworks to run everything with type parametrization)

@mp3guy
Copy link

mp3guy commented Jan 13, 2020

You can probably do it in a single binary. You can conditionally name each of the method symbols based on the compilation options and statically link against all of them.

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

No branches or pull requests

2 participants