This tests interactive CUDA support in clang interpreter and should pass
in case CUDA runtime is not available or no GPUs are available.
Details
- Reviewers
v.g.vassilev
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/unittests/Interpreter/InteractiveCudaTest.cpp | ||
---|---|---|
93 | This could be a bit of a problem. There may be multiple CUDA SDK versions that may be installed on a system at any given time and the libcudart.so you pick here may not be the one you want. I think you may need a way to let the user override CUDA SDK (or libcudart.so) location explicitly. I guess they could do that via LD_LIBRARY_PATH, but for the CUDA compilation in general, knowing CUDA SDK path is essential, as it does affect various compilation options set by the driver. |
clang/unittests/Interpreter/InteractiveCudaTest.cpp | ||
---|---|---|
93 | Yes, this probably would be an issue. It is currently possible to override the CUDA path with a command line argument in clang-repl. But I am not sure what we can do inside a test. |
clang/unittests/Interpreter/InteractiveCudaTest.cpp | ||
---|---|---|
93 | To me it looks like CUDA location should be detected/set at the configuration time and then propagated to the individual tests that need that info. |
clang/unittests/Interpreter/InteractiveCudaTest.cpp | ||
---|---|---|
93 | This version uses CMake to detect the paths as in the example above. I guess this would tie the test to the build system but it should probably be fine for most cases. Unfortunately I don't think we can use the same trick for determining the path in ClangREPL because the interpreter is likely to run on a different system. |
This could be a bit of a problem.
There may be multiple CUDA SDK versions that may be installed on a system at any given time and the libcudart.so you pick here may not be the one you want.
E.g it may be from a recent CUDA version which is not supported by NVIDIA drivers yet.
I think you may need a way to let the user override CUDA SDK (or libcudart.so) location explicitly. I guess they could do that via LD_LIBRARY_PATH, but for the CUDA compilation in general, knowing CUDA SDK path is essential, as it does affect various compilation options set by the driver.