| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 | /* * 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 API_Standard_Memory_Library Standard Memory Library\def starpu_data_malloc_pinned_if_possible\ingroup API_Standard_Memory_Library\deprecatedEquivalent to starpu_malloc(). This macro is provided to avoid breaking old codes.\def starpu_data_free_pinned_if_possible\ingroup API_Standard_Memory_Library\deprecatedEquivalent to starpu_free(). This macro is provided to avoid breaking old codes.\def STARPU_MALLOC_PINNED\ingroup API_Standard_Memory_LibraryValue passed to the function starpu_malloc_flags() to indicate the memory allocation should be pinned.\def STARPU_MALLOC_COUNT\ingroup API_Standard_Memory_LibraryValue passed to the function starpu_malloc_flags() to indicatethe memory allocation should be in the limit defined by theenvironment variables \ref STARPU_LIMIT_CUDA_devid_MEM,\ref STARPU_LIMIT_CUDA_MEM, \ref STARPU_LIMIT_OPENCL_devid_MEM,\ref STARPU_LIMIT_OPENCL_MEM and \ref STARPU_LIMIT_CPU_MEM (seeSection \ref HowToLimitMemoryPerNode).If no memory is available, it tries to reclaim memory from StarPU.Memory allocated this way needs to be freed by calling the functionstarpu_free_flags() with the same flag.\fn int starpu_malloc_flags(void **A, size_t dim, int flags)\ingroup API_Standard_Memory_LibraryPerforms a memory allocation based on the constraints definedby the given flag.\fn void starpu_malloc_set_align(size_t align)\ingroup API_Standard_Memory_LibraryThis function sets an alignment constraints for starpu_malloc()allocations. align must be a power of two. This is for instance calledautomatically by the OpenCL driver to specify its own alignmentconstraints.\fn int starpu_malloc(void **A, size_t dim)\ingroup API_Standard_Memory_LibraryThis function allocates data of the given size in main memory.It will also try to pin it in CUDA or OpenCL, so that data transfersfrom this buffer can be asynchronous, and thus permit data transferand computation overlapping. The allocated buffer must be freed thanksto the starpu_free() function.\fn int starpu_free(void *A)\ingroup API_Standard_Memory_LibraryThis function frees memory which has previously been allocatedwith starpu_malloc().\fn int starpu_free_flags(void *A, size_t dim, int flags)\ingroup API_Standard_Memory_LibraryThis function frees memory by specifying its size. The givenflags 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 API_Standard_Memory_LibraryIf a memory limit is defined on the given node (see Section \refHowToLimitMemoryPerNode), return the amount of available memoryon the node. Otherwise return -1.*/
 |