Strumenti Utente

Strumenti Sito


magistraleinformaticanetworking:spm:skepu-container

SKEPU container sample code

skepu_containers.cpp
#include <iostream>
 
#define SKEPU_OMP
 
#include "skepu/vector.h"
#include "skepu/matrix.h"
 
#define N 16
#define M 16
 
using namespace std;
 
int main()
{	
 
  skepu::Vector<float> v(N,0.0);
  skepu::Matrix<float> m(N,M,0.0);
 
  cout << "Initialized matrix and vector" << endl;
 
  for(int i=0; i<N;i++) {
    cout << "v[" << i << "]=" << v[i] << endl;
  }
 
 
  for(int i=0; i<N;i++) { for(int j=0; i<N;i++) {
    cout << "m[" << i << "," << j << "]=" << m(i,j) << endl; } }
 
  cout << "map +5 on matrix m" << endl;
  m += 5;
  for(int i=0; i<N;i++) { for(int j=0; i<N;i++) {
    cout << "m[" << i << "," << j << "]=" << m(i,j) << endl; } }
 
  return 0;
}
magistraleinformaticanetworking/spm/skepu-container.txt · Ultima modifica: 28/10/2013 alle 17:29 (11 anni fa) da Marco Danelutto

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki