return val;
}
-static float clamp1(float var, float learningRate, float diff, float minVar)
+inline float clamp1(float var, float learningRate, float diff, float minVar)
{
return fmax(var + learningRate * (diff * diff - var), minVar);
}
return (val.x + val.y + val.z);
}
-static void swap4(__global float4* ptr, int x, int y, int k, int rows, int ptr_step)
+inline void swap4(__global float4* ptr, int x, int y, int k, int rows, int ptr_step)
{
float4 val = ptr[(k * rows + y) * ptr_step + x];
ptr[(k * rows + y) * ptr_step + x] = ptr[((k + 1) * rows + y) * ptr_step + x];
}
-static float4 clamp1(const float4 var, float learningRate, const float4 diff, float minVar)
+inline float4 clamp1(const float4 var, float learningRate, const float4 diff, float minVar)
{
float4 result;
result.x = fmax(var.x + learningRate * (diff.x * diff.x - var.x), minVar);
uchar c_shadowVal;
} con_srtuct_t;
-static void swap(__global float* ptr, int x, int y, int k, int rows, int ptr_step)
+inline void swap(__global float* ptr, int x, int y, int k, int rows, int ptr_step)
{
float val = ptr[(k * rows + y) * ptr_step + x];
ptr[(k * rows + y) * ptr_step + x] = ptr[((k + 1) * rows + y) * ptr_step + x];
//
//M*/
-static float distance_(__global const float * center, __global const float * src, int feature_length)
+inline float distance_(__global const float * center, __global const float * src, int feature_length)
{
float res = 0;
float4 v0, v1, v2;
//
//M*/
-static short2 do_mean_shift(int x0, int y0, __global uchar4* out,int out_step,
+inline short2 do_mean_shift(int x0, int y0, __global uchar4* out,int out_step,
__global uchar4* in, int in_step, int dst_off, int src_off,
int cols, int rows, int sp, int sr, int maxIter, float eps)
{
//-------------------------------------------------------------
// Normalization of histograms via L2Hys_norm
//
-static float reduce_smem(volatile __local float* smem, int size)
+inline float reduce_smem(volatile __local float* smem, int size)
{
unsigned int tid = get_local_id(0);
float sum = smem[tid];
#endif
#ifdef CPU
-static void reduce3(float val1, float val2, float val3, __local float* smem1, __local float* smem2, __local float* smem3, int tid)
+inline void reduce3(float val1, float val2, float val3, __local float* smem1, __local float* smem2, __local float* smem3, int tid)
{
smem1[tid] = val1;
smem2[tid] = val2;
}
}
-static void reduce2(float val1, float val2, volatile __local float* smem1, volatile __local float* smem2, int tid)
+inline void reduce2(float val1, float val2, volatile __local float* smem1, volatile __local float* smem2, int tid)
{
smem1[tid] = val1;
smem2[tid] = val2;
}
}
-static void reduce1(float val1, volatile __local float* smem1, int tid)
+inline void reduce1(float val1, volatile __local float* smem1, int tid)
{
smem1[tid] = val1;
barrier(CLK_LOCAL_MEM_FENCE);
}
}
#else
-static void reduce3(float val1, float val2, float val3,
+inline void reduce3(float val1, float val2, float val3,
__local volatile float* smem1, __local volatile float* smem2, __local volatile float* smem3, int tid)
{
smem1[tid] = val1;
barrier(CLK_LOCAL_MEM_FENCE);
}
-static void reduce2(float val1, float val2, __local volatile float* smem1, __local volatile float* smem2, int tid)
+inline void reduce2(float val1, float val2, __local volatile float* smem1, __local volatile float* smem2, int tid)
{
smem1[tid] = val1;
smem2[tid] = val2;
barrier(CLK_LOCAL_MEM_FENCE);
}
-static void reduce1(float val1, __local volatile float* smem1, int tid)
+inline void reduce1(float val1, __local volatile float* smem1, int tid)
{
smem1[tid] = val1;
barrier(CLK_LOCAL_MEM_FENCE);
// Image read mode
__constant sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_LINEAR;
-static void SetPatch(image2d_t I, float x, float y,
+inline void SetPatch(image2d_t I, float x, float y,
float* Pch, float* Dx, float* Dy,
float* A11, float* A12, float* A22)
{
*errval += fabs(diff);
}
-static void SetPatch4(image2d_t I, const float x, const float y,
+inline void SetPatch4(image2d_t I, const float x, const float y,
float4* Pch, float4* Dx, float4* Dy,
float* A11, float* A12, float* A22)
{
*A22 += sqIdx.x + sqIdx.y + sqIdx.z;
}
-static void GetPatch4(image2d_t J, const float x, const float y,
+inline void GetPatch4(image2d_t J, const float x, const float y,
const float4* Pch, const float4* Dx, const float4* Dy,
float* b1, float* b2)
{
*b2 += xdiff.x + xdiff.y + xdiff.z;
}
-static void GetError4(image2d_t J, const float x, const float y, const float4* Pch, float* errval)
+inline void GetError4(image2d_t J, const float x, const float y, const float4* Pch, float* errval)
{
float4 diff = read_imagef(J, sampler, (float2)(x,y))-*Pch;
*errval += fabs(diff.x) + fabs(diff.y) + fabs(diff.z);
return abs((int)(l.x) - *rs);
}
-static float pix_diff_4(const uchar4 l, __global const uchar *rs)
+inline float pix_diff_4(const uchar4 l, __global const uchar *rs)
{
uchar4 r;
r = *((__global uchar4 *)rs);
///////////////////////////////////////////////////////////////
//////////////////// calc all iterations /////////////////////
///////////////////////////////////////////////////////////////
-static void message(__global T *us_, __global T *ds_, __global T *ls_, __global T *rs_,
+inline void message(__global T *us_, __global T *ds_, __global T *ls_, __global T *rs_,
const __global T *dt,
int u_step, int msg_disp_step, int data_disp_step,
float4 cmax_disc_term, float4 cdisc_single_jump)
}
-static float bicubicCoeff(float x_)
+inline float bicubicCoeff(float x_)
{
float x = fabs(x_);
}
-static float readImage(__global float *image, int x, int y, int rows, int cols, int elemCntPerRow)
+inline float readImage(__global float *image, int x, int y, int rows, int cols, int elemCntPerRow)
{
int i0 = clamp(x, 0, cols - 1);
int j0 = clamp(y, 0, rows - 1);
}
-static float divergence(__global const float* v1, __global const float* v2, int y, int x, int v1_step, int v2_step)
+inline float divergence(__global const float* v1, __global const float* v2, int y, int x, int v1_step, int v2_step)
{
if (x > 0 && y > 0)