forked from Celebrandil/CudaSift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cudaImage.h
34 lines (30 loc) · 870 Bytes
/
cudaImage.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
32
33
34
//********************************************************//
// CUDA SIFT extractor by Marten Bjorkman aka Celebrandil //
//********************************************************//
#ifndef CUDAIMAGE_H
#define CUDAIMAGE_H
class CudaImage {
public:
int width, height;
int pitch;
float *h_data;
float *d_data;
float *t_data;
bool d_internalAlloc;
bool h_internalAlloc;
public:
CudaImage();
~CudaImage();
void Allocate(int width, int height, int pitch, bool withHost, float *devMem = NULL, float *hostMem = NULL);
double Download();
double Readback();
double InitTexture();
double CopyToTexture(CudaImage &dst, bool host);
};
int iDivUp(int a, int b);
int iDivDown(int a, int b);
int iAlignUp(int a, int b);
int iAlignDown(int a, int b);
void StartTimer(unsigned int *hTimer);
double StopTimer(unsigned int hTimer);
#endif // CUDAIMAGE_H