diff --git a/CMakeLists.txt b/CMakeLists.txt index 368acf29..582a4466 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,7 +73,7 @@ set_target_properties(essentials CUDA_EXTENSIONS OFF CUDA_RESOLVE_DEVICE_SYMBOLS ON CUDA_SEPARABLE_COMPILATION ON - CUDA_ARCHITECTURES 61 # Set required architecture. + CUDA_ARCHITECTURES 75 # Set required architecture. # CUDA_PTX_COMPILATION ON # Can only be applied to OBJ. ) diff --git a/cmake/FetchCUB.cmake b/cmake/FetchCUB.cmake index 4ac5e1dd..a70a25e9 100644 --- a/cmake/FetchCUB.cmake +++ b/cmake/FetchCUB.cmake @@ -9,7 +9,7 @@ set(FETCHCONTENT_BASE_DIR ${FC_BASE}) FetchContent_Declare( cub GIT_REPOSITORY https://github.com/NVIDIA/cub.git - GIT_TAG 1.15.0 + GIT_TAG 1.17.0 ) FetchContent_GetProperties(cub) diff --git a/cmake/FetchThrustCUB.cmake b/cmake/FetchThrustCUB.cmake index 01aa5162..eb23b488 100644 --- a/cmake/FetchThrustCUB.cmake +++ b/cmake/FetchThrustCUB.cmake @@ -9,7 +9,7 @@ set(FETCHCONTENT_BASE_DIR ${FC_BASE}) FetchContent_Declare( thrust GIT_REPOSITORY https://github.com/thrust/thrust.git - GIT_TAG 1.16.0 + GIT_TAG 1.17.0 ) FetchContent_GetProperties(thrust) diff --git a/examples/algorithms/color/color.cu b/examples/algorithms/color/color.cu index 0e076e5e..dd5c953e 100644 --- a/examples/algorithms/color/color.cu +++ b/examples/algorithms/color/color.cu @@ -59,12 +59,16 @@ void test_color(int num_arguments, char** argument_array) { thrust::host_vector h_colors(n_vertices); - float cpu_elapsed = - color_cpu::run(csr, h_colors.data()); + float cpu_elapsed = + color_cpu::run(csr, h_colors.data()); int n_errors = color_cpu::compute_error( csr, colors, h_colors); + std::vector stl_colors(n_vertices); + thrust::copy(colors.begin(), colors.end(), stl_colors.begin()); + int n_colors = std::set(stl_colors.begin(), stl_colors.end()).size(); + // -- // Log print::head(colors, 40, "GPU colors"); @@ -72,6 +76,7 @@ void test_color(int num_arguments, char** argument_array) { std::cout << "GPU Elapsed Time : " << gpu_elapsed << " (ms)" << std::endl; std::cout << "CPU Elapsed Time : " << cpu_elapsed << " (ms)" << std::endl; + std::cout << "Number of colors : " << n_colors << std::endl; std::cout << "Number of errors : " << n_errors << std::endl; } diff --git a/include/gunrock/algorithms/color.hxx b/include/gunrock/algorithms/color.hxx index c862a548..6f110158 100644 --- a/include/gunrock/algorithms/color.hxx +++ b/include/gunrock/algorithms/color.hxx @@ -126,9 +126,9 @@ struct enactor_t : gunrock::enactor_t { continue; auto rand_u = randoms[u]; - if (rand_v <= rand_u) + if (rand_v < rand_u || (rand_v == rand_u && vertex < u)) colormax = false; - if (rand_v >= rand_u) + if (rand_v > rand_u || (rand_v == rand_u && vertex > u)) colormin = false; } @@ -179,4 +179,4 @@ float run(graph_t& G, } } // namespace color -} // namespace gunrock \ No newline at end of file +} // namespace gunrock diff --git a/include/gunrock/graph/csr.hxx b/include/gunrock/graph/csr.hxx index 1dfc2b6f..f7400a2f 100644 --- a/include/gunrock/graph/csr.hxx +++ b/include/gunrock/graph/csr.hxx @@ -93,8 +93,8 @@ class graph_csr_t { __host__ __device__ __forceinline__ edge_type get_edge(const vertex_type& source, const vertex_type& destination) const { return (edge_type)search::binary::execute(get_column_indices(), destination, - offsets[source], - offsets[source + 1] - 1); + get_starting_edge(source), + get_starting_edge(source + 1) - 1); } /** diff --git a/include/gunrock/graph/properties.hxx b/include/gunrock/graph/properties.hxx index 0fc239a7..4165c941 100644 --- a/include/gunrock/graph/properties.hxx +++ b/include/gunrock/graph/properties.hxx @@ -12,7 +12,7 @@ namespace graph { */ struct graph_properties_t { bool directed{false}; - bool weighted{false}; + bool weighted{true}; graph_properties_t() = default; };