#ifndef MOC_DATA_TRANSFER_SPU_H_ #define MOC_DATA_TRANSFER_SPU_H_ #include #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_*/