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