Conversation
|
@jansol, mind taking a look? |
jansol
left a comment
There was a problem hiding this comment.
Looks good, thanks!
For consistency the various calls to clCreateImageWithProperties and clCreateBufferWithProperties could be switched to using the ternary operator instead of two separate calls in an if-else clause, but functionally they are fine as is.
| vector<cl_device_id> deviceIDs; | ||
| for(const Device& device: devices) { | ||
| deviceIDs.push_back(device()); | ||
| } |
There was a problem hiding this comment.
Isn't the idea that the in-memory representation of the wrapper class objects is == the underlying handles? From a quick look my understanding is that this should be the case for Device too.
There was a problem hiding this comment.
That's the general idea, yes, but device objects are an exception since they have an extra variable:
template <>
class Wrapper<cl_device_id>
{
public:
typedef cl_device_id cl_type;
protected:
cl_type object_;
bool referenceCountable_;
...There might be a better way to do this, but I think it's outside of the scope of this PR...
There was a problem hiding this comment.
Ah, I missed that 2nd field. Yea that's a whole separate topic then.
May as well fix this while we're at it. Done! |
fixes #338 by explicitly passing
nullptrwhen a vector is empty.There were a lot of these... I think I got them all.
I added a bunch of unit tests when related tests existed, but there are still some unit testing gaps. We're no worse off than we were previously, though.