1
1
openmpi/opal/mca/memcpy/base/memcpy_base_default.h
George Bosilca d311d8acf1 The memcpy framework. The base component is here, but right now no
implementations. I dont want to overload the memcpy functions,
therefore people interested in using the high performance memcpy
should use directly opal_memcpy instead. Notice, that there are 2
other versions of memcpy available, which use a destination or a source
described as iovecs.

This commit was SVN r9532.
2006-04-05 05:56:08 +00:00

43 строки
1.6 KiB
C

/*
* Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef OPAL_MCA_MEMCPY_BASE_MEMCPY_BASE_NULL_H
#define OPAL_MCA_MEMCPY_BASE_MEMCPY_BASE_NULL_H
#define opal_memcpy( dst, src, length ) \
memcpy( (dst), (src), (length) );
#define opal_memcpy_tov( dst_iov, src, count ) \
do { \
int _i; \
char* _src = (char*)src; \
\
for( _i = 0; _i < count; _i++ ) { \
opal_memcpy( dst_iov[_i].iov_base, _src, \
dst_iov[_i].iov_len ); \
_src += dst_iov[_i].iov_len; \
} \
} while (0)
#define opal_memcpy_fromv( dst, src_iov, count ) \
do { \
int _i; \
char* _dst = (char*)dst; \
\
for( _i = 0; _i < count; _i++ ) { \
opal_memcpy( _dst, src_iov[_i].iov_base, \
src_iov[_i].iov_len ); \
_dst += src_iov[_i].iov_len; \
} \
} while (0)
#endif