Commit a2f6d435 authored by Ondrej Mosnáček's avatar Ondrej Mosnáček

[CUDA,OpenCL] Use simpler mask computation

parent ad077338
Pipeline #12400347 passed with stages
in 20 minutes and 38 seconds
......@@ -97,7 +97,7 @@ struct block_th {
ulong cmpeq_mask(uint test, uint ref)
{
uint x = (int)(((uint)1 << (31 - test)) << ref) >> 31;
uint x = -(uint)(test == ref);
return u64_build(x, x);
}
......
......@@ -77,7 +77,7 @@ struct block_th {
__device__ uint64_t cmpeq_mask(uint32_t test, uint32_t ref)
{
uint32_t x = (int32_t)((UINT32_C(1) << (31 - test)) << ref) >> 31;
uint32_t x = -(uint32_t)(test == ref);
return u64_build(x, x);
}
......
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