#include <stdlib.h>
#include <string.h>
#include "base.h"
#include "types.h"
#include "util.h"
Go to the source code of this file.
|
void | init_arrays_cpu (TREE_RECORD *tree_record, TREE_PARAMETERS *params) |
|
void | brute_force_leaf_cpu (INT_TYPE fr_idx, INT_TYPE to_idx, FLOAT_TYPE *test_patterns, INT_TYPE ntest_patterns, FLOAT_TYPE *d_min, INT_TYPE *idx_min, TREE_RECORD *tree_record, TREE_PARAMETERS *params) |
|
void | process_all_buffers_cpu (TREE_RECORD *tree_record, TREE_PARAMETERS *params) |
|
void | do_bruteforce_all_leaves_cpu (INT_TYPE *test_indices_removed_from_all_buffers, INT_TYPE total_number_test_indices_removed, INT_TYPE *fr_indices, INT_TYPE *to_indices, TREE_RECORD *tree_record, TREE_PARAMETERS *params) |
|
void | process_queue_via_brute_force_cpu (TREE_RECORD *tree_record, TREE_PARAMETERS *params) |
|
void | find_leaf_idx_batch_cpu (INT_TYPE *all_next_indices, INT_TYPE num_all_next_indices, INT_TYPE *ret_vals, TREE_RECORD *tree_record, TREE_PARAMETERS *params) |
|
void | get_distances_and_indices_cpu (TREE_RECORD *tree_record, TREE_PARAMETERS *params) |
|
void | write_sorted_training_patterns_cpu (TREE_RECORD *tree_record, TREE_PARAMETERS *params) |
|
Brute-force nearest neigbhor search in a leaf of the tree (determined by fr_idx, to_idx, and XI).
- Parameters
-
fr_idx | The "from" index w.r.t. the training indices |
to_idx | The "to" index w.r.t. the training indices |
*test_patterns | Array of test patterns |
ntest_patterns | Number of test patterns |
*d_min | Array of distance values that can be updated |
*idx_min | Array of indices that can be updated |
*tree_record | Pointer to struct instance storing the model |
*params | Pointer to struct instance storing all model parameters |
Performs a brute-force in the leaves.
- Parameters
-
*test_indices_removed_from_all_buffers | Array of indices that were removed from all buffers |
total_number_test_indices_removed | Number of removed indices |
*fr_indices | Array of "from" indices (see paper) |
*to_indices | Array of "to" indices (see paper) |
*tree_record | Pointer to struct instance storing the model |
*params | Pointer to struct instance storing all model parameters |
Finds the next leaf indices for all test patterns indixed by all_next_indices.
- Parameters
-
all_next_indices | Array containing indices to be processed |
num_all_next_indices | Number of indices |
*ret_vals | For each index, the next leaf buffer that needs to be processed |
*tree_record | Pointer to struct instance storing the model |
*params | Pointer to struct instance storing all model parameters |
Copies the arrays dist_min_global and idx_min_global from GPU to CPU Updates the distances and indices (w.r.t the original indices)
- Parameters
-
*tree_record | Pointer to struct instance storing the model |
*params | Pointer to struct instance storing all model parameters |
Initializes all arrays.
- Parameters
-
*tree_record | Pointer to struct instance storing the model |
*params | Pointer to struct instance storing all model parameters |
Processes all buffers on the CPU.
- Parameters
-
*tree_record | Pointer to struct instance storing the model |
*params | Pointer to struct instance storing all model parameters |
If only few elements are left in the queues after the buffers have been emptied, we do a simple brute force step to compute the nearest neighbors.
- Parameters
-
*tree_record | Pointer to struct instance storing the model |
*params | Pointer to struct instance storing all model parameters |
Writes the training patterns in a specific ordering.
- Parameters
-
*tree_record | Pointer to struct instance storing the model |
*params | Pointer to struct instance storing all model parameters |