     // computes a matrix offset for forwardMatrix or backwardMatrix
     CUDA_HOST_DEVICE int off(int i, int j = 0)
     {
-        return i * 3 * (2 * MAX_BAND_WIDTH + 1) + j;
+        return i * LMEM_MAT_ROW_SIZE + j;
     }
 
     // computes the required HMM matrix size for the given read length
     CUDA_HOST_DEVICE static uint32 matrix_size(const uint32 read_len)
     {
-        return (read_len + 1) * 3 * (2 * MAX_BAND_WIDTH + 1);
+        return (read_len + 1) * LMEM_MAT_ROW_SIZE;
     }
 
     CUDA_HOST_DEVICE static double qual2prob(uint8 q)

    // computes a matrix offset for forwardMatrix or backwardMatrix
    CUDA_HOST_DEVICE int off(int i, int j = 0)
    {
        return i * 6 * (2 * MAX_BAND_WIDTH + 1) + j;
    }

    // computes the required HMM matrix size for the given read length
    CUDA_HOST_DEVICE static uint32 matrix_size(const uint32 read_len)
    {
        return (read_len + 1) * 6 * (2 * MAX_BAND_WIDTH + 1);
    }

    CUDA_HOST_DEVICE static double qual2prob(uint8 q)


// maximum read size for the lmem kernel
#define LMEM_MAX_READ_LEN 151
#define LMEM_MAT_ROW_SIZE (3 * MAX_BAND_WIDTH2 + 6)
#define LMEM_MAT_SIZE ((LMEM_MAX_READ_LEN + 1) * LMEM_MAT_ROW_SIZE)

//#define GUARD_BAND(z) ((z) > 0 ? (z) : 0)
#define GUARD_BAND(z) (z)

template <target_system system>
struct compute_hmm_windows : public lambda<system>
