diff --git a/examples/sssp/sssp_cpu.hxx b/examples/sssp/sssp_cpu.hxx index bca42ee6..1d5d419a 100644 --- a/examples/sssp/sssp_cpu.hxx +++ b/examples/sssp/sssp_cpu.hxx @@ -22,9 +22,14 @@ float run(csr_t& csr, vertex_t& single_source, weight_t* distances, vertex_t* predecessors) { - thrust::host_vector row_offsets(csr.row_offsets); // Copy data to CPU - thrust::host_vector column_indices(csr.column_indices); - thrust::host_vector nonzero_values(csr.nonzero_values); + + thrust::host_vector _row_offsets(csr.row_offsets); // Copy data to CPU + thrust::host_vector _column_indices(csr.column_indices); + thrust::host_vector _nonzero_values(csr.nonzero_values); + + edge_t* row_offsets = _row_offsets.data(); + vertex_t* column_indices = _column_indices.data(); + weight_t* nonzero_values = _nonzero_values.data(); for (vertex_t i = 0; i < csr.number_of_rows; i++) distances[i] = std::numeric_limits::max(); @@ -78,4 +83,4 @@ int compute_error(thrust::device_vector _gpu_result, return n_errors; } -} // namespace sssp_cpu \ No newline at end of file +} // namespace sssp_cpu