From 60d4266822ca228199bc3027fc82589c83a384a6 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Thu, 7 Dec 2017 01:00:08 +0000 Subject: delete all mention of half2 --- src/amun/half/mblas/matrix_functions.h | 7 ++++--- src/amun/half/mblas/thrust_functions.h | 19 ------------------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/amun/half/mblas/matrix_functions.h b/src/amun/half/mblas/matrix_functions.h index 8a7a3037..fdf92ccb 100644 --- a/src/amun/half/mblas/matrix_functions.h +++ b/src/amun/half/mblas/matrix_functions.h @@ -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); - + */ } } diff --git a/src/amun/half/mblas/thrust_functions.h b/src/amun/half/mblas/thrust_functions.h index 3373b1e5..ba36f662 100644 --- a/src/amun/half/mblas/thrust_functions.h +++ b/src/amun/half/mblas/thrust_functions.h @@ -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 : public thrust::binary_function { - __device__ - half2 operator()(const half2 &x, const half2 &y) const { return __hadd2(x, y); } - }; - template __host__ __device__ actor, actor, actor>> -- cgit v1.2.3