Skip to content

Commit

Permalink
Fix bug for older CUDA compilers.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzbontar committed Jan 15, 2016
1 parent 834f9a8 commit 0cc2f6e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion adcensus.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ struct Margin2_functor {
__device__ float backward(float pos, float neg, int which) {
float f = neg - pos + margin;
if (which == 0) {
return -1 * (f > 0);
return -1. * (f > 0);
} else {
return f > 0;
}
Expand Down Expand Up @@ -2052,6 +2052,12 @@ int grey2jet(lua_State *L)
return 0;
}

int version(lua_State* L)
{
printf("libadcensus version 0.0.5\n");
return 0;
}

static const struct luaL_Reg funcs[] = {
{"ad", ad},
{"census", census},
Expand Down Expand Up @@ -2084,6 +2090,8 @@ static const struct luaL_Reg funcs[] = {
{"writePFM", writePFM},
{"grey2jet", grey2jet},
{"spatial_argmin", spatial_argmin},

{"version", version},
{NULL, NULL}
};

Expand Down

0 comments on commit 0cc2f6e

Please sign in to comment.