QUDA  v1.1.0
A library for QCD on GPUs
object.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <malloc_quda.h>
14 
15 namespace quda {
16 
17  class Object {
18 
19 
20  public:
21  inline Object() { }
22  inline virtual ~Object() { }
23 
24  inline static void* operator new(std::size_t size) {
25  return safe_malloc(size);
26  }
27 
28  inline static void operator delete(void* p) {
29  host_free(p);
30  }
31 
32  inline static void* operator new[](std::size_t size) {
33  return safe_malloc(size);
34  }
35 
36  inline static void operator delete[](void* p) {
37  host_free(p);
38  }
39  };
40 
41 } // namespace quda
virtual ~Object()
Definition: object.h:22
#define safe_malloc(size)
Definition: malloc_quda.h:106
#define host_free(ptr)
Definition: malloc_quda.h:115