Skip to content

Commit

Permalink
Merge pull request #4 from vmx/command-queue-clone
Browse files Browse the repository at this point in the history
Implement Clone for CommandQueue
  • Loading branch information
kenba authored Mar 6, 2021
2 parents ab0b02e + c9181f5 commit c321a7b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/command_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ pub struct CommandQueue {
max_work_item_dimensions: cl_uint,
}

impl Clone for CommandQueue {
fn clone(&self) -> CommandQueue {
retain_command_queue(self.queue).unwrap();
CommandQueue::new(self.queue, self.max_work_item_dimensions)
}
}

impl Drop for CommandQueue {
fn drop(&mut self) {
release_command_queue(self.queue).unwrap();
Expand Down

0 comments on commit c321a7b

Please sign in to comment.