delete all mention of half2

This commit is contained in:
Hieu Hoang 2017-12-07 01:00:08 +00:00
parent 55ac6ae8fb
commit 60d4266822
2 changed files with 4 additions and 22 deletions

View File

@ -216,17 +216,18 @@ __global__ void gBroadcast(Functor functor,
uint batchIdx = batchMappingWrap[ beamIdx ];
//outWrap[id] = functor(in1Wrap[(batchIdx * srcSize + srcId) * cols + stateIdx],
// in2Wrap[beamIdx * cols + stateIdx]);
outWrap[id] = functor(in1Wrap[(batchIdx * srcSize + srcId) * cols + stateIdx],
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));
/*
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);
*/
}
}

View File

@ -20,19 +20,6 @@ inline half htanh(const half x)
return ret;
}
__device__
inline half2 htanh(const half2 x)
{
half2 one = __float2half2_rn(1.0f);
half2 t1 = h2exp(__hmul2(__float2half2_rn(2.0f), x));
half2 t2 = __hsub2(one, t1);
half2 t3 = __hadd2(one, t1);
t3 = h2rcp(t3);
half2 ret = __hmul2(t1, t3);
return ret;
}
namespace thrust
{
namespace detail
@ -75,12 +62,6 @@ namespace thrust
T operator()(const T &x, const T &y) const { return x + y; }
};
template<>
struct half_binary_add<half2> : public thrust::binary_function<half2,half2,half2> {
__device__
half2 operator()(const half2 &x, const half2 &y) const { return __hadd2(x, y); }
};
template<typename Eval1, typename Eval2>
__host__ __device__
actor<composite<binary_operator<half_binary_add>, actor<Eval1>, actor<Eval2>>>