root/opal/mca/mpool/memkind/mpool_memkind.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2004-2006 The University of Tennessee and The University
   7  *                         of Tennessee Research Foundation.  All rights
   8  *                         reserved.
   9  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
  10  *                         University of Stuttgart.  All rights reserved.
  11  * Copyright (c) 2004-2005 The Regents of the University of California.
  12  *                         All rights reserved.
  13  * Copyright (c) 2007      Sun Microsystems, Inc.  All rights reserved.
  14  * Copyright (c) 2009      Cisco Systems, Inc.  All rights reserved.
  15  * Copyright (c) 2010-2018 Los Alamos National Security, LLC. All rights
  16  *                         reserved.
  17  * $COPYRIGHT$
  18  *
  19  * Additional copyrights may follow
  20  *
  21  * $HEADER$
  22  */
  23 /**
  24  * @file
  25  */
  26 #ifndef MCA_MPOOL_MEMKIND_H
  27 #define MCA_MPOOL_MEMKIND_H
  28 
  29 #include "opal_config.h"
  30 
  31 #include "opal/mca/event/event.h"
  32 #include "opal/mca/mpool/mpool.h"
  33 
  34 #include "opal/mca/allocator/allocator.h"
  35 #include <memkind.h>
  36 
  37 BEGIN_C_DECLS
  38 
  39 static const int mca_mpool_memkind_default_pagesize = 4096;
  40 
  41 
  42 struct mca_mpool_memkind_module_t {
  43     mca_mpool_base_module_t super;
  44     memkind_t kind;
  45     memkind_memtype_t type;
  46     memkind_policy_t  policy;
  47     memkind_bits_t    memkind_bits;
  48     int page_size;
  49 };
  50 
  51 typedef struct mca_mpool_memkind_module_t mca_mpool_memkind_module_t;
  52 
  53 struct mca_mpool_memkind_module_le_t {
  54     opal_list_item_t super;
  55     mca_mpool_memkind_module_t module;
  56 };
  57 typedef struct mca_mpool_memkind_module_le_t mca_mpool_memkind_module_le_t;
  58 
  59 OBJ_CLASS_DECLARATION(mca_mpool_memkind_module_le_t);
  60 
  61 struct mca_mpool_memkind_component_t {
  62     mca_mpool_base_component_t super;
  63     int  hbw;
  64     int  pagesize;
  65     int  bind;
  66     memkind_memtype_t default_type;
  67     memkind_policy_t  default_policy;
  68     memkind_bits_t    default_memkind_bits;
  69     memkind_t         default_kind;
  70     int  priority;
  71     int  output;
  72     opal_list_t module_list;
  73 };
  74 
  75 typedef struct mca_mpool_memkind_component_t mca_mpool_memkind_component_t;
  76 OPAL_MODULE_DECLSPEC extern mca_mpool_memkind_component_t mca_mpool_memkind_component;
  77 
  78 /**
  79  *  Initializes the mpool module.
  80  */
  81 
  82 void mca_mpool_memkind_module_init(mca_mpool_memkind_module_t *mpool);
  83 
  84 
  85 /**
  86   *  Allocate block of high bandwidth memory.
  87   */
  88 void* mca_mpool_memkind_alloc(
  89     mca_mpool_base_module_t* mpool,
  90     size_t size,
  91     size_t align,
  92     uint32_t flags);
  93 
  94 /**
  95   * realloc function typedef
  96   */
  97 void* mca_mpool_memkind_realloc(
  98     mca_mpool_base_module_t* mpool,
  99     void* addr,
 100     size_t size);
 101 
 102 /**
 103   * free function typedef
 104   */
 105 void mca_mpool_memkind_free(
 106     mca_mpool_base_module_t* mpool,
 107     void * addr);
 108 
 109 END_C_DECLS
 110 
 111 #endif

/* [<][>][^][v][top][bottom][index][help] */