1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 
  21 
  22 
  23 
  24 
  25 
  26 
  27 #ifndef MCA_RCACHE_RGPUSM_H
  28 #define MCA_RCACHE_RGPUSM_H
  29 
  30 #include "opal_config.h"
  31 #include "opal/class/opal_list.h"
  32 #include "opal/class/opal_free_list.h"
  33 #include "opal/mca/rcache/rcache.h"
  34 
  35 BEGIN_C_DECLS
  36 
  37 struct mca_rcache_rgpusm_component_t {
  38     mca_rcache_base_component_t super;
  39     char* rcache_name;
  40     unsigned long long rcache_size_limit;
  41     bool print_stats;
  42     int leave_pinned;
  43     int output;
  44     bool empty_cache;
  45 };
  46 typedef struct mca_rcache_rgpusm_component_t mca_rcache_rgpusm_component_t;
  47 
  48 OPAL_DECLSPEC extern mca_rcache_rgpusm_component_t mca_rcache_rgpusm_component;
  49 
  50 struct mca_rcache_rgpusm_module_t {
  51     mca_rcache_base_module_t super;
  52     opal_free_list_t reg_list;
  53     opal_list_t lru_list;
  54     uint32_t stat_cache_hit;
  55     uint32_t stat_cache_valid;
  56     uint32_t stat_cache_invalid;
  57     uint32_t stat_cache_miss;
  58     uint32_t stat_evicted;
  59     uint32_t stat_cache_found;
  60     uint32_t stat_cache_notfound;
  61     mca_rcache_base_vma_module_t *vma_module;
  62 }; typedef struct mca_rcache_rgpusm_module_t mca_rcache_rgpusm_module_t;
  63 
  64 
  65 
  66 
  67 void mca_rcache_rgpusm_module_init(mca_rcache_rgpusm_module_t *rcache);
  68 
  69 
  70 
  71 
  72 int mca_rcache_rgpusm_register(mca_rcache_base_module_t* rcache, void *addr,
  73         size_t size, uint32_t flags, int32_t access_flags, mca_rcache_base_registration_t **reg);
  74 
  75 
  76 
  77 
  78 int mca_rcache_rgpusm_deregister(mca_rcache_base_module_t *rcache,
  79         mca_rcache_base_registration_t *reg);
  80 
  81 
  82 
  83 
  84 void mca_rcache_rgpusm_free(mca_rcache_base_module_t *rcache, void * addr,
  85         mca_rcache_base_registration_t *reg);
  86 
  87 
  88 
  89 
  90 int mca_rcache_rgpusm_find(struct mca_rcache_base_module_t* rcache, void* addr,
  91         size_t size, mca_rcache_base_registration_t **reg);
  92 
  93 
  94 
  95 
  96 int mca_rcache_rgpusm_release_memory(mca_rcache_base_module_t* rcache, void *base,
  97         size_t size);
  98 
  99 
 100 
 101 
 102 void mca_rcache_rgpusm_finalize(struct mca_rcache_base_module_t *rcache);
 103 
 104 END_C_DECLS
 105 #endif