 
 #include <cusp/detail/device/spmv.h>
 #include "timer.h"
+
+const size_t N = 160 * 1000; // for alignment
+const size_t num_iterations = 100;
+const size_t max_diagonals  = 32;
+
 
 
 template <bool UseCache, unsigned int THREADS_PER_VECTOR, typename IndexType, typename ValueType>


int main(int argc, char** argv)
{
    benchmark_csr_vector<int, float,  2>();
    benchmark_csr_vector<int, float,  4>();
    benchmark_csr_vector<int, float,  8>();

}
 
template <typename IndexType, typename ValueType, unsigned int ThreadsPerVector>
void benchmark_csr_vector()
{
    printf("%4d,", (int) ThreadsPerVector);


    cusp::vector<ValueType, cusp::device> x(N);
    cusp::vector<ValueType, cusp::device> y(N);

    for(IndexType D = 1; D <= max_diagonals; D++)
    {
        // create banded matrix with D diagonals
        const IndexType NNZ = N * D - (D * (D - 1)) / 2;
        cusp::dia_matrix<IndexType, ValueType, cusp::host> dia(N, N, NNZ, D, N);
        thrust::sequence(dia.diagonal_offsets.begin(), dia.diagonal_offsets.end());
        thrust::fill(dia.values.begin(), dia.values.end(), 1);

        // convert to CSR
