예제 #1
0
__global__ void _merge_space( AlleleSpaceType * in_alleles
                            , device_free_space< IntType, unordered_tag > * in_free
                            , device_event_space< IntType, unordered_tag > * new_muts
                            , device_free_space< IntType, unordered_tag > * out_free
                            , AlleleSpaceType * out_alleles ) {

    unsigned int N = in_free->total;    // total number of free elements from parent allele space
    unsigned int M = new_muts->total;   // total number of new mutations to be added to offspring population

    unsigned int P = in_alleles->capacity; // current allocated size of parent population

    unsigned int C = P + (( N < M ) ? (M - N) : 0);

//    printf( "Resize Population: %d = %d + |min(0, (%d - %d))|\n", C, P, N, M );

    _resize_space_impl(out_alleles, C );  // resize offspring allele space relative to parent space

    C = out_alleles->capacity;  // the size of the offspring allele space
//    printf( "Padded Population: %d\n", C );

    _resize_space_impl( out_free, C );     // resize offspring free space relative to offsrping allele space
 
    if( P > 0 ) {
        //printf( "Updating spaces \n" );
        _update_space( in_alleles, out_alleles );
        _update_space( in_free, out_free );
    }
}
예제 #2
0
__global__ void _resize_space( discrete_table< IntType, RealType > * tbl, unsigned int N ) {
    assert( blockIdx.y * gridDim.x + blockIdx.x == 0 );

    if( threadIdx.y * blockDim.x + threadIdx.x == 0 ) {
        _resize_space_impl( tbl, N );
    }
}
__global__ void _resize_space( device_phenotype_space< RealType > * space, unsigned int N ) {
    assert( blockIdx.y * gridDim.x + blockIdx.x == 0 );

    if( threadIdx.y * blockDim.x + threadIdx.x == 0 ) {
        _resize_space_impl( (basic_data_space< RealType > *) space, N );
    }
}
예제 #4
0
__global__ void expand_spaces_kernel( AlleleSpaceType * in_alleles
                            , device_free_space< IntType, unordered_tag > * in_free
                            , device_event_space< IntType, unordered_tag > * new_muts
                            , device_free_space< IntType, unordered_tag > * out_free
                            , AlleleSpaceType * out_alleles ) {

    unsigned int N = in_free->total;    // total number of free elements from parent allele space
    unsigned int M = new_muts->total;   // total number of new mutations to be added to offspring population

    unsigned int P = in_alleles->capacity; // current allocated size of parent population

    unsigned int C = P + (( N < M ) ? (M - N) : 0);

    _resize_space_impl(out_alleles, C );  // resize offspring allele space relative to parent space

    C = out_alleles->capacity;  // the size of the offspring allele space

    _resize_space_impl( out_free, C );     // resize offspring free space relative to offsrping allele space
}
__global__ void _resize_space_to( basic_data_space< unsigned int > * res, device_sequence_space< IntType > * seqs ) {
    if( threadIdx.y * blockDim.x + threadIdx.x == 0 ) {
        unsigned int N = seqs->seq_count;
        _resize_space_impl( res, N );
    }
}