split out args for functor. Get ready for half2

This commit is contained in:
Hieu Hoang 2017-12-06 18:13:37 +00:00
parent f1334cace0
commit 55ac6ae8fb

View File

@ -220,8 +220,13 @@ __global__ void gBroadcast(Functor functor,
// in2Wrap[beamIdx * cols + stateIdx]);
//outWrap[id] = functor(in1Wrap(indices[0], indices[1], 0, batchIdx),
// in2Wrap(indices[2], indices[1], 0, 0));
outWrap(srcId, stateIdx, beamIdx, 0) = functor(in1Wrap(srcId, stateIdx, 0, batchIdx),
in2Wrap(beamIdx, stateIdx, 0, 0));
//outWrap(srcId, stateIdx, beamIdx, 0) = functor(in1Wrap(srcId, stateIdx, 0, batchIdx),
// in2Wrap(beamIdx, stateIdx, 0, 0));
const half *in1 = &in1Wrap(srcId, stateIdx, 0, batchIdx);
const half *in2 = &in2Wrap(beamIdx, stateIdx, 0, 0);
half *out = &outWrap(srcId, stateIdx, beamIdx, 0);
*out = functor(*in1, *in2);
}
}