Cypress CSC-1200T Guía de usuario Pagina 106

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 124
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 105
106 Cray T3E User’s Guide
...computation...
after = cpused();
utime = after - before;
printf("CPU time in user space = %ld clock ticks\n",
utime);
10.1.4 Example of timing
Here is an example of a C program, which computes the matrix product
using the SGEMM routine from Libsci:
#include <stdio.h>
#include <fortran.h>
#include <time.h>
#include <unistd.h>
#define DGEMM SGEMM
#define l 450
#define m 500
#define n 550
main()
{
double a[n][l], b[l][m], c[n][m], ct[m][n];
int ll, mm, nn, i, j, k;
double alpha = 1.0;
double beta = 0.0;
void DGEMM();
char *transposed = "t";
_fcd ftran;
time_t before, after, utime;
/* Initialize */
for(i=0;i<n;i++)
for(j=0;j<l;j++)
a[i][j] = i-j+2;
for(i=0;i<l;i++)
for(j=0;j<m;j++)
b[i][j] = 1/(double)(i+2*j+2);
ftran = _cptofcd(transposed, strlen(transposed));
ll=l;mm=m;nn=n;
before = cpused();
DGEMM(ftran, ftran, &nn, &mm, &ll, &alpha, a, &ll,
b, &mm, &beta, ct, &nn);
Vista de pagina 105
1 2 ... 101 102 103 104 105 106 107 108 109 110 111 ... 123 124

Comentarios a estos manuales

Sin comentarios