root/opal/mca/rcache/rgpusm/rcache_rgpusm.h

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

INCLUDED FROM


   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2005 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) 2006      Voltaire. All rights reserved.
  14  * Copyright (c) 2012-2015 NVIDIA Corporation.  All rights reserved.
  15  * Copyright (c) 2015      Los Alamos National Security, LLC.  All rights
  16  *                         reserved.
  17  *
  18  * $COPYRIGHT$
  19  *
  20  * Additional copyrights may follow
  21  *
  22  * $HEADER$
  23  */
  24 /**
  25  * @file
  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  *  Initializes the rcache module.
  66  */
  67 void mca_rcache_rgpusm_module_init(mca_rcache_rgpusm_module_t *rcache);
  68 
  69 /**
  70   * register block of memory
  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  * deregister memory
  77  */
  78 int mca_rcache_rgpusm_deregister(mca_rcache_base_module_t *rcache,
  79         mca_rcache_base_registration_t *reg);
  80 
  81 /**
  82   * free memory allocated by alloc function
  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  * find registration for a given block of memory
  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  * unregister all registration covering the block of memory
  95  */
  96 int mca_rcache_rgpusm_release_memory(mca_rcache_base_module_t* rcache, void *base,
  97         size_t size);
  98 
  99 /**
 100  * finalize rcache
 101  */
 102 void mca_rcache_rgpusm_finalize(struct mca_rcache_base_module_t *rcache);
 103 
 104 END_C_DECLS
 105 #endif

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