@@ -198,18 +198,17 @@ typedef enum {
198198 MONOTONICALLY_DECREASING , /** Time monotonically decreasing (could have multiple edges with same
199199 time) */
200200 FIXED_WINDOW , /** Apply the original per-seed time window at every hop */
201- LAST = FIXED_WINDOW /** Deprecated alias for FIXED_WINDOW */
201+ LAST /** Deprecated Value, we moved last-n to a different parameter */
202202} cugraph_temporal_sampling_comparison_t ;
203203
204204/**
205205 * @brief Selects neighbors from the set that satisfies the sampling filters.
206206 */
207207typedef enum {
208208 CUGRAPH_NEIGHBOR_SELECTION_RANDOM = 0 , /** Uniform without biases, biased with biases */
209- CUGRAPH_NEIGHBOR_SELECTION_FIRST , /** Deterministically select the earliest edges (not yet
210- implemented) */
211- CUGRAPH_NEIGHBOR_SELECTION_LAST /** Deterministically select the latest edges (not yet
212- implemented) */
209+ CUGRAPH_NEIGHBOR_SELECTION_LAST /** Deterministically select the last-n edges based on the
210+ ordering criteria defined in temporal_sampling_comparison (not
211+ yet implemented) */
213212} cugraph_neighbor_selection_t ;
214213
215214/**
@@ -330,6 +329,25 @@ CUGRAPH_EXPORT void cugraph_sampling_set_dedupe_sources(cugraph_sampling_options
330329CUGRAPH_EXPORT void cugraph_sampling_set_temporal_sampling_comparison (
331330 cugraph_sampling_options_t * options , cugraph_temporal_sampling_comparison_t comparison );
332331
332+ /**
333+ * @ingroup samplingC
334+ * @brief Clear temporal sampling comparison, disabling temporal sampling.
335+ *
336+ * @param options - opaque pointer to the sampling options
337+ */
338+ CUGRAPH_EXPORT void cugraph_sampling_clear_temporal_sampling_comparison (
339+ cugraph_sampling_options_t * options );
340+
341+ /**
342+ * @ingroup samplingC
343+ * @brief Set neighbor selection mode.
344+ *
345+ * @param options - opaque pointer to the sampling options
346+ * @param selection - RANDOM or LAST
347+ */
348+ CUGRAPH_EXPORT void cugraph_sampling_set_neighbor_selection (cugraph_sampling_options_t * options ,
349+ cugraph_neighbor_selection_t selection );
350+
333351/**
334352 * @ingroup samplingC
335353 * @brief Set flag to perform disjoint sampling
@@ -354,14 +372,14 @@ CUGRAPH_EXPORT void cugraph_sampling_options_free(cugraph_sampling_options_t* op
354372 * @brief Unified homogeneous/heterogeneous and temporal/non-temporal neighborhood sampling.
355373 *
356374 * RANDOM selection samples uniformly if @p edge_biases is NULL and samples according to
357- * @p edge_biases otherwise. FIRST and LAST are reserved for deterministically selecting the
358- * earliest or latest temporally eligible edges (requiring @p temporal_sampling_comparison), but
359- * are not yet implemented.
375+ * @p edge_biases otherwise. LAST is reserved for deterministically selecting the latest
376+ * temporally eligible edges (requiring temporal sampling), but is not yet implemented.
360377 *
361- * Sampling is non-temporal when @p temporal_sampling_comparison is NULL; all temporal arguments
362- * must then be NULL. Sampling is homogeneous when @p num_edge_types is 1; otherwise
363- * @p fan_out contains one value per (hop, edge type). When @p vertex_type_offsets is NULL,
364- * all vertices are treated as a single vertex type.
378+ * Sampling is non-temporal unless cugraph_sampling_set_temporal_sampling_comparison has been
379+ * called on @p sampling_options; all temporal arguments must then be NULL. Sampling is
380+ * homogeneous when @p num_edge_types is 1; otherwise @p fan_out contains one value per
381+ * (hop, edge type). When @p vertex_type_offsets is NULL, all vertices are treated as a single
382+ * vertex type.
365383 *
366384 * @param [in] handle Handle for accessing resources.
367385 * @param [in,out] rng_state State of the random number generator, updated for RANDOM selection.
@@ -375,10 +393,9 @@ CUGRAPH_EXPORT void cugraph_sampling_options_free(cugraph_sampling_options_t* op
375393 * processing.
376394 * @param [in] fan_out Host array defining fanout per hop (and per edge type when heterogeneous).
377395 * @param [in] num_edge_types Number of edge types. Use 1 for homogeneous sampling.
378- * @param [in] neighbor_selection RANDOM, FIRST, or LAST.
379- * @param [in] temporal_sampling_comparison Optional temporal comparison. NULL disables temporal
380- * sampling.
381- * @param [in] sampling_options Sampling options.
396+ * @param [in] sampling_options Sampling options. Temporal sampling is enabled by
397+ * cugraph_sampling_set_temporal_sampling_comparison; neighbor selection defaults to RANDOM and may
398+ * be set with cugraph_sampling_set_neighbor_selection.
382399 * @param [in] do_expensive_check Whether to perform expensive input validation.
383400 * @param [out] result Sampling result.
384401 * @param [out] error Error details on failure.
@@ -396,8 +413,6 @@ CUGRAPH_EXPORT cugraph_error_code_t cugraph_neighbor_sample(
396413 const cugraph_type_erased_device_array_view_t * vertex_type_offsets ,
397414 const cugraph_type_erased_host_array_view_t * fan_out ,
398415 int num_edge_types ,
399- cugraph_neighbor_selection_t neighbor_selection ,
400- const cugraph_temporal_sampling_comparison_t * temporal_sampling_comparison ,
401416 const cugraph_sampling_options_t * sampling_options ,
402417 bool_t do_expensive_check ,
403418 cugraph_sample_result_t * * result ,
0 commit comments