 #include <vector>
 #include <algorithm>
 
+#if defined(SSWLIB)
+#include "ssw.h"
+#include <omp.h>
+#endif
+
 using namespace nvbio;
 
 enum { CACHE_SIZE = 64 };


// A simple kernel to test the speed of alignment without the possible overheads of the BatchAlignmentScore interface
//
template <uint32 BLOCKDIM, uint32 MAX_REF_LEN, typename aligner_type, typename score_type>
__global__ void alignment_test_kernel(const aligner_type aligner, const uint32 N_probs, const uint32 M, const uint32 N, const uint32* strptr, const uint32* refptr, score_type* score)
{
    const uint32 tid = blockIdx.x * BLOCKDIM + threadIdx.x;

    typedef lmem_cache_tag_type                                                 lmem_cache_type;
    typedef nvbio::cuda::ldg_pointer<uint32>                                    base_iterator;

    typedef nvbio::PackedStringLoader<base_iterator,4,false,lmem_cache_type>    pattern_loader_type;
    typedef typename pattern_loader_type::iterator                              pattern_iterator;
    typedef nvbio::vector_wrapper<pattern_iterator>                             pattern_string;

    typedef nvbio::PackedStringLoader<base_iterator,2,false,lmem_cache_type>    text_loader_type;
    typedef typename text_loader_type::iterator                                 text_iterator;
    typedef nvbio::vector_wrapper<text_iterator>                                text_string;

    pattern_loader_type pattern_loader;
    pattern_string pattern = pattern_string( M, pattern_loader.load( strptr, tid * M, tid < N_probs ? M : 0u ) );

    text_loader_type text_loader;
    text_string text = text_string( N, text_loader.load( strptr, tid * N, tid < N_probs ? N : 0u ) );

    aln::BestSink<int32> sink;

    aln::alignment_score<MAX_REF_LEN>(
        aligner,
        pattern,
        aln::trivial_quality_string(),

                    TEST_MASK |= GOTOH;
                else if (strcmp( temp, "gotoh-banded" ) == 0)
                    TEST_MASK |= GOTOH_BANDED;
                else if (strcmp( temp, "ssw" ) == 0)
                    TEST_MASK |= SSW;

                if (*end == '\0')
                    break;
