-
Notifications
You must be signed in to change notification settings - Fork 14
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
Make GPU Code optional #335
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks tests. We need to protect tests that execute on GPU from doing so then and also we need to rework the CI to test the new build path. Currently, for the sake of saving time we build the per-PR tests in a pre-made environment that is always set up with the GPU in path.
I'm approving this, under condition the build message not printing out is handled before merge, because testing no-GPU build path is not high priority at the moment.
|
||
target_link_libraries(search PRIVATE searchcu) | ||
else() | ||
message(STATUS "Skipping CUDA Libraries") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This never prints for me. From the manual it seems as it should. I think I remember reading that Python and C++ don't deal with their prints very nicely in the Pybind docs. Perhaps something similar could be the cause of the lost message. We could punt that out to setup.py
- in which case we can basically be sure it would work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you build with pip install .
, it doesn't show the output of either the cmake messages or python (setup.py). You can get them if you do the individual steps (such as running cmake).
@@ -10,6 +10,7 @@ | |||
#ifndef RAWIMAGE_H_ | |||
#define RAWIMAGE_H_ | |||
|
|||
#include <algorithm> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see anything in your changes to RawImage that calls something from this list: https://cplusplus.com/reference/algorithm/
Is this required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code uses std::sort below, which needs algorithm.
I saw this and the std::isnan
problems in RawImage.cpp when I tried to build on a completely new platform.
Changes the CMake and setup file to compile in CPU only mode in cases where there is no CUDA compiler or valid GPU. Adds
#ifdef
overrides to the C++ code to avoid GPU specific code in CPU-only mode.However this currently only raises an error when we try to call a GPU function. We will need to replace the GPU code with CPU equivalents (where we want them) for tests to pass on non-CPU machines.