Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/clpp11.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,11 @@
class Queue {
public:
// Constructor based on the regular OpenCL data-type: memory management is handled elsewhere
explicit Queue(const cl_command_queue queue) : queue_(new cl_command_queue) { *queue_ = queue; }
explicit Queue(const cl_command_queue queue)
: queue_(new cl_command_queue, [](cl_command_queue* q) { clReleaseCommandQueue(*q); }) {
clRetainCommandQueue(queue);
*queue_ = queue;
}

// Regular constructor with memory management
explicit Queue(const Context& context, const Device& device)
Expand Down Expand Up @@ -636,7 +640,7 @@
// =================================================================================================

// Enumeration of buffer access types
enum class BufferAccess { kReadOnly, kWriteOnly, kReadWrite, kNotOwned };

Check warning on line 643 in src/clpp11.hpp

View workflow job for this annotation

GitHub Actions / lint

src/clpp11.hpp:643:12 [performance-enum-size]

enum 'BufferAccess' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size

// C++11 version of 'cl_mem'
template <typename T>
Expand Down Expand Up @@ -780,7 +784,7 @@
explicit Kernel(const cl_kernel kernel) : kernel_(new cl_kernel) { *kernel_ = kernel; }

// Regular constructor with memory management
explicit Kernel(const std::shared_ptr<Program> program, const std::string& name)

Check warning on line 787 in src/clpp11.hpp

View workflow job for this annotation

GitHub Actions / lint

src/clpp11.hpp:787:50 [performance-unnecessary-value-param]

the const qualified parameter 'program' is copied for each invocation; consider making it a reference
: kernel_(new cl_kernel,
[](cl_kernel* k) {
if (*k) {
Expand Down
Loading