60 #ifndef _HPP_MCBSP_TEMPLATES
61 #define _HPP_MCBSP_TEMPLATES
96 template<
typename T >
98 bsp_push_reg( static_cast< void * >(address), size *
sizeof( T ) );
134 template<
typename T >
184 template<
typename T >
186 T *
const destination,
const size_t offset = 0,
const size_t size = 1 ) {
187 bsp_put( pid, source, static_cast< const void * >(destination), offset *
sizeof(T), size *
sizeof(T) );
237 template<
typename T >
239 const size_t offset,
void *
const destination,
const size_t size = 1 ) {
240 bsp_get( pid, static_cast< const void * >(source), offset *
sizeof(T), destination, size *
sizeof(T) );
293 template<
typename T >
296 bsp_direct_get( pid, static_cast< const void * >(source), offset *
sizeof(T), destination, size *
sizeof(T) );
317 template<
typename T >
319 const T *
const payload,
const size_t size = 1 ) {
320 bsp_send( pid, tag, static_cast< const void * >(payload), size *
sizeof(T) );
323 #ifdef MCBSP_ENABLE_HP_DIRECTIVES
376 template<
typename T >
378 const T *
const payload,
const size_t size = 1 ) {
379 bsp_hpsend( pid, tag, static_cast< const void * >(payload), size *
sizeof(T) );
381 #endif //MCBSP_ENABLE_HP_DIRECTIVES
417 template<
typename T >
418 void bsp_move( T *
const payload,
const size_t max_copy_size = 1 ) {
419 bsp_move( static_cast< void * >(payload), max_copy_size *
sizeof(T) );
429 #if defined ENABLE_FAKE_HP_DIRECTIVES || defined MCBSP_ENABLE_HP_DIRECTIVES
488 template<
typename T >
490 const T *
const destination,
const size_t offset = 0,
const size_t size = 1 ) {
491 bsp_hpput( pid, source, static_cast< const void * >(destination), offset *
sizeof(T), size *
sizeof(T) );
558 template<
typename T >
560 const size_t offset,
void *
const destination,
const size_t size ) {
561 bsp_hpget( pid, static_cast< void * >(source), offset *
sizeof(T), destination, size *
sizeof(T) );
564 #endif //ENABLE_FAKE_HP_DIRECTIVES
void bsp_direct_get(const bsp_pid_t pid, const T *const source, const bsp_size_t offset, void *const destination, const bsp_size_t size=1)
Get data from a remote memory location.
Definition: mcbsp-templates.hpp:294
void bsp_send(const bsp_pid_t pid, const void *const tag, const T *const payload, const size_t size=1)
Sends a message to a remote thread.
Definition: mcbsp-templates.hpp:318
void bsp_get(const bsp_pid_t pid, const T *const source, const size_t offset, void *const destination, const size_t size=1)
Get data from a remote memory location.
Definition: mcbsp-templates.hpp:238
bsp_pid_t MCBSP_FUNCTION_PREFIX() pid(void)
void bsp_put(const bsp_pid_t pid, const void *const source, T *const destination, const size_t offset=0, const size_t size=1)
Put data in a remote memory location.
Definition: mcbsp-templates.hpp:185
void bsp_move(T *const payload, const size_t max_copy_size=1)
Retrieves the payload from the first message in the queue of incoming messages, and removes that mess...
Definition: mcbsp-templates.hpp:418
bsp_size_t bsp_set_tagsize(const T &tag_type=T())
Sets the tag size of inter-thread messages.
Definition: mcbsp-templates.hpp:135
void bsp_hpget(const bsp_pid_t pid, const T *const source, const size_t offset, void *const destination, const size_t size)
Get data from a remote memory location.
Definition: mcbsp-templates.hpp:559
void bsp_hpput(const bsp_pid_t pid, const void *const source, const T *const destination, const size_t offset=0, const size_t size=1)
Put data in a remote memory location.
Definition: mcbsp-templates.hpp:489
size_t bsp_size_t
Data type used to refer to memory region sizes.
Definition: bsp.h:256
void bsp_push_reg(T *const address, const size_t size=1)
Registers a memory area for communication.
Definition: mcbsp-templates.hpp:97
unsigned int bsp_pid_t
Data type used for thread IDs.
Definition: bsp.h:252
void bsp_hpsend(const bsp_pid_t pid, const void *const tag, const T *const payload, const size_t size=1)
This is a non-buffering and non-blocking send request.
Definition: mcbsp-templates.hpp:377