     }
 };
 
+#if ENABLE_LMEM_PATH
 // runs the entire BAQ algorithm in a single kernel, storing forward and backward matrices in local memory
 template <target_system system>
 struct hmm_glocal_lmem : public lambda<system>

                                                                      baq.matrix_index.end(),
                                                                      baq.scaling_index.end())),
                         hmm_glocal_lmem<system>(context, batch.device, baq_state));
    } else {
        // slow path: store the matrices in global memory
        parallel<system>::for_each(thrust::make_zip_iterator(thrust::make_tuple(active_baq_read_list.begin(),
                                                                      baq.matrix_index.begin(),
                                                                      baq.scaling_index.begin())),
                         thrust::make_zip_iterator(thrust::make_tuple(active_baq_read_list.end(),
                                                                      baq.matrix_index.end(),
                                                                      baq.scaling_index.end())),
                         hmm_glocal<system>(context, batch.device, baq_state));
    }

    baq_hmm.stop();



    // for any reads that we did *not* compute a BAQ, mark the base pairs as having no BAQ uncertainty
    parallel<system>::for_each(context.active_read_list.begin(),
                               context.active_read_list.end(),
                               read_flat_baq<system>(context, batch.device));

    // transform quality scores
    parallel<system>::for_each(active_baq_read_list.begin(),
                               active_baq_read_list.end(),
                               cap_baq_qualities<system>(context, batch.device, baq_state));

    parallel<system>::for_each(active_baq_read_list.begin(),
                               active_baq_read_list.end(),
                               recode_baq_qualities<system>(context, batch.device));

    baq_postprocess.stop();

