Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gpusync.h
Go to the documentation of this file.
1 /*
2  This file is part of Mitsuba, a physically based rendering system.
3 
4  Copyright (c) 2007-2014 by Wenzel Jakob and others.
5 
6  Mitsuba is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License Version 3
8  as published by the Free Software Foundation.
9 
10  Mitsuba is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #pragma once
20 #if !defined(__MITSUBA_HW_GPUSYNC_H_)
21 #define __MITSUBA_HW_GPUSYNC_H_
22 
23 #include <mitsuba/hw/renderer.h>
24 
26 
27 /** \brief Abstract GPU synchronization object implementing
28  * a memory fence operation.
29  * \ingroup libhw
30  */
31 class MTS_EXPORT_HW GPUSync : public Object {
32 public:
33  /// Allocate memory for a new synchronization object
34  GPUSync();
35 
36  /// Create the synchronization object on the GPU
37  virtual void init() = 0;
38 
39  /// Wait on the fence (blocking)
40  virtual void wait() = 0;
41 
42  /// Enqueue a wait command, but do not block
43  virtual void enqueueWait() = 0;
44 
45  /// Remove the synchronization object
46  virtual void cleanup() = 0;
47 
48  /// Return a string representation of this class
49  std::string toString() const;
50 
52 protected:
53  /// Virtual destructor
54  virtual ~GPUSync();
55 };
56 
58 
59 #endif /* __MITSUBA_HW_GPUSYNC_H_ */
#define MTS_EXPORT_HW
Definition: platform.h:114
Abstract GPU synchronization object implementing a memory fence operation.
Definition: gpusync.h:31
#define MTS_NAMESPACE_BEGIN
Definition: platform.h:137
#define MTS_DECLARE_CLASS()
This macro must be used in the initial definition in classes that derive from Object.
Definition: class.h:158
Parent of all Mitsuba classes.
Definition: object.h:38
virtual std::string toString() const
Return a human-readable string representation of the object&#39;s contents.
#define MTS_NAMESPACE_END
Definition: platform.h:138