-
Notifications
You must be signed in to change notification settings - Fork 130
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
adds a program build interface to compile for a specific device #102
Conversation
Should we add a test? |
This complements the existing program build interface to compile for a vector of devices.
ed2737d
to
f1bbd85
Compare
I'm pretty sure the answer to this question is almost always "yes" 😃. I've added a test for the new interface with a single device since it was relatively straightforward. I was looking to add a test for the existing interface that accepts a vector of devices also, but this turned out to be deceptively difficult, so this PR only tests the new interface. The main issue is that we've defined a special Is this functionality useful, or should the build interfaces be handled via the standard cl::Program vectorAddProgram(programStrings);
try {
vectorAddProgram.build("-cl-std=CL2.0");
}
catch (...) {
// Print build info for all devices
cl_int buildErr = CL_SUCCESS;
auto buildInfo = vectorAddProgram.getBuildInfo<CL_PROGRAM_BUILD_LOG>(&buildErr);
for (auto &pair : buildInfo) {
std::cerr << pair.second << std::endl << std::endl;
}
return 1;
} |
This was more of a rhetorical question. Seeing an approved PR adding new functionality without a test, I felt compelled :). I think Now I understand how that is a bit of a pain for testing. Maybe we could have utility testing functions to mirror what |
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.
@bashbaug To be clear: I'm fine with this PR as is. Improving testing for existing functionality needn't be done under this PR.
I think we should merge this PR as-is. I would like to look at a utility testing function that mirrors |
Created #112 so we don't forget to add the utility function. Merging as agreed on the 2020/09/01 teleconference. |
Fixes #60.
This complements the existing program build interface to compile for a vector of devices.