 {
   constexpr int num_warps = block_size/warp_size;
   __shared__ int current_idx_shared[num_warps];
-  __shared__ index_type join_shared_l[num_warps][output_cache_size];
-  __shared__ index_type join_shared_r[num_warps][output_cache_size];
-  index_type *output_l = join_output_l, *output_r = join_output_r;
+  __shared__ output_index_type join_shared_l[num_warps][output_cache_size];
+  __shared__ output_index_type join_shared_r[num_warps][output_cache_size];
+  output_index_type *output_l = join_output_l, *output_r = join_output_r;
 
   if (flip_results) {
       output_l = join_output_r;

/** 
* @Synopsis  Adds a pair of indices to the shared memory cache
* 
* @Param first The first index in the pair
* @Param second The second index in the pair
* @Param current_idx_shared Pointer to shared index that determines where in the shared
memory cache the pair will be written
* @Param warp_id The ID of the warp of the calling the thread
* @Param joined_shared Pointer to the shared memory cache
* 
*/
/* ----------------------------------------------------------------------------*/
template<typename size_type,
         typename index_type>
__inline__ __device__ void add_pair_to_cache(const size_type first, 
                                             const size_type second, 
                                             int *current_idx_shared, 
                                             const int warp_id, 
                                             index_type *joined_shared_l,
                                             index_type *joined_shared_r)
{
  int my_current_idx = atomicAdd(current_idx_shared + warp_id, 1);


    const auto unused_key = multi_map->get_unused_key();
    const auto end = multi_map->end();

    // Compute the hash value of the probe row
    const hash_value_type probe_row_hash_value{probe_table.hash_row(probe_row_index)};

    // Search the hash map for the hash value of the probe row using the row's
    // hash value to determine the location where to search for the row in the hash map
    auto found = multi_map->find(probe_row_hash_value,
                                 true,
                                 probe_row_hash_value);

    // for left-joins we always need to add an output
    bool running = (join_type == JoinType::LEFT_JOIN) || (end != found); 
    bool found_match = false;
#if defined(CUDA_VERSION) && CUDA_VERSION >= 9000
    while ( __any_sync( activemask, running ) )
