1#include "CalculateNorm.h"
5 IMPLEMENT_TCLASS(CalculateNorm, TDataType)
7 template <typename Real, typename Coord>
8 __global__ void CN_CalculateNorm(
12 int tId = threadIdx.x + (blockIdx.x * blockDim.x);
13 if (tId >= vec.size()) return;
15 norm[tId] = vec[tId].norm();
18 template<typename TDataType>
19 void CalculateNorm<TDataType>::compute()
21 auto& inData = this->inVec()->getData();
23 int num = inData.size();
25 if (this->outNorm()->isEmpty())
27 this->outNorm()->allocate();
30 auto& outData = this->outNorm()->getData();
31 if (outData.size() != num)
42 DEFINE_CLASS(CalculateNorm);