Commit 27302c36 authored by Vladislav Vinogradov's avatar Vladislav Vinogradov

fix GPU WARP border mode in CUDA 7.0 and Maxwell architecture

parent d948b2a2
...@@ -626,12 +626,12 @@ namespace cv { namespace gpu { namespace device ...@@ -626,12 +626,12 @@ namespace cv { namespace gpu { namespace device
__device__ __forceinline__ int idx_row_low(int y) const __device__ __forceinline__ int idx_row_low(int y) const
{ {
return (y >= 0) * y + (y < 0) * (y - ((y - height + 1) / height) * height); return (y >= 0) ? y : (y - ((y - height + 1) / height) * height);
} }
__device__ __forceinline__ int idx_row_high(int y) const __device__ __forceinline__ int idx_row_high(int y) const
{ {
return (y < height) * y + (y >= height) * (y % height); return (y < height) ? y : (y % height);
} }
__device__ __forceinline__ int idx_row(int y) const __device__ __forceinline__ int idx_row(int y) const
...@@ -641,12 +641,12 @@ namespace cv { namespace gpu { namespace device ...@@ -641,12 +641,12 @@ namespace cv { namespace gpu { namespace device
__device__ __forceinline__ int idx_col_low(int x) const __device__ __forceinline__ int idx_col_low(int x) const
{ {
return (x >= 0) * x + (x < 0) * (x - ((x - width + 1) / width) * width); return (x >= 0) ? x : (x - ((x - width + 1) / width) * width);
} }
__device__ __forceinline__ int idx_col_high(int x) const __device__ __forceinline__ int idx_col_high(int x) const
{ {
return (x < width) * x + (x >= width) * (x % width); return (x < width) ? x : (x % width);
} }
__device__ __forceinline__ int idx_col(int x) const __device__ __forceinline__ int idx_col(int x) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment