 
     // Allocate device output array
     OutputT *d_out = NULL;
-    CubDebugExit(g_allocator.DeviceAllocate((void**)&d_out, sizeof(OutputT) * num_items));
+    AllocateOutput<OutputT, DeviceInputIteratorT, inplace>::run(d_out, d_in, num_items);
 
     // Allocate CDP device arrays
     size_t          *d_temp_storage_bytes = NULL;

    AssertEquals(0, compare);
}


/**
 * Test DeviceScan on pointer type

    }
}

template<typename OutputT, typename DeviceInputIteratorT, bool inplace>
struct AllocateOutput {
    static void run(OutputT *&d_out, DeviceInputIteratorT, int num_items) {
        CubDebugExit(g_allocator.DeviceAllocate((void**)&d_out, sizeof(OutputT) * num_items));
    }
};

template<typename OutputT>
struct AllocateOutput<OutputT, OutputT *, true> {
    static void run(OutputT *&d_out, OutputT *d_in, int num_items) {
        d_out = d_in;
    }
};

/**
 * Test DeviceScan for a given problem input
