File: example.c

package info (click to toggle)
eztrace 2.0%2Brepack-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,132 kB
  • sloc: ansic: 23,501; perl: 910; sh: 857; cpp: 771; makefile: 696; fortran: 327; f90: 320; python: 57
file content (28 lines) | stat: -rw-r--r-- 565 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* -*- c-file-style: "GNU" -*- */
/*
 * Copyright (C) CNRS, INRIA, Université Bordeaux 1, Télécom SudParis
 * See COPYING in top-level directory.
 */

#include <sys/time.h>
#include <stdlib.h>
#include <stdio.h>
#include "example.h"

int lib_function(double *t, int size, int n) {
  int res = n;
  int i;
  for(i=0; i<NITER_COMPUTE; i++) {
    res +=(int) t[(i*n)%size];
  }
  return res;
}

int lib_instrumented_function(double *t, int size, int n) {
  int res = n;
  int i;
  for(i=0; i<NITER_COMPUTE; i++) {
    res +=(int) t[(i*n)%size];
  }
  return res;
}