example/cuda/template_cpu.cpp
////////////////////////////////////////////////////////////////////////////////
//! Compute reference data set
//! Each element is multiplied with the number of threads / array length
//! @param reference  reference data, computed but preallocated
//! @param idata      input data as provided to device
//! @param len        number of elements in reference / idata
////////////////////////////////////////////////////////////////////////////////

Compute reference data set
Each element is multiplied with the number of threads / array length
Compute reference data set Each element is multiplied with the number of threads / array length
void
computeGold(float *reference, float *idata, const unsigned int len)
{
    const float f_len = static_cast<float>(len);
    for (unsigned int i = 0; i < len; ++i)
    {
        reference[i] = idata[i] * f_len;
    }
}
void computeGold ( float * reference , float * idata , const unsigned int len ) { const float f_len = static_cast < float > ( len ) ; for ( unsigned int i = 0 ; i < len ; ++ i ) { reference [ i ] = idata [ i ] * f_len ; } }
Compute reference data set
Each element is multiplied with the number of threads / array length
Compute reference data set Each element is multiplied with the number of threads / array length