Just inline the one stage into the other one?
EDIT: wait your if statements require variables which are not defined (blockIdx.x andThreadIdx.x)
Just inline the one stage into the other one?
EDIT: wait your if statements require variables which are not defined (blockIdx.x andThreadIdx.x)