Commit 4a41107b authored by Vladislav Vinogradov's avatar Vladislav Vinogradov

applied patch #1734

parent 124ceb96
...@@ -551,10 +551,10 @@ template<int isBlack> __global__ void sor_pass(float *new_du, ...@@ -551,10 +551,10 @@ template<int isBlack> __global__ void sor_pass(float *new_du,
return; return;
const int pos = j * stride + i; const int pos = j * stride + i;
const int pos_r = pos + 1; const int pos_r = i < width - 1 ? pos + 1 : pos;
const int pos_u = pos + stride; const int pos_u = j < height - 1 ? pos + stride : pos;
const int pos_d = pos - stride; const int pos_d = j > 0 ? pos - stride : pos;
const int pos_l = pos - 1; const int pos_l = i > 0 ? pos - 1 : pos;
//load smooth term //load smooth term
float s_up, s_left, s_right, s_down; float s_up, s_left, s_right, s_down;
......
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