 #include <thrust/host_vector.h>
+#include <thrust/device_vector.h>
 #include <thrust/generate.h>
 #include <thrust/sequence.h>
 #include <thrust/sort.h>

    size_t N = 20;

    // generate three arrays of random values
    thrust::host_vector<int> upper(N);
    thrust::host_vector<int> middle(N);
    thrust::host_vector<int> lower(N);
    thrust::generate(upper.begin(),  upper.end(),  rand10);
    thrust::generate(middle.begin(), middle.end(), rand10);
    thrust::generate(lower.begin(),  lower.end(),  rand10);
    
    std::cout << "Unsorted Keys" << std::endl;
    for(size_t i = 0; i < N; i++)


    // Note: keys have not been modified
    // Note: permutation now maps unsorted keys to sorted order
  
    // permute the key arrays by the final permuation
    apply_permutation(lower,  permutation);
    apply_permutation(middle, permutation);
    apply_permutation(upper,  permutation);

    std::cout << "Sorted Keys" << std::endl;
    for(size_t i = 0; i < N; i++)
    {
        std::cout << "(" << upper[i] << "," << middle[i] << "," << lower[i] << ")" << std::endl;
    }

    return 0;
}

