-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathhelpers.h
executable file
·33 lines (27 loc) · 991 Bytes
/
helpers.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
#ifndef __HELPERS_H__
#define __HELPERS_H__
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include "cuda.h"
#include "cuda_runtime.h"
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
#define CHECK_CUDART(x) do { \
cudaError_t res = (x); \
if(res != cudaSuccess) { \
fprintf(stderr, "CUDART: %s = %d (%s) at (%s:%d)\n", #x, res, cudaGetErrorString(res),__FILE__,__LINE__); \
exit(1); \
} \
} while(0)
double read_timer();
cv::Mat getRawImage(string in_filename);
void outputProcessedImage(unsigned int* processedImg, int width, int height, string out_filename);
void outputProcessedImageFloat(float* processedImg, int width, int height, string out_filename);
void outputProcessedImageUchar(uchar* processedImg, int width, int height, string out_filename);
float* getDummyImg(int height, int width);
uchar* getDummyImgUchar(int height, int width);
float getResponseTime(cudaEvent_t start, cudaEvent_t stop);
#endif