123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- /*
- * This file is part of the StarPU Handbook.
- * Copyright (C) 2009--2011 Universit@'e de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012, 2013 Centre National de la Recherche Scientifique
- * Copyright (C) 2011, 2012 Institut National de Recherche en Informatique et Automatique
- * See the file version.doxy for copying conditions.
- */
- /*! \defgroup Standard_Memory_Library Standard Memory Library
- \def STARPU_MALLOC_PINNED
- \ingroup Standard_Memory_Library
- \brief Value passed to the function starpu_malloc_flags() to indicate the memory allocation should be pinned.
- \def STARPU_MALLOC_COUNT
- \ingroup Standard_Memory_Library
- \brief Value passed to the function starpu_malloc_flags() to indicate
- the memory allocation should be in the limit defined by the
- environment variables <c>STARPU_LIMIT_CUDA_devid_MEM</c>,
- <c>STARPU_LIMIT_CUDA_MEM</c>, <c>STARPU_LIMIT_OPENCL_devid_MEM</c>,
- <c>STARPU_LIMIT_OPENCL_MEM</c> and <c>STARPU_LIMIT_CPU_MEM</c> (see
- Section \ref How_to_limit_memory_per_node).
- If no memory is available, it tries to reclaim memory from StarPU.
- Memory allocated this way needs to be freed by calling the
- starpu_free_flags() function with the same flag.
- \fn int starpu_malloc_flags(void **A, size_t dim, int flags)
- \ingroup Standard_Memory_Library
- \brief Performs a memory allocation based on the constraints defined
- by the given flag.
- \fn void starpu_malloc_set_align(size_t align)
- \ingroup Standard_Memory_Library
- \brief This function sets an alignment constraints for starpu_malloc()
- allocations. align must be a power of two. This is for instance called
- automatically by the OpenCL driver to specify its own alignment
- constraints.
- \fn int starpu_malloc(void **A, size_t dim)
- \ingroup Standard_Memory_Library
- \brief This function allocates data of the given size in main memory.
- It will also try to pin it in CUDA or OpenCL, so that data transfers
- from this buffer can be asynchronous, and thus permit data transfer
- and computation overlapping. The allocated buffer must be freed thanks
- to the starpu_free() function.
- \fn int starpu_free(void *A)
- \ingroup Standard_Memory_Library
- \brief This function frees memory which has previously been allocated
- with starpu_malloc().
- \fn int starpu_free_flags(void *A, size_t dim, int flags)
- \ingroup Standard_Memory_Library
- \brief This function frees memory by specifying its size. The given
- flags should be consistent with the ones given to starpu_malloc_flags()
- when allocating the memory.
- \fn ssize_t starpu_memory_get_available(unsigned node)
- \ingroup Standard_Memory_Library
- \brief If a memory limit is defined on the given node (see Section \ref
- How_to_limit_memory_per_node), return the amount of available memory
- on the node. Otherwise return -1.
- */
|