| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015 | /* * 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_Data_Interfaces Data Interfaces\struct starpu_data_interface_opsPer-interface data transfer methods.\ingroup API_Data_Interfaces\var starpu_data_interface_ops::register_data_handleRegister an existing interface into a data handle.\var starpu_data_interface_ops::allocate_data_on_nodeAllocate data for the interface on a given node.\var starpu_data_interface_ops::free_data_on_nodeFree data of the interface on a given node.\var starpu_data_interface_ops::copy_methodsram/cuda/opencl synchronous and asynchronous transfer methods.\var starpu_data_interface_ops::handle_to_pointerReturn the current pointer (if any) for the handle on the given node.\var starpu_data_interface_ops::get_sizeReturn an estimation of the size of data, for performance models.\var starpu_data_interface_ops::footprintReturn a 32bit footprint which characterizes the data size.\var starpu_data_interface_ops::compareCompare the data size of two interfaces.\var starpu_data_interface_ops::displayDump the sizes of a handle to a file.\var starpu_data_interface_ops::interfaceidAn identifier that is unique to each interface.\var starpu_data_interface_ops::interface_sizeThe size of the interface data descriptor.\var starpu_data_interface_ops::is_multiformattodo\var starpu_data_interface_ops::get_mf_opstodo\var starpu_data_interface_ops::pack_dataPack the data handle into a contiguous buffer at the address ptr andset the size of the newly created buffer in count. If ptr is NULL, thefunction should not copy the data in the buffer but just set count tothe size of the buffer which would have been allocated. The specialvalue -1 indicates the size is yet unknown.\var starpu_data_interface_ops::unpack_dataUnpack the data handle from the contiguous buffer at the address ptrof size count\struct starpu_data_copy_methodsDefines the per-interface methods. If the any_to_any method isprovided, it will be used by default if no more specific method isprovided. It can still be useful to provide more specific method incase of e.g. available particular CUDA or OpenCL support.\ingroup API_Data_Interfaces\var starpu_data_copy_methods::ram_to_ramDefine how to copy data from the \p src_interface interface on the \psrc_node CPU node to the \p dst_interface interface on the \p dst_nodeCPU  node. Return 0 on success.\var starpu_data_copy_methods::ram_to_cudaDefine how to copy data from the \p src_interface interface on the\p src_node CPU node to the \p dst_interface interface on the \p dst_node CUDAnode. Return 0 on success.\var starpu_data_copy_methods::ram_to_openclDefine how to copy data from the \p src_interface interface on the\p src_node CPU node to the \p dst_interface interface on the \p dst_nodeOpenCL node. Return 0 on success.\var starpu_data_copy_methods::ram_to_micDefine how to copy data from the \p src_interface interface on the\p src_node CPU node to the \p dst_interface interface on the \p dst_node MICnode. Return 0 on success.\var starpu_data_copy_methods::cuda_to_ramDefine how to copy data from the \p src_interface interface on the\p src_node CUDA node to the \p dst_interface interface on the \p dst_nodeCPU node. Return 0 on success.\var starpu_data_copy_methods::cuda_to_cudaDefine how to copy data from the \p src_interface interface on the\p src_node CUDA node to the \p dst_interface interface on the \p dst_node CUDAnode. Return 0 on success.\var starpu_data_copy_methods::cuda_to_openclDefine how to copy data from the \p src_interface interface on the\p src_node CUDA node to the \p dst_interface interface on the \p dst_nodeOpenCL node. Return 0 on success.\var starpu_data_copy_methods::opencl_to_ramDefine how to copy data from the \p src_interface interface on the\p src_node OpenCL node to the \p dst_interface interface on the \p dst_nodeCPU node. Return 0 on success.\var starpu_data_copy_methods::opencl_to_cudaDefine how to copy data from the \p src_interface interface on the\p src_node OpenCL node to the \p dst_interface interface on the \p dst_nodeCUDA node. Return 0 on success.\var starpu_data_copy_methods::opencl_to_openclDefine how to copy data from the \p src_interface interface on the\p src_node OpenCL node to the \p dst_interface interface on the \p dst_nodeOpenCL node. Return 0 on success.\var starpu_data_copy_methods::mic_to_ramDefine how to copy data from the \p src_interface interface on the\p src_node MIC node to the \p dst_interface interface on the \p dst_node CPUnode. Return 0 on success.\var starpu_data_copy_methods::scc_src_to_sinkDefine how to copy data from the \p src_interface interface on the\p src_node node to the \p dst_interface interface on the \p dst_node node.Must return 0 if the transfer was actually completed completelysynchronously, or -EAGAIN if at least some transfers are still ongoingand should be awaited for by the core.\var starpu_data_copy_methods::scc_sink_to_srcDefine how to copy data from the \p src_interface interface on the\p src_node node to the \p dst_interface interface on the \p dst_node node.Must return 0 if the transfer was actually completed completelysynchronously, or -EAGAIN if at least some transfers are still ongoingand should be awaited for by the core.\var starpu_data_copy_methods::scc_sink_to_sinkDefine how to copy data from the \p src_interface interface on the\p src_node node to the \p dst_interface interface on the \p dst_node node.Must return 0 if the transfer was actually completed completelysynchronously, or -EAGAIN if at least some transfers are still ongoingand should be awaited for by the core.\var starpu_data_copy_methods::ram_to_cuda_asyncDefine how to copy data from the \p src_interface interface on the\p src_node CPU node to the \p dst_interface interface on the \p dst_node CUDAnode, using the given stream. Must return 0 if the transfer wasactually completed completely synchronously, or -EAGAIN if at leastsome transfers are still ongoing and should be awaited for by the core.\var starpu_data_copy_methods::cuda_to_ram_asyncDefine how to copy data from the \p src_interface interface on the\p src_node CUDA node to the \p dst_interface interface on the \p dst_node CPUnode, using the given stream. Must return 0 if the transfer wasactually completed completely synchronously, or -EAGAIN if at leastsome transfers are still ongoing and should be awaited for by the core.\var starpu_data_copy_methods::cuda_to_cuda_asyncDefine how to copy data from the \p src_interface interface on the\p src_node CUDA node to the \p dst_interface interface on the \p dst_node CUDAnode, using the given stream. Must return 0 if the transfer wasactually completed completely synchronously, or -EAGAIN if at leastsome transfers are still ongoing and should be awaited for by the core.\var starpu_data_copy_methods::ram_to_opencl_asyncDefine how to copy data from the \p src_interface interface on the\p src_node CPU node to the \p dst_interface interface on the \p dst_nodeOpenCL node, by recording in event, a pointer to a cl_event, the eventof the last submitted transfer. Must return 0 if the transfer wasactually completed completely synchronously, or -EAGAIN if at leastsome transfers are still ongoing and should be awaited for by thecore.\var starpu_data_copy_methods::opencl_to_ram_asyncDefine how to copy data from the \p src_interface interface on the\p src_node OpenCL node to the \p dst_interface interface on the \p dst_nodeCPU node, by recording in event, a pointer to a cl_event, the event ofthe last submitted transfer. Must return 0 if the transfer wasactually completed completely synchronously, or -EAGAIN if at leastsome transfers are still ongoing and should be awaited for by thecore.\var starpu_data_copy_methods::opencl_to_opencl_asyncDefine how to copy data from the \p src_interface interface on the\p src_node OpenCL node to the \p dst_interface interface on the \p dst_nodeOpenCL node, by recording in event, a pointer to a cl_event, the eventof the last submitted transfer. Must return 0 if the transfer wasactually completed completely synchronously, or -EAGAIN if at leastsome transfers are still ongoing and should be awaited for by thecore.\var starpu_data_copy_methods::ram_to_mic_asyncDefine how to copy data from the \p src_interface interface on the\p src_node CPU node to the \p dst_interface interface on the \p dst_nodeMIC node. Must return 0 if the transfer was actually completedcompletely synchronously, or -EAGAIN if at least some transfers arestill ongoing and should be awaited for by the core.\var starpu_data_copy_methods::mic_to_ram_asyncDefine how to copy data from the \p src_interface interface on the\p src_node MIC node to the \p dst_interface interface on the \p dst_nodeCPU node. Must return 0 if the transfer was actually completedcompletely synchronously, or -EAGAIN if at least some transfers arestill ongoing and should be awaited for by the core.\var starpu_data_copy_methods::any_to_anyDefine how to copy data from the \p src_interface interface on the\p src_node node to the \p dst_interface interface on the \p dst_node node.This is meant to be implemented through the starpu_interface_copy()helper, to which async_data should be passed as such, and will be usedto manage asynchronicity. This must return -EAGAIN if any of thestarpu_interface_copy() calls has returned -EAGAIN (i.e. at least sometransfer is still ongoing), and return 0 otherwise.\enum starpu_data_interface_id\ingroup API_Data_InterfacesIdentifier for all predefined StarPU data interfaces\var starpu_data_interface_id::STARPU_UNKNOWN_INTERFACE_IDUnknown interface\var starpu_data_interface_id::STARPU_MATRIX_INTERFACE_IDIdentifier for the matrix data interface\var starpu_data_interface_id::STARPU_BLOCK_INTERFACE_IDIdentifier for block data interface\var starpu_data_interface_id::STARPU_VECTOR_INTERFACE_IDIdentifier for the vector data interface\var starpu_data_interface_id::STARPU_CSR_INTERFACE_IDIdentifier for the csr data interface\var starpu_data_interface_id::STARPU_BCSR_INTERFACE_IDIdentifier for the bcsr data interface\var starpu_data_interface_id::STARPU_VARIABLE_INTERFACE_IDIdentifier for the variable data interface\var starpu_data_interface_id::STARPU_VOID_INTERFACE_IDIdentifier for the void data interface\var starpu_data_interface_id::STARPU_MULTIFORMAT_INTERFACE_IDIdentifier for the multiformat data interface\var starpu_data_interface_id::STARPU_COO_INTERFACE_IDIdentifier for the coo data interface\var starpu_data_interface_id::STARPU_MAX_INTERFACE_IDMaximum number of data interfaces@name Registering Data\ingroup API_Data_InterfacesThere are several ways to register a memory region so that it can bemanaged by StarPU. The functions below allow the registration ofvectors, 2D matrices, 3D matrices as well as BCSR and CSR sparsematrices.\fn void starpu_void_data_register(starpu_data_handle_t *handle)\ingroup API_Data_InterfacesRegister a void interface. There is no data really associatedto that interface, but it may be used as a synchronization mechanism.It also permits to express an abstract piece of data that is managedby the application internally: this makes it possible to forbid theconcurrent execution of different tasks accessing the same <c>void</c> datain read-write concurrently. \fn void starpu_variable_data_register(starpu_data_handle_t *handle, unsigned home_node, uintptr_t ptr, size_t size)\ingroup API_Data_InterfacesRegister the \p size byte element pointed to by \p ptr, which istypically a scalar, and initialize \p handle to represent this data item.Here an example of how to use the function.\code{.c}float var;starpu_data_handle_t var_handle;starpu_variable_data_register(&var_handle, STARPU_MAIN_RAM, (uintptr_t)&var, sizeof(var));\endcode\fn void starpu_vector_data_register(starpu_data_handle_t *handle, unsigned home_node, uintptr_t ptr, uint32_t nx, size_t elemsize)\ingroup API_Data_InterfacesRegister the \p nx elemsize-byte elements pointed to by \p ptr and initialize \p handle to represent it.Here an example of how to use the function.\code{.c}float vector[NX];starpu_data_handle_t vector_handle;starpu_vector_data_register(&vector_handle, STARPU_MAIN_RAM, (uintptr_t)vector, NX, sizeof(vector[0]));\endcode\fn void starpu_matrix_data_register(starpu_data_handle_t *handle, unsigned home_node, uintptr_t ptr, uint32_t ld, uint32_t nx, uint32_t ny, size_t elemsize)\ingroup API_Data_InterfacesRegister the \p nx x \p  ny 2D matrix of \p elemsize-byte elements pointedby \p ptr and initialize \p handle to represent it. \p ld specifies the numberof elements between rows. a value greater than \p nx adds padding, whichcan be useful for alignment purposes.Here an example of how to use the function.\code{.c}float *matrix;starpu_data_handle_t matrix_handle;matrix = (float*)malloc(width * height * sizeof(float));starpu_matrix_data_register(&matrix_handle, STARPU_MAIN_RAM, (uintptr_t)matrix, width, width, height, sizeof(float));\endcode\fn void starpu_block_data_register(starpu_data_handle_t *handle, unsigned home_node, uintptr_t ptr, uint32_t ldy, uint32_t ldz, uint32_t nx, uint32_t ny, uint32_t nz, size_t elemsize)\ingroup API_Data_InterfacesRegister the \p nx x \p ny x \p nz 3D matrix of \p elemsize byte elementspointed by \p ptr and initialize \p handle to represent it. Again, \p ldy and\p ldz specify the number of elements between rows and between z planes.Here an example of how to use the function.\code{.c}float *block;starpu_data_handle_t block_handle;block = (float*)malloc(nx*ny*nz*sizeof(float));starpu_block_data_register(&block_handle, STARPU_MAIN_RAM, (uintptr_t)block, nx, nx*ny, nx, ny, nz, sizeof(float));\endcode\fn void starpu_bcsr_data_register(starpu_data_handle_t *handle, unsigned home_node, uint32_t nnz, uint32_t nrow, uintptr_t nzval, uint32_t *colind, uint32_t *rowptr, uint32_t firstentry, uint32_t r, uint32_t c, size_t elemsize)\ingroup API_Data_InterfacesThis variant of starpu_data_register() uses the BCSR (BlockedCompressed Sparse Row Representation) sparse matrix interface.Register the sparse matrix made of \p nnz non-zero blocks of elements ofsize \p elemsize stored in \p nzval and initializes \p handle to represent it.Blocks have size \p r * \p c. \p nrow is the number of rows (in terms ofblocks), \p colind[i] is the block-column index for block i in \p nzval,\p rowptr[i] is the block-index (in \p nzval) of the first block of row i.\p firstentry is the index of the first entry of the given arrays(usually 0 or 1). \fn void starpu_csr_data_register(starpu_data_handle_t *handle, unsigned home_node, uint32_t nnz, uint32_t nrow, uintptr_t nzval, uint32_t *colind, uint32_t *rowptr, uint32_t firstentry, size_t elemsize)\ingroup API_Data_InterfacesThis variant of starpu_data_register() uses the CSR (CompressedSparse Row Representation) sparse matrix interface. TODO\fn void starpu_coo_data_register(starpu_data_handle_t *handleptr, unsigned home_node, uint32_t nx, uint32_t ny, uint32_t n_values, uint32_t *columns, uint32_t *rows, uintptr_t values, size_t elemsize);\ingroup API_Data_InterfacesRegister the \p nx x \p ny 2D matrix given in the COO format, using the\p columns, \p rows, \p values arrays, which must have \p n_values elements ofsize \p elemsize. Initialize \p handleptr.\fn void *starpu_data_get_interface_on_node(starpu_data_handle_t handle, unsigned memory_node)\ingroup API_Data_InterfacesReturn the interface associated with \p handle on \p memory_node.@name Accessing Data Interfaces\ingroup API_Data_InterfacesEach data interface is provided with a set of field access functions.The ones using a void * parameter aimed to be used in codeletimplementations (see for example the code in \refVectorScalingUsingStarPUAPI).\fn void *starpu_data_handle_to_pointer(starpu_data_handle_t handle, unsigned node)\ingroup API_Data_InterfacesReturn the pointer associated with \p handle on node \p node or <c>NULL</c>if handle’s interface does not support this operation or data for this\p handle is not allocated on that \p node.\fn void *starpu_data_get_local_ptr(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the local pointer associated with \p handle or <c>NULL</c> if\p handle’s interface does not have data allocated locally \fn enum starpu_data_interface_id starpu_data_get_interface_id(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the unique identifier of the interface associated withthe given \p handle.\fn size_t starpu_data_get_size(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the size of the data associated with \p handle.\fn int starpu_data_pack(starpu_data_handle_t handle, void **ptr, starpu_ssize_t *count)\ingroup API_Data_InterfacesExecute the packing operation of the interface of the dataregistered at \p handle (see starpu_data_interface_ops). Thispacking operation must allocate a buffer large enough at \p ptr and copyinto the newly allocated buffer the data associated to \p handle. \p countwill be set to the size of the allocated buffer. If \p ptr is NULL, thefunction should not copy the data in the buffer but just set \p count tothe size of the buffer which would have been allocated. The specialvalue -1 indicates the size is yet unknown.\fn int starpu_data_unpack(starpu_data_handle_t handle, void *ptr, size_t count)\ingroup API_Data_InterfacesUnpack in handle the data located at \p ptr of size \p count asdescribed by the interface of the data. The interface registered at\p handle must define a unpacking operation (seestarpu_data_interface_ops). The memory at the address \p ptr is freedafter calling the data unpacking operation.@name Accessing Variable Data Interfaces\ingroup API_Data_Interfaces\struct starpu_variable_interfaceVariable interface for a single data (not a vector, a matrix, a list, ...)\ingroup API_Data_Interfaces\var starpu_variable_interface::idIdentifier of the interface\var starpu_variable_interface::ptrlocal pointer of the variable\var starpu_variable_interface::dev_handledevice handle of the variable.\var starpu_variable_interface::offsetoffset in the variable\var starpu_variable_interface::elemsizesize of the variable\fn size_t starpu_variable_get_elemsize(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the size of the variable designated by \p handle.\fn uintptr_t starpu_variable_get_local_ptr(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn a pointer to the variable designated by \p handle.\def STARPU_VARIABLE_GET_PTR(interface)\ingroup API_Data_InterfacesReturn a pointer to the variable designated by \p interface.\def STARPU_VARIABLE_GET_ELEMSIZE(interface)\ingroup API_Data_InterfacesReturn the size of the variable designated by \p interface.\def STARPU_VARIABLE_GET_DEV_HANDLE(interface)\ingroup API_Data_InterfacesReturn a device handle for the variable designated by\p interface, to be used on OpenCL. The offset documented below has to beused in addition to this.\def STARPU_VARIABLE_GET_OFFSET(interface)\ingroup API_Data_InterfacesReturn the offset in the variable designated by \p interface, tobe used with the device handle.@name Accessing Vector Data Interfaces\ingroup API_Data_Interfaces\struct starpu_vector_interfaceVector interface\ingroup API_Data_Interfaces\var starpu_vector_interface::idIdentifier of the interface\var starpu_vector_interface::ptrlocal pointer of the vector\var starpu_vector_interface::dev_handledevice handle of the vector.\var starpu_vector_interface::offsetoffset in the vector\var starpu_vector_interface::nxnumber of elements on the x-axis of the vector\var starpu_vector_interface::elemsizesize of the elements of the vector\fn uint32_t starpu_vector_get_nx(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the number of elements registered into the array designated by \p handle.\fn size_t starpu_vector_get_elemsize(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the size of each element of the array designated by \p handle.\fn uintptr_t starpu_vector_get_local_ptr(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the local pointer associated with \p handle.\def STARPU_VECTOR_GET_PTR(interface)\ingroup API_Data_InterfacesReturn a pointer to the array designated by \p interface, valid onCPUs and CUDA only. For OpenCL, the device handle and offset need tobe used instead.\def STARPU_VECTOR_GET_DEV_HANDLE(interface)\ingroup API_Data_InterfacesReturn a device handle for the array designated by \p interface,to be used on OpenCL. the offset documented below has to be used inaddition to this.\def STARPU_VECTOR_GET_OFFSET(interface)\ingroup API_Data_InterfacesReturn the offset in the array designated by \p interface, to beused with the device handle.\def STARPU_VECTOR_GET_NX(interface)\ingroup API_Data_InterfacesReturn the number of elements registered into the arraydesignated by \p interface.\def STARPU_VECTOR_GET_ELEMSIZE(interface)\ingroup API_Data_InterfacesReturn the size of each element of the array designated by\p interface.@name Accessing Matrix Data Interfaces\ingroup API_Data_Interfaces\struct starpu_matrix_interfaceMatrix interface for dense matrices\ingroup API_Data_Interfaces\var starpu_matrix_interface::idIdentifier of the interface\var starpu_matrix_interface::ptrlocal pointer of the matrix\var starpu_matrix_interface::dev_handledevice handle of the matrix.\var starpu_matrix_interface::offsetoffset in the matrix\var starpu_matrix_interface::nxnumber of elements on the x-axis of the matrix\var starpu_matrix_interface::nynumber of elements on the y-axis of the matrix\var starpu_matrix_interface::ldnumber of elements between each row of the matrix. Maybe be equal tostarpu_matrix_interface::nx when there is no padding.\var starpu_matrix_interface::elemsizesize of the elements of the matrix\fn uint32_t starpu_matrix_get_nx(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the number of elements on the x-axis of the matrixdesignated by \p handle.\fn uint32_t starpu_matrix_get_ny(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the number of elements on the y-axis of the matrixdesignated by \p handle.\fn uint32_t starpu_matrix_get_local_ld(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the number of elements between each row of the matrixdesignated by \p handle. Maybe be equal to nx when there is no padding.\fn uintptr_t starpu_matrix_get_local_ptr(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the local pointer associated with \p handle.\fn size_t starpu_matrix_get_elemsize(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the size of the elements registered into the matrixdesignated by \p handle.\def STARPU_MATRIX_GET_PTR(interface)\ingroup API_Data_InterfacesReturn a pointer to the matrix designated by \p interface, validon CPUs and CUDA devices only. For OpenCL devices, the device handleand offset need to be used instead.\def STARPU_MATRIX_GET_DEV_HANDLE(interface)\ingroup API_Data_InterfacesReturn a device handle for the matrix designated by \p interface,to be used on OpenCL. The offset documented below has to be used inaddition to this.\def STARPU_MATRIX_GET_OFFSET(interface)\ingroup API_Data_InterfacesReturn the offset in the matrix designated by \p interface, to beused with the device handle.\def STARPU_MATRIX_GET_NX(interface)\ingroup API_Data_InterfacesReturn the number of elements on the x-axis of the matrixdesignated by \p interface.\def STARPU_MATRIX_GET_NY(interface)\ingroup API_Data_InterfacesReturn the number of elements on the y-axis of the matrixdesignated by \p interface.\def STARPU_MATRIX_GET_LD(interface)\ingroup API_Data_InterfacesReturn the number of elements between each row of the matrixdesignated by \p interface. May be equal to nx when there is no padding.\def STARPU_MATRIX_GET_ELEMSIZE(interface)\ingroup API_Data_InterfacesReturn the size of the elements registered into the matrixdesignated by \p interface.@name Accessing Block Data Interfaces\ingroup API_Data_Interfaces\struct starpu_block_interfaceBlock interface for 3D dense blocks\ingroup API_Data_Interfaces\var starpu_block_interface::ididentifier of the interface\var starpu_block_interface::ptrlocal pointer of the block\var starpu_block_interface::dev_handledevice handle of the block.\var starpu_block_interface::offsetoffset in the block.\var starpu_block_interface::nxnumber of elements on the x-axis of the block.\var starpu_block_interface::nynumber of elements on the y-axis of the block.\var starpu_block_interface::nznumber of elements on the z-axis of the block.\var starpu_block_interface::ldynumber of elements between two lines\var starpu_block_interface::ldznumber of elements between two planes\var starpu_block_interface::elemsizesize of the elements of the block.\fn uint32_t starpu_block_get_nx(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the number of elements on the x-axis of the blockdesignated by \p handle.\fn uint32_t starpu_block_get_ny(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the number of elements on the y-axis of the blockdesignated by \p handle.\fn uint32_t starpu_block_get_nz(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the number of elements on the z-axis of the blockdesignated by \p handle.\fn uint32_t starpu_block_get_local_ldy(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the number of elements between each row of the blockdesignated by \p handle, in the format of the current memory node.\fn uint32_t starpu_block_get_local_ldz(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the number of elements between each z plane of the blockdesignated by \p handle, in the format of the current memory node.\fn uintptr_t starpu_block_get_local_ptr(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the local pointer associated with \p handle.\fn size_t starpu_block_get_elemsize(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the size of the elements of the block designated by\p handle.\def STARPU_BLOCK_GET_PTR(interface)\ingroup API_Data_InterfacesReturn a pointer to the block designated by \p interface.\def STARPU_BLOCK_GET_DEV_HANDLE(interface)\ingroup API_Data_InterfacesReturn a device handle for the block designated by \p interface,to be used on OpenCL. The offset document below has to be used inaddition to this.\def STARPU_BLOCK_GET_OFFSET(interface)\ingroup API_Data_InterfacesReturn the offset in the block designated by \p interface, to beused with the device handle.\def STARPU_BLOCK_GET_NX(interface)\ingroup API_Data_InterfacesReturn the number of elements on the x-axis of the blockdesignated by \p interface.\def STARPU_BLOCK_GET_NY(interface)\ingroup API_Data_InterfacesReturn the number of elements on the y-axis of the blockdesignated by \p interface.\def STARPU_BLOCK_GET_NZ(interface)\ingroup API_Data_InterfacesReturn the number of elements on the z-axis of the blockdesignated by \p interface.\def STARPU_BLOCK_GET_LDY(interface)\ingroup API_Data_InterfacesReturn the number of elements between each row of the blockdesignated by \p interface. May be equal to nx when there is no padding.\def STARPU_BLOCK_GET_LDZ(interface)\ingroup API_Data_InterfacesReturn the number of elements between each z plane of the blockdesignated by \p interface. May be equal to nx*ny when there is nopadding.\def STARPU_BLOCK_GET_ELEMSIZE(interface)\ingroup API_Data_InterfacesReturn the size of the elements of the block designated by\p interface.@name Accessing BCSR Data Interfaces\ingroup API_Data_Interfaces\struct starpu_bcsr_interfaceBCSR interface for sparse matrices (blocked compressed sparserow representation)\ingroup API_Data_Interfaces\var starpu_bcsr_interface::idIdentifier of the interface\var starpu_bcsr_interface::nnznumber of non-zero BLOCKS\var starpu_bcsr_interface::nrownumber of rows (in terms of BLOCKS)\var starpu_bcsr_interface::nzvalnon-zero values\var starpu_bcsr_interface::colindposition of non-zero entried on the row\var starpu_bcsr_interface::rowptrindex (in nzval) of the first entry of the row\var starpu_bcsr_interface::firstentryk for k-based indexing (0 or 1 usually). Also useful when partitionning the matrix.\var starpu_bcsr_interface::rsize of the blocks\var starpu_bcsr_interface::csize of the blocks\var starpu_bcsr_interface::elemsize;size of the elements of the matrix\fn uint32_t starpu_bcsr_get_nnz(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the number of non-zero elements in the matrix designatedby \p handle.\fn uint32_t starpu_bcsr_get_nrow(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the number of rows (in terms of blocks of size r*c) inthe matrix designated by \p handle.\fn uint32_t starpu_bcsr_get_firstentry(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the index at which all arrays (the column indexes, therow pointers...) of the matrix desginated by \p handle.\fn uintptr_t starpu_bcsr_get_local_nzval(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn a pointer to the non-zero values of the matrixdesignated by \p handle.\fn uint32_t *starpu_bcsr_get_local_colind(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn a pointer to the column index, which holds the positionsof the non-zero entries in the matrix designated by \p handle.\fn uint32_t *starpu_bcsr_get_local_rowptr(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the row pointer array of the matrix designated by\p handle.\fn uint32_t starpu_bcsr_get_r(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the number of rows in a block.\fn uint32_t starpu_bcsr_get_c(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the numberof columns in a block.\fn size_t starpu_bcsr_get_elemsize(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the size of the elements in the matrix designated by\p handle.\def STARPU_BCSR_GET_NNZ(interface)\ingroup API_Data_InterfacesReturn the number of non-zero values in the matrix designatedby \p interface.\def STARPU_BCSR_GET_NZVAL(interface)\ingroup API_Data_InterfacesReturn a pointer to the non-zero values of the matrixdesignated by \p interface.\def STARPU_BCSR_GET_NZVAL_DEV_HANDLE(interface)\ingroup API_Data_InterfacesReturn a device handle for the array of non-zero values in thematrix designated by \p interface. The offset documented below has to beused in addition to this.\def STARPU_BCSR_GET_COLIND(interface)\ingroup API_Data_InterfacesReturn a pointer to the column index of the matrix designatedby \p interface.\def STARPU_BCSR_GET_COLIND_DEV_HANDLE(interface)\ingroup API_Data_InterfacesReturn a device handle for the column index of the matrixdesignated by \p interface. The offset documented below has to be used inaddition to this.\def STARPU_BCSR_GET_ROWPTR(interface)\ingroup API_Data_InterfacesReturn a pointer to the row pointer array of the matrixdesignated by \p interface.\def STARPU_BCSR_GET_ROWPTR_DEV_HANDLE(interface)\ingroup API_Data_InterfacesReturn a device handle for the row pointer array of the matrixdesignated by \p interface. The offset documented below has to be used inaddition to this.\def STARPU_BCSR_GET_OFFSET\ingroup API_Data_InterfacesReturn the offset in the arrays (coling, rowptr, nzval) of thematrix designated by \p interface, to be used with the device handles.@name Accessing CSR Data Interfaces\ingroup API_Data_Interfaces\struct starpu_csr_interfaceCSR interface for sparse matrices (compressed sparse row representation)\ingroup API_Data_Interfaces\var starpu_csr_interface::idIdentifier of the interface\var starpu_csr_interface::nnznumber of non-zero entries\var starpu_csr_interface::nrownumber of rows\var starpu_csr_interface::nzvalnon-zero values\var starpu_csr_interface::colindposition of non-zero entries on the row\var starpu_csr_interface::rowptrindex (in nzval) of the first entry of the row\var starpu_csr_interface::firstentryk for k-based indexing (0 or 1 usually). also useful when partitionning the matrix.\var starpu_csr_interface::elemsizesize of the elements of the matrix\fn uint32_t starpu_csr_get_nnz(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the number of non-zero values in the matrix designatedby \p handle.\fn uint32_t starpu_csr_get_nrow(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the size of the row pointer array of the matrixdesignated by \p handle.\fn uint32_t starpu_csr_get_firstentry(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the index at which all arrays (the column indexes, therow pointers...) of the matrix designated by \p handle.\fn uintptr_t starpu_csr_get_local_nzval(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn a local pointer to the non-zero values of the matrixdesignated by \p handle.\fn uint32_t *starpu_csr_get_local_colind(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn a local pointer to the column index of the matrixdesignated by \p handle.\fn uint32_t *starpu_csr_get_local_rowptr(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn a local pointer to the row pointer array of the matrixdesignated by \p handle.\fn size_t starpu_csr_get_elemsize(starpu_data_handle_t handle)\ingroup API_Data_InterfacesReturn the size of the elements registered into the matrixdesignated by \p handle.\def STARPU_CSR_GET_NNZ(interface)\ingroup API_Data_InterfacesReturn the number of non-zero values in the matrix designatedby \p interface.\def STARPU_CSR_GET_NROW(interface)\ingroup API_Data_InterfacesReturn the size of the row pointer array of the matrixdesignated by \p interface.\def STARPU_CSR_GET_NZVAL(interface)\ingroup API_Data_InterfacesReturn a pointer to the non-zero values of the matrixdesignated by \p interface.\def STARPU_CSR_GET_NZVAL_DEV_HANDLE(interface)\ingroup API_Data_InterfacesReturn a device handle for the array of non-zero values in thematrix designated by \p interface. The offset documented below has to beused in addition to this.\def STARPU_CSR_GET_COLIND(interface)\ingroup API_Data_InterfacesReturn a pointer to the column index of the matrix designatedby \p interface.\def STARPU_CSR_GET_COLIND_DEV_HANDLE(interface)\ingroup API_Data_InterfacesReturn a device handle for the column index of the matrixdesignated by \p interface. The offset documented below has to be used inaddition to this.\def STARPU_CSR_GET_ROWPTR(interface)\ingroup API_Data_InterfacesReturn a pointer to the row pointer array of the matrixdesignated by \p interface.\def STARPU_CSR_GET_ROWPTR_DEV_HANDLE(interface)\ingroup API_Data_InterfacesReturn a device handle for the row pointer array of the matrixdesignated by \p interface. The offset documented below has to be used inaddition to this.\def STARPU_CSR_GET_OFFSET\ingroup API_Data_InterfacesReturn the offset in the arrays (colind, rowptr, nzval) of thematrix designated by \p interface, to be used with the device handles.\def STARPU_CSR_GET_FIRSTENTRY(interface)\ingroup API_Data_InterfacesReturn the index at which all arrays (the column indexes, therow pointers...) of the \p interface start.\def STARPU_CSR_GET_ELEMSIZE(interface)\ingroup API_Data_InterfacesReturn the size of the elements registered into the matrixdesignated by \p interface.@name Accessing COO Data Interfaces\ingroup API_Data_Interfaces\struct starpu_coo_interfaceCOO Matrices\ingroup API_Data_Interfaces\var starpu_coo_interface::ididentifier of the interface\var starpu_coo_interface::columnscolumn array of the matrix\var starpu_coo_interface::rowsrow array of the matrix\var starpu_coo_interface::valuesvalues of the matrix\var starpu_coo_interface::nxnumber of elements on the x-axis of the matrix\var starpu_coo_interface::nynumber of elements on the y-axis of the matrix\var starpu_coo_interface::n_valuesnumber of values registered in the matrix\var starpu_coo_interface::elemsizesize of the elements of the matrix\def STARPU_COO_GET_COLUMNS(interface)\ingroup API_Data_InterfacesReturn a pointer to the column array of the matrix designatedby \p interface.\def STARPU_COO_GET_COLUMNS_DEV_HANDLE(interface)\ingroup API_Data_InterfacesReturn a device handle for the column array of the matrixdesignated by \p interface, to be used on OpenCL. The offset documentedbelow has to be used in addition to this.\def STARPU_COO_GET_ROWS(interface)\ingroup API_Data_InterfacesReturn a pointer to the rows array of the matrix designated by\p interface.\def STARPU_COO_GET_ROWS_DEV_HANDLE(interface)\ingroup API_Data_InterfacesReturn a device handle for the row array of the matrixdesignated by \p interface, to be used on OpenCL. The offset documentedbelow has to be used in addition to this.\def STARPU_COO_GET_VALUES(interface)\ingroup API_Data_InterfacesReturn a pointer to the values array of the matrix designatedby \p interface.\def STARPU_COO_GET_VALUES_DEV_HANDLE(interface)\ingroup API_Data_InterfacesReturn a device handle for the value array of the matrixdesignated by \p interface, to be used on OpenCL. The offset documentedbelow has to be used in addition to this.\def STARPU_COO_GET_OFFSET\ingroup API_Data_InterfacesReturn the offset in the arrays of the COO matrix designated by\p interface.\def STARPU_COO_GET_NX(interface)\ingroup API_Data_InterfacesReturn the number of elements on the x-axis of the matrixdesignated by \p interface.\def STARPU_COO_GET_NY(interface)\ingroup API_Data_InterfacesReturn the number of elements on the y-axis of the matrixdesignated by \p interface.\def STARPU_COO_GET_NVALUES(interface)\ingroup API_Data_InterfacesReturn the number of values registered in the matrix designatedby \p interface.\def STARPU_COO_GET_ELEMSIZE(interface)\ingroup API_Data_InterfacesReturn the size of the elements registered into the matrixdesignated by \p interface.@name Defining Interface\ingroup API_Data_InterfacesApplications can provide their own interface as shown in \refDefiningANewDataInterface.\fn uintptr_t starpu_malloc_on_node(unsigned dst_node, size_t size)\ingroup API_Data_InterfacesAllocate \p size bytes on node \p dst_node. This returns 0 ifallocation failed, the allocation method should then return <c>-ENOMEM</c> asallocated size.\fn void starpu_free_on_node(unsigned dst_node, uintptr_t addr, size_t size)\ingroup API_Data_InterfacesFree \p addr of \p size bytes on node \p dst_node.\fn int starpu_interface_copy(uintptr_t src, size_t src_offset, unsigned src_node, uintptr_t dst, size_t dst_offset, unsigned dst_node, size_t size, void *async_data)\ingroup API_Data_InterfacesCopy \p size bytes from byte offset \p src_offset of \p src on \p src_nodeto byte offset \p dst_offset of \p dst on \p dst_node. This is to be used inthe any_to_any() copy method, which is provided with the async_data tobe passed to starpu_interface_copy(). this returns <c>-EAGAIN</c> if thetransfer is still ongoing, or 0 if the transfer is already completed.\fn uint32_t starpu_hash_crc32c_be_n(const void *input, size_t n, uint32_t inputcrc)\ingroup API_Data_InterfacesCompute the CRC of a byte buffer seeded by the \p inputcrc<em>current state</em>. The return value should be considered as the new<em>current state</em> for future CRC computation. This is used for computingdata size footprint.\fn uint32_t starpu_hash_crc32c_be(uint32_t input, uint32_t inputcrc)\ingroup API_Data_InterfacesCompute the CRC of a 32bit number seeded by the \p inputcrc<em>current state</em>. The return value should be considered as the new<em>current state</em> for future CRC computation. This is used for computingdata size footprint.\fn uint32_t starpu_hash_crc32c_string(const char *str, uint32_t inputcrc)\ingroup API_Data_InterfacesCompute the CRC of a string seeded by the \p inputcrc <em>currentstate</em>. The return value should be considered as the new <em>currentstate</em> for future CRC computation. This is used for computing datasize footprint.\fn int starpu_data_interface_get_next_id(void)\ingroup API_Data_InterfacesReturn the next available id for a newly created data interface(\ref DefiningANewDataInterface).*/
 |