OSDN Git Service

new file: Integration/Tomography/Makefile.recent
[eos/hostdependX86LINUX64.git] / hostdepend / X86MAC64 / util / X86MAC64 / cuda / samples / 0_Simple / template / template_cpu.cpp
1 /*\r
2  * Copyright 1993-2013 NVIDIA Corporation.  All rights reserved.\r
3  *\r
4  * Please refer to the NVIDIA end user license agreement (EULA) associated\r
5  * with this source code for terms and conditions that govern your use of\r
6  * this software. Any use, reproduction, disclosure, or distribution of\r
7  * this software and related documentation outside the terms of the EULA\r
8  * is strictly prohibited.\r
9  *\r
10  */\r
11 \r
12 ////////////////////////////////////////////////////////////////////////////////\r
13 // export C interface\r
14 extern "C"\r
15 void computeGold(float *reference, float *idata, const unsigned int len);\r
16 \r
17 ////////////////////////////////////////////////////////////////////////////////\r
18 //! Compute reference data set\r
19 //! Each element is multiplied with the number of threads / array length\r
20 //! @param reference  reference data, computed but preallocated\r
21 //! @param idata      input data as provided to device\r
22 //! @param len        number of elements in reference / idata\r
23 ////////////////////////////////////////////////////////////////////////////////\r
24 void\r
25 computeGold(float *reference, float *idata, const unsigned int len)\r
26 {\r
27     const float f_len = static_cast<float>(len);\r
28 \r
29     for (unsigned int i = 0; i < len; ++i)\r
30     {\r
31         reference[i] = idata[i] * f_len;\r
32     }\r
33 }\r
34 \r