forked from Celebrandil/CudaSift
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcudaImage.h
More file actions
36 lines (31 loc) · 948 Bytes
/
Copy pathcudaImage.h
File metadata and controls
36 lines (31 loc) · 948 Bytes
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
35
36
//********************************************************//
// CUDA SIFT extractor by Marten Bjorkman aka Celebrandil //
//********************************************************//
#ifndef CUDAIMAGE_H
#define CUDAIMAGE_H
#include <cuda_runtime.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);
void Download(cudaStream_t stream);
void Readback(cudaStream_t stream);
void InitTexture();
void CopyToTexture(CudaImage &dst, bool host, cudaStream_t stream);
};
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