Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compile error in OpenCL shader #513

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions kinect2_registration/src/depth_registration.cl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void kernel checkDepth(global const int4 *idx, global const ushort *zImg, global

const int4 index = idx[i];
const ushort zI = zImg[i];
const ushort thres = 0.01 * zI;
const ushort thres = 0.01f * zI;
const ushort zIThres = zI + thres;
const float4 dist2 = dists[i];

Expand Down Expand Up @@ -176,7 +176,7 @@ void kernel remapDepth(global const ushort *in, global ushort *out, global const
}

const float avg = (p.s0 + p.s1 + p.s2 + p.s3) / count;
const float thres = 0.01 * avg;
const float thres = 0.01f * avg;
valid = isless(fabs(p - avg), (float4)(thres));
count = abs(valid.s0 + valid.s1 + valid.s2 + valid.s3);

Expand All @@ -187,7 +187,7 @@ void kernel remapDepth(global const ushort *in, global ushort *out, global const
}

const float4 distXY = (float4)((x - xL) * (x - xL), (xH - x) * (xH - x), (y - yL) * (y - yL), (yH - y) * (yH - y));
const float4 tmp = (float4)(sqrt(2.0));
const float4 tmp = (float4)(sqrt(2.0f));
const float4 dist2 = (float4)(distXY.s0 + distXY.s2, distXY.s1 + distXY.s2, distXY.s0 + distXY.s3, distXY.s1 + distXY.s3);
const float4 dist = select((float4)(0), tmp - sqrt(dist2), valid);
const float sum = dist.s0 + dist.s1 + dist.s2 + dist.s3;
Expand Down