QUDA  0.9.0
thrust_helper.cuh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <malloc_quda.h>
4 
5 #undef device_malloc
6 #undef device_free
7 
8 #include <thrust/system/cuda/vector.h>
9 #include <thrust/system/cuda/execution_policy.h>
10 #include <thrust/transform_reduce.h>
11 #include <thrust/device_ptr.h>
12 #include <thrust/device_vector.h>
13 #include <thrust/sort.h>
14 
15 #define device_malloc(size) quda::device_malloc_(__func__, quda::file_name(__FILE__), __LINE__, size)
16 #define device_free(ptr) quda::device_free_(__func__, quda::file_name(__FILE__), __LINE__, ptr)
17 
23 {
24 public:
25  // just allocate bytes
26  typedef char value_type;
27 
30 
31  char *allocate(std::ptrdiff_t num_bytes) { return reinterpret_cast<char*>(pool_device_malloc(num_bytes)); }
32  void deallocate(char *ptr, size_t n) { pool_device_free(ptr); }
33 
34 };
void deallocate(char *ptr, size_t n)
long int ptrdiff_t
#define pool_device_malloc(size)
Definition: malloc_quda.h:113
const void * ptr
char * allocate(std::ptrdiff_t num_bytes)
#define pool_device_free(ptr)
Definition: malloc_quda.h:114