 // this array to be __managed__ so that UVM would take care of copying data
 // back and forth.  In this example, we will just declare this array to reside
 // on the device, and we will explicitly copy the data back and forth.
-__device__ unsigned long long dynamic_instr_counts[SASSI_NUM_OPCODES];
+__managed__ unsigned long long dynamic_instr_counts[SASSI_NUM_OPCODES];
 
 ///////////////////////////////////////////////////////////////////////////////////
 ///

#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include "sassi_intrinsics.h"
#include "sassi_lazyallocator.hpp"
#include <sassi/sassi-core.hpp>

static sassi::lazy_allocator counterInitializer(
  /* Initialize the counters. */
  []() {
    bzero(dynamic_instr_counts, sizeof(dynamic_instr_counts));
  }, sassi_finalize);

