Skip to content

Commit

Permalink
update tests to support rng state as input
Browse files Browse the repository at this point in the history
  • Loading branch information
jnke2016 committed Dec 31, 2024
1 parent bea2a2f commit 755acc7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cpp/tests/c_api/sg_random_walks_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ int generic_uniform_random_walks_test(vertex_t* h_src,

TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "start copy_from_host failed.");

cugraph_rng_state_t* rng_state;
ret_code = cugraph_rng_state_create(handle, 0, &rng_state, &ret_error);
TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "rng_state create failed.");

ret_code =
cugraph_uniform_random_walks(handle, graph, d_start_view, max_depth, &result, &ret_error);
cugraph_uniform_random_walks(handle, rng_state, graph, d_start_view, max_depth, &result, &ret_error);

TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error));
TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "uniform_random_walks failed.");
Expand Down Expand Up @@ -188,9 +192,13 @@ int generic_biased_random_walks_test(vertex_t* h_src,
handle, d_start_view, (byte_t*)h_start, &ret_error);

TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "start copy_from_host failed.");


cugraph_rng_state_t* rng_state;
ret_code = cugraph_rng_state_create(handle, 0, &rng_state, &ret_error);
TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "rng_state create failed.");

ret_code =
cugraph_biased_random_walks(handle, graph, d_start_view, max_depth, &result, &ret_error);
cugraph_biased_random_walks(handle, rng_state, graph, d_start_view, max_depth, &result, &ret_error);

TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error));
TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "biased_random_walks failed.");
Expand Down

0 comments on commit 755acc7

Please sign in to comment.