template<
typename stream_type,
typename algorithm_type = DeviceThreadScheduler>
struct nvbio::aln::BatchedAlignmentScore< stream_type, algorithm_type >
Execution context for a batch of alignment jobs.
- Template Parameters
-
stream_type | the stream of alignment jobs |
algorithm_type | a Batch Scheduler specifier |
This class has to provide the following interface:
stream_type
{
struct context_type
{
sink_type sink;
...
};
struct strings_type
{
pattern_type pattern;
qual_type quals;
...
};
uint32 max_pattern_length()
const;
uint32 max_text_length()
const;
uint32 pattern_length(
const uint32 i, context_type* context)
const;
uint32 text_length(
const uint32 i, context_type* context)
const;
bool init_context(
context_type* context) const;
void load_strings(
context_type* context,
strings_type* strings) const;
void output(
const uint32 i, context_type* context);
};
While this design might seem a little convoluted it is motivated by efficiency and generality. In fact, it does:
- allow the scheduler to break the alignment process into multiple stages while performing initializations only once through the stream_type::init_context() method;
- allow the user to perform string caching in registers/local memory: in fact, schedulers will instantiate the strings_type class on the stack, thus guaranteeing that any user-defined private data will be placed either in registers or local memory. The stream_type::load_strings() method is then free to use such private data to implement a cache for any of the involved strings. With this design cached strings will then be allowed to just contain pointers to the caches, making sure that they can be passed by value without inadvertedly copying the caches themselves.
Definition at line 313 of file batched.h.