Skip to content

Commit

Permalink
fix OpenCL on mac thank to mevikas (https://code.google.com/p/tessera…
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop committed Jun 29, 2015
1 parent 935e724 commit d00d833
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions opencl/openclwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2985,6 +2985,8 @@ double composeRGBPixelMicroBench( GPUEnv *env, TessScoreEvaluationInputData inpu
#if ON_WINDOWS
LARGE_INTEGER freq, time_funct_start, time_funct_end;
QueryPerformanceFrequency(&freq);
#elif ON_APPLE
mach_timespec_t time_funct_start, time_funct_end;
#else
TIMESPEC time_funct_start, time_funct_end;
#endif
Expand Down Expand Up @@ -3057,6 +3059,8 @@ double histogramRectMicroBench( GPUEnv *env, TessScoreEvaluationInputData input,
#if ON_WINDOWS
LARGE_INTEGER freq, time_funct_start, time_funct_end;
QueryPerformanceFrequency(&freq);
#elif ON_APPLE
mach_timespec_t time_funct_start, time_funct_end;
#else
TIMESPEC time_funct_start, time_funct_end;
#endif
Expand Down Expand Up @@ -3160,6 +3164,8 @@ double thresholdRectToPixMicroBench( GPUEnv *env, TessScoreEvaluationInputData i
#if ON_WINDOWS
LARGE_INTEGER freq, time_funct_start, time_funct_end;
QueryPerformanceFrequency(&freq);
#elif ON_APPLE
mach_timespec_t time_funct_start, time_funct_end;
#else
TIMESPEC time_funct_start, time_funct_end;
#endif
Expand Down Expand Up @@ -3234,6 +3240,8 @@ double getLineMasksMorphMicroBench( GPUEnv *env, TessScoreEvaluationInputData in
#if ON_WINDOWS
LARGE_INTEGER freq, time_funct_start, time_funct_end;
QueryPerformanceFrequency(&freq);
#elif ON_APPLE
mach_timespec_t time_funct_start, time_funct_end;
#else
TIMESPEC time_funct_start, time_funct_end;
#endif
Expand Down
8 changes: 8 additions & 0 deletions opencl/openclwrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@
#define PERF_COUNT_VERBOSE 1
#define PERF_COUNT_REPORT_STR "[%36s], %24s, %11.6f\n"

#if ON_APPLE
#include <time.h>
#include <mach/clock.h>
#include <mach/mach.h>
#define CLOCK_MONOTONIC SYSTEM_CLOCK
#define clock_gettime clock_get_time
#endif


#if ON_WINDOWS

Expand Down

0 comments on commit d00d833

Please sign in to comment.