forked from gpu-fftw/gpu_fftw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gpu_fftw.h
31 lines (27 loc) · 983 Bytes
/
gpu_fftw.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#define _GNU_SOURCE /*for RTLD_NEXT see dlopen(3) */
#include <dlfcn.h>
#include <stdbool.h>
#include "hello_fft/gpu_fft.h"
#define MPLAN_ARRSIZE 1024
#define SO_EXPORT __attribute__ ((visibility ("default")))
#define SO_LOCAL __attribute__ ((visibility ("hidden")))
#define YES 0
#define NO 1
#define QUERY 2
#define FINGERPRINT { 0x00,0xFF,'M','e','t','p',0xFF,0x00}
#define FINGERPRINTSZ 8
/* see http://stackoverflow.com/questions/600293/how-to-check-if-a-number-is-a-power-of-2 */
#define IS_2_PWR(x) (((x) & (x-1)) == 0)
struct GPU_FFTW_PLAN { // Opaque to the user, don't use internals
unsigned char fprint[8];
void* plan;
void* out;
int n;
bool gpu;
int* count_ptr;
};
extern SO_LOCAL void say( const int errlvl, const char *fmt, ...);
extern SO_LOCAL void* orig_func(const char* oname,const void* curr_fun);
extern SO_LOCAL unsigned int log2u(unsigned int i);
extern SO_LOCAL void gpu_active(bool yesno);
extern SO_LOCAL bool fingerprint_ok(void *p);