Exemple #1
0
/*
 *  Initializes the mpool module.
 */
void mca_mpool_memkind_module_init(mca_mpool_memkind_module_t *mpool, int partition)
{
    mpool->super.mpool_component = &mca_mpool_memkind_component.super;
    mpool->super.mpool_alloc = mca_mpool_memkind_alloc;
    mpool->super.mpool_realloc = mca_mpool_memkind_realloc;
    mpool->super.mpool_free = mca_mpool_memkind_free;
    mpool->super.flags = MCA_MPOOL_FLAGS_MPI_ALLOC_MEM;
    memkind_get_kind_by_partition (partition, &mpool->kind);
    mpool->page_size = partition_page_sizes[partition];
}
Exemple #2
0
struct memkind *tbb_detect_kind(void *ptr)
{
    if (!ptr) {
        return NULL;
    }
    struct memkind *kind = NULL;
    unsigned i;
    void *pool = pool_identify(ptr);
    for (i = 0; i < MEMKIND_MAX_KIND; ++i) {
        int err = memkind_get_kind_by_partition(i, &kind);
        if (!err && kind->priv == pool) {
            break;
        }
    }

    return kind;
}