00001 #ifndef MOC_DATA_TRANSFER_PPU_H_ 00002 #define MOC_DATA_TRANSFER_PPU_H_ 00003 00004 #include <stdint.h> 00005 #include "../moc.h" 00006 #include "moc_datatype_ppu.h" 00007 00008 /** 00009 * \addtogroup dma_access 00010 **/ 00011 //@{ 00012 /** 00013 * @name PPU-only 00014 **/ 00015 //@{ 00016 00017 00018 /** 00019 * Wrapper-function for a blocking DMA-get operation. 00020 * Data can be of any size, constraints of low-level DMA-functions 00021 * are dealt by this function. 00022 * However data-addresses have to be at least 16-byte aligned. 00023 * 00024 * @param target \b out pointer to buffer 00025 * @param source \b in local-store address of data 00026 * @param count \b in size of data in byte 00027 * @param datatype \b in Type of Elements 00028 * @param dest \b in rank of source spe 00029 * @retval MOC_SUCCESS No error; MPI routine completed successfully. 00030 * @retval ... error-code 00031 **/ 00032 int MOC_Get_data(void* target, uint32_t source, int count, 00033 MOC_Datatype datatype, int dest); 00034 00035 /** 00036 * Wrapper-function for a blocking DMA-put operation. 00037 * Data-size should be a multiple of 16 because of low-level constraints, but 00038 * there is no upper limit of transfer-size. 00039 * Data-addresses have to be at least 16-byte aligned. 00040 * 00041 * @param source \b in pointer to data 00042 * @param target \b in local-store address of buffer 00043 * @param count \b in size of data in byte 00044 * @param datatype \b in Type of Elements 00045 * @param src \b in rank of source-SPE 00046 * @retval MOC_SUCCESS No error; MPI routine completed successfully. 00047 * @retval ... error-code 00048 **/ 00049 int MOC_Put_data(void* source, uint32_t target, int count, 00050 MOC_Datatype datatype, int src); 00051 00052 /** 00053 * Wrapper-function for a non-blocking DMA-get operation. 00054 * Data can be of any size, constraints of low-level DMA-functions 00055 * are dealt by this function. 00056 * However data-addresses have to be at least 16-byte aligned. 00057 * Operation-completion can be derived with MOC_Test and MOC_Wait. 00058 * 00059 * @param target \b out pointer to buffer 00060 * @param source \b in local-store address of data 00061 * @param count \b in size of data in byte 00062 * @param datatype \b in Type of Elements 00063 * @param dest \b in rank of source spe 00064 * @param request \b out communication request (handle) 00065 * @retval MOC_SUCCESS No error; MPI routine completed successfully. 00066 * @retval ... error-code 00067 **/ 00068 int MOC_IGet_data(void* target, uint32_t source, int count, 00069 MOC_Datatype datatype, int dest, MOC_Request *request); 00070 00071 /** 00072 * Wrapper-function for a non-blocking DMA-put operation. 00073 * Data-size should be a multiple of 16 because of low-level constraints, but 00074 * there is no upper limit of transfer-size. 00075 * Data-addresses have to be at least 16-byte aligned. 00076 * Operation-completion can be derived with MOC_Test and MOC_Wait. 00077 * 00078 * @param source \b in pointer to data 00079 * @param target \b in local-store address of buffer 00080 * @param count \b in size of data in byte 00081 * @param datatype \b in Type of Elements 00082 * @param src \b in rank of source-SPE 00083 * @param request \b out communication request (handle) 00084 * @retval MOC_SUCCESS No error; MPI routine completed successfully. 00085 * @retval ... error-code 00086 **/ 00087 int MOC_IPut_data(void* source, uint32_t target, int count, 00088 MOC_Datatype datatype, int src, MOC_Request *request); 00089 00090 /** 00091 * Translates an effective-address of a SPU into the corresponding local-store address. 00092 * 00093 * @param ea \b in effective-address 00094 * @param rank \b in rank of SPU 00095 * @param ls \b out local-store address 00096 **/ 00097 int MOC_Translate_EA_to_LS(uint64_t ea, int rank, uint32_t* ls); 00098 00099 //@} 00100 00101 /** 00102 * Waits till a MOC_IGet_data or IMOC_IPut_data is completed. 00103 * 00104 * @param request \b in request-handle 00105 * @return 0 when success otherwise error-code 00106 **/ 00107 int MOC_Wait_data(MOC_Request* request); 00108 00109 /** 00110 * Tests if a MOC_IGet_data or IMOC_IPut_data is completed. 00111 * 00112 * @param request \b in request-handle 00113 * @param flag \b out true if operation is completed 00114 * @return 0 when success otherwise error-code 00115 **/ 00116 int MOC_Test_data(MOC_Request* request, int *flag); 00117 00118 //@} 00119 #endif /*MOC_DATA_TRANSFER_PPU_H_*/
1.5.6