ViennaCL - The Vienna Computing Library  1.7.0
Free open-source GPU-accelerated linear algebra and solver library.
command_queue.hpp
Go to the documentation of this file.
1 #ifndef VIENNACL_OCL_COMMAND_QUEUE_HPP_
2 #define VIENNACL_OCL_COMMAND_QUEUE_HPP_
3 
4 /* =========================================================================
5  Copyright (c) 2010-2015, Institute for Microelectronics,
6  Institute for Analysis and Scientific Computing,
7  TU Wien.
8  Portions of this software are copyright by UChicago Argonne, LLC.
9 
10  -----------------
11  ViennaCL - The Vienna Computing Library
12  -----------------
13 
14  Project Head: Karl Rupp rupp@iue.tuwien.ac.at
15 
16  (A list of authors and contributors can be found in the manual)
17 
18  License: MIT (X11), see file LICENSE in the base directory
19 ============================================================================= */
20 
25 #ifdef __APPLE__
26 #include <OpenCL/cl.h>
27 #else
28 #include <CL/cl.h>
29 #endif
30 
31 #include <vector>
32 #include <string>
33 #include <sstream>
34 #include "viennacl/ocl/device.hpp"
35 #include "viennacl/ocl/handle.hpp"
36 
37 namespace viennacl
38 {
39 namespace ocl
40 {
41 
46 {
47 public:
50 
51  //Copy constructor:
53  {
54  handle_ = other.handle_;
55  }
56 
57  //assignment operator:
59  {
60  handle_ = other.handle_;
61  return *this;
62  }
63 
64  bool operator==(command_queue const & other) const
65  {
66  return handle_ == other.handle_;
67  }
68 
70  void finish() const
71  {
72  clFinish(handle_.get());
73  }
74 
76  void flush() const
77  {
78  clFlush(handle_.get());
79  }
80 
81  viennacl::ocl::handle<cl_command_queue> const & handle() const { return handle_; }
83 
84 private:
85 
87 };
88 
89 } //namespace ocl
90 } //namespace viennacl
91 
92 #endif
command_queue & operator=(command_queue const &other)
Represents an OpenCL device within ViennaCL.
void finish() const
Waits until all kernels in the queue have finished their execution.
viennacl::ocl::handle< cl_command_queue > & handle()
command_queue(command_queue const &other)
A class representing a command queue.
viennacl::ocl::handle< cl_command_queue > const & handle() const
bool operator==(command_queue const &other) const
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
Definition: cpu_ram.hpp:34
const OCL_TYPE & get() const
Definition: handle.hpp:189
Implementation of a smart-pointer-like class for handling OpenCL handles.
void flush() const
Waits until all kernels in the queue have started their execution.
command_queue(viennacl::ocl::handle< cl_command_queue > h)