Commit d3577ab3 authored by guangzlu's avatar guangzlu
Browse files

fixed incr() in philox_rand.hpp

parent 1a634aca
......@@ -97,25 +97,28 @@ class philox
{
uint4 res;
uint4 tmp;
// res.x = ctr.x + 1;
asm volatile("v_mov_b32 %8 1; \n"
"v_mov_b32 %9 0; \n"
"v_mov_b32 %10 0; \n"
"v_mov_b32 %11 0; \n"
"v_add_co_u32 %0, %4, %8; "
"v_addc_co_u32 %1, %5, %9; "
"v_addc_co_u32 %2, %6, %10; "
"v_addc_u32 %3, %7, %11; "
: "=v"(res.x), "=v"(res.y), "=v"(res.z), "=v"(res.w)
: "v"(ctr.x),
"v"(ctr.y),
"v"(ctr.z),
"v"(ctr.w),
"v"(tmp.x),
"v"(tmp.y),
"v"(tmp.z),
"v"(tmp.w));
// uint4 tmp;
// asm volatile("v_mov_b32 %8 1; \n"
// "v_mov_b32 %9 0; \n"
// "v_mov_b32 %10 0; \n"
// "v_mov_b32 %11 0; \n"
// "v_add_co_u32 %0, %4, %8; "
// "v_addc_co_u32 %1, %5, %9; "
// "v_addc_co_u32 %2, %6, %10; "
// "v_addc_u32 %3, %7, %11; "
// : "=v"(res.x), "=v"(res.y), "=v"(res.z), "=v"(res.w)
// : "v"(ctr.x),
// "v"(ctr.y),
// "v"(ctr.z),
// "v"(ctr.w),
// "v"(tmp.x),
// "v"(tmp.y),
// "v"(tmp.z),
// "v"(tmp.w));
res.x = ctr.x + 1;
res.y = ctr.y;
res.z = ctr.z;
res.w = ctr.w;
return res;
}
......
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