magistraleinformaticanetworking:spm:spm1213_c_skepu_containers
- 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/spm1213_c_skepu_containers.txt · Ultima modifica: 24/04/2013 alle 06:25 (12 anni fa) da Marco Danelutto