Initial commit.
This commit is contained in:
Executable
+48
@@ -0,0 +1,48 @@
|
||||
#ifndef MOC_H_SPU
|
||||
#define MOC_H_SPU
|
||||
|
||||
|
||||
#include "moc_dma_spu.h"
|
||||
#include "moc_datatype_spu.h"
|
||||
#include "../moc.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \addtogroup environment_startup
|
||||
**/
|
||||
//@{
|
||||
/**
|
||||
* @name SPU-only
|
||||
**/
|
||||
//@{
|
||||
|
||||
/**
|
||||
* Initialize the MPI execution environment.
|
||||
*
|
||||
* \anchor moc_init_spu
|
||||
*
|
||||
* \attention SPU-only function
|
||||
*
|
||||
* \note All processes must call this routine before executing any MOC-routine.
|
||||
*
|
||||
* \todo Copying of user-defined information from main-memory to local buffer not implemented
|
||||
*
|
||||
* \param argp \b in Pointer to user-defined information in the main-memory
|
||||
* \param length \b in Length of the user-defined information in bytes
|
||||
* \param buffer \b out Buffer into which the user-defined information should be copied
|
||||
* \retval MOC_SUCCESS No error; MPI routine completed successfully.
|
||||
* \retval MOC_ERR_NO_MEMORY Insufficient Memory.
|
||||
* \retval MOC_ERR_INTERN Internal Error
|
||||
**/
|
||||
int MOC_Init (unsigned long long argp, int length, void* buffer);
|
||||
|
||||
//@}
|
||||
//@}
|
||||
|
||||
|
||||
|
||||
#endif /*MOC_H_*/
|
||||
|
||||
Executable
+60
@@ -0,0 +1,60 @@
|
||||
#ifndef MOC_DATATYPE_SPU_H_
|
||||
#define MOC_DATATYPE_SPU_H_
|
||||
|
||||
#include "../moc_datatype.h"
|
||||
/**
|
||||
* \addtogroup p2p_datatype
|
||||
**/
|
||||
//@{
|
||||
/**
|
||||
* @name SPU-only
|
||||
**/
|
||||
//@{
|
||||
|
||||
|
||||
/**
|
||||
* C-Datatype long.
|
||||
* It has a size of 4 byte.
|
||||
* \attention On the PPU long has a size of 8 byte. So if
|
||||
* you are trying to send data of type long from the PPU to a
|
||||
* SPU or vice versa there will be an error.
|
||||
**/
|
||||
#define MOC_LONG ((MOC_Datatype)32+2)
|
||||
|
||||
/**
|
||||
* C-Datatype unsigned long.
|
||||
* It has a size of 4 byte.
|
||||
* \attention On the SPU unsigned long has a size of 8 byte. So if
|
||||
* you are trying to send data of type long from the PPU to a
|
||||
* SPU or vice versa there will be an error.
|
||||
**/
|
||||
#define MOC_UNSIGNED_LONG ((MOC_Datatype)32+3)
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Cell-specific Datatype vector unsigned long long (vec_ullong2).
|
||||
* It has a size of 16 byte.
|
||||
* \note SPU-only. Is mapped to the PPU-Datatype vector bool char.
|
||||
**/
|
||||
#define MOC_VEC_ULLONG2 ((MOC_Datatype)128+0)
|
||||
|
||||
/**
|
||||
* Cell-specific Datatype vector signed long long (vec_llong2).
|
||||
* It has a size of 16 byte.
|
||||
* \note SPU-only. Is mapped to the PPU-Datatype vector bool short.
|
||||
**/
|
||||
#define MOC_VEC_LLONG2 ((MOC_Datatype)128+1)
|
||||
|
||||
/**
|
||||
* Cell-specific Datatype vector double (vec_double2).
|
||||
* It has a size of 16 byte.
|
||||
* \note SPU-only. Is mapped to the PPU-Datatype vector bool int.
|
||||
**/
|
||||
#define MOC_VEC_DOUBLE2 ((MOC_Datatype)128+2)
|
||||
|
||||
|
||||
|
||||
//@}
|
||||
//@}
|
||||
#endif /*MOC_DATATYPE_SPU_H_*/
|
||||
Executable
+117
@@ -0,0 +1,117 @@
|
||||
#ifndef MOC_DATA_TRANSFER_SPU_H_
|
||||
#define MOC_DATA_TRANSFER_SPU_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include "moc_datatype_spu.h"
|
||||
#include "../moc.h"
|
||||
|
||||
/**
|
||||
* \addtogroup dma_access
|
||||
**/
|
||||
//@{
|
||||
/**
|
||||
* @name SPU-only
|
||||
**/
|
||||
//@{
|
||||
|
||||
|
||||
/**
|
||||
* Wrapper-function for a blocking DMA-get operation.
|
||||
* Data can be of any size, constraints of low-level DMA-functions
|
||||
* are dealt by this function.
|
||||
* However data-addresses have to be at least 16-byte aligned.
|
||||
*
|
||||
* @param target \b out pointer to buffer
|
||||
* @param source \b in ea-address of data
|
||||
* @param count \b in size of data in byte
|
||||
* @param datatype \b in Type of Elements
|
||||
* @retval MOC_SUCCESS No error; MPI routine completed successfully.
|
||||
* @retval ... error-code
|
||||
**/
|
||||
int MOC_Get_data(void* target, uint64_t source, int count,
|
||||
MOC_Datatype datatype);
|
||||
|
||||
/**
|
||||
* Wrapper-function for a blocking DMA-put operation.
|
||||
* Data-size should be a multiple of 16 because of low-level constraints, but
|
||||
* there is no upper limit of transfer-size.
|
||||
* Data-addresses have to be at least 16-byte aligned.
|
||||
*
|
||||
* @param source \b in pointer to data
|
||||
* @param target \b in ea-address of buffer
|
||||
* @param count \b in size of data in byte
|
||||
* @param datatype \b in Type of Elements
|
||||
* @retval MOC_SUCCESS No error; MPI routine completed successfully.
|
||||
* @retval ... error-code
|
||||
**/
|
||||
int MOC_Put_data(void* source, uint64_t target, int count,
|
||||
MOC_Datatype datatype);
|
||||
|
||||
/**
|
||||
* Wrapper-function for a non-blocking DMA-get operation.
|
||||
* Data can be of any size, constraints of low-level DMA-functions
|
||||
* are dealt by this function.
|
||||
* However data-addresses have to be at least 16-byte aligned.
|
||||
* Operation-completion can be derived with MOC_Test and MOC_Wait.
|
||||
*
|
||||
* @param target \b out pointer to buffer
|
||||
* @param source \b in ea-address of data
|
||||
* @param count \b in size of data in byte
|
||||
* @param datatype \b in Type of Elements
|
||||
* @param request \b out communication request (handle)
|
||||
* @retval MOC_SUCCESS No error; MPI routine completed successfully.
|
||||
* @retval ... error-code
|
||||
**/
|
||||
int MOC_IGet_data(void* target, uint64_t source, int count,
|
||||
MOC_Datatype datatype, MOC_Request *request);
|
||||
|
||||
/**
|
||||
* Wrapper-function for a non-blocking DMA-put operation.
|
||||
* Data-size should be a multiple of 16 because of low-level constraints, but
|
||||
* there is no upper limit of transfer-size.
|
||||
* Data-addresses have to be at least 16-byte aligned.
|
||||
* Operation-completion can be derived with MOC_Test and MOC_Wait.
|
||||
*
|
||||
* @param source \b in pointer to data
|
||||
* @param target \b in ea-address of buffer
|
||||
* @param count \b in size of data in byte
|
||||
* @param datatype \b in Type of Elements
|
||||
* @param request \b out communication request (handle)
|
||||
* @retval MOC_SUCCESS No error; MPI routine completed successfully.
|
||||
* @retval ... error-code
|
||||
**/
|
||||
int MOC_IPut_data(void* source, uint64_t target, int count,
|
||||
MOC_Datatype datatype, MOC_Request *request);
|
||||
|
||||
/**
|
||||
* Translates a local-store address of the calling SPU into the corresponding
|
||||
* effective-address.
|
||||
*
|
||||
* @param ls \b in local-store address
|
||||
* @param ea \b out effective-address
|
||||
**/
|
||||
int MOC_Translate_LS_to_EA(void* ls, uint64_t* ea);
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
/**
|
||||
* Tests if a MOC_IGet_data or IMOC_IPut_data is completed.
|
||||
*
|
||||
* @param request \b in request-handle
|
||||
* @param flag \b out true if operation is completed
|
||||
* @return 0 when success otherwise error-code
|
||||
**/
|
||||
int MOC_Test_data(MOC_Request* request, int *flag);
|
||||
|
||||
/**
|
||||
* Waits till a MOC_IGet_data or IMOC_IPut_data is completed.
|
||||
*
|
||||
* @param request \b in request-handle
|
||||
* @return 0 when success otherwise error-code
|
||||
**/
|
||||
int MOC_Wait_data(MOC_Request* request);
|
||||
|
||||
//@}
|
||||
#endif /*MOC_DATA_TRANSFER_SPU_H_*/
|
||||
|
||||
Reference in New Issue
Block a user