Exemple #1
0
void fuser(bh_ir &bhir, FuseCache &cache)
{
    if(bhir.kernel_list.size() != 0)
        throw logic_error("The kernel_list is not empty!");

    BatchHash batch(bhir.instr_list);
    if(not cache.lookup(batch, bhir, bhir.kernel_list))
    {
        do_fusion(bhir);
        cache.insert(batch, bhir.kernel_list);
    }
}
Exemple #2
0
    // All fusers checks the cache before doing fusion
    // If cache miss, we call the do_fuction() function, which anyone
    // inherent from this class should implement
    virtual void execute(bh_ir *bhir) {

        if(bhir->kernel_list.size() != 0)
            throw std::logic_error("The kernel_list is not empty!");

        if(_cache.enabled) {
            BatchHash hash(bhir->instr_list);
            if(not _cache.lookup(hash, *bhir, bhir->kernel_list)) {//Fuse cache miss!
                do_fusion(*bhir);
                _cache.insert(hash, bhir->kernel_list);
            }
        } else {
            do_fusion(*bhir);
        }
        child.execute(bhir);
    }
Exemple #3
0
bh_error bh_fuser_gentle_shutdown(void)
{
    bh_error err = child->shutdown();
    fuse_cache.write_to_files();
    bh_component_destroy(&myself);
    return err;
}