 cached_allocator g_allocator;
 
 
-// create a tag derived from device_system_tag for distinguishing
+// create a tag derived from system::cuda::tag for distinguishing
 // our overloads of get_temporary_buffer and return_temporary_buffer
-struct my_tag : thrust::device_system_tag {};
+struct my_tag : thrust::system::cuda::tag {};
 
 
 // overload get_temporary_buffer on my_tag

    else
    {
      // no allocation of the right size exists
      // create a new one with device_malloc
      // throw if device_malloc can't satisfy the request
      try
      {
        std::cout << "cached_allocator::allocator(): no free block found; calling device_malloc" << std::endl;

        result = thrust::device_malloc(num_bytes).get();
      }
      catch(std::runtime_error &e)
      {

#include <thrust/system/cuda/vector.h>
#include <thrust/host_vector.h>
#include <thrust/generate.h>
#include <thrust/sort.h>
#include <thrust/pair.h>
