-
Notifications
You must be signed in to change notification settings - Fork 204
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
Create NVRTCC, a utility for running tests under NVRTC #494
Conversation
Current status on Windows:
|
We can now build NVRTC tests with |
|
||
// Start by parsing arguments and building the configuration | ||
std::string c_arg{}; | ||
for (auto a = g_argv; a < g_argv + g_argc; a++) { |
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.
snarky suggestion: std::regex
. I'm not even mad, I'm impressed. However, would it be easier to just use an existing lib like cxxopts for this?
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 think as we discussed. Pulling in dependencies where we might need to be building in 'weird places' makes me not want to use them... STL-only seems safest from a 'will work almost anywhere' standpoint.
// Load the input file and execute | ||
if (execute) { | ||
fprintf(stderr, "Executing %s with %i threads\r\n", executionConfig.builds[0].c_str(), executionConfig.rc.threadCount); | ||
load_and_run_gpu_code(executionConfig.builds[0], executionConfig.rc); |
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.
question: Instead of needing to pass the produced fatbin to nvrtcc
in order to execute the program, couldn't nvrtcc
just produce a binary that does this step for you?
Basically, it would store the fatbin in the binary, and in the main()
it would do load_and_run_gpu_code(/*stored fatbin*/)
.
That way, nvrtcc would work even more like a regular compiler in that it outputs a normal binary that can be executed just like ./a.out
.
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 is essentially what the old script did. It produced a binary with the raw test stored inside and compiled it during execution. Every test was recompiled into the same hosting application. It bought us the 'works like a binary thing' but failed for giving us negative testing with .fail.cpp tests.
It might be possible to do this. It would get rid of needing to use the PrefixExecutor()
for tests. I'll make a PR after this one with the documentation in mind.
Problematically it may try to enable more features than required.
This change adds an output file created during build. It contains information required for launching on GPU.
Fix unsupported nvcc/nvrtc mixup.
* Some files require including `cuda/std/cassert` instead. * Which shouldn't be an issue...
Co-authored-by: Michael Schellenberger Costa <[email protected]>
Co-authored-by: Michael Schellenberger Costa <[email protected]>
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 mean its not pretty, but in that context nothing is.
Great work on improving our test coverage 🎉
Description
Closes #465
This PR allows us to test NVRTC just like any other compiler. It provides compile time feedback and enables negative compilation tests. e.g. compile.pass, .fail, or possibly even weird XFAIL cases.
TODO:
Checklist