Ticket #13180: test_vector.cpp

File test_vector.cpp, 668 bytes (added by Nicolas Barrier <nicolas.barrier@…>, 5 years ago)

Test code

Line 
1/**
2 * \file OOPE_function.cpp
3 * \brief It contains most of the program's fonctions
4 *
5 */
6
7#include <stdlib.h>
8#include <stdio.h>
9#include <boost/multi_array.hpp>
10#include <time.h>
11
12int main(int argc, char *argv[])
13{
14 int NGROUP = 10000 ;
15 double carr[NGROUP];
16 double *data1;
17 int p;
18 typedef boost::multi_array<double, 1> array_type;
19 time_t start, end, total;
20
21 array_type boar(boost::extents[NGROUP]);
22 data1 = boar.data();
23
24 for (p=0; p<NGROUP; p++)
25 {
26 carr[p] = 1.;
27 }
28
29 for (p=0; p<NGROUP; p++)
30 {
31 boar[p] = 1.;
32 }
33
34#pragma ivdep
35 for (p=0; p<NGROUP; p++)
36 {
37 *(data1 + p) = 1.;
38 }
39}