remove warning from MSVC need another round of check

This commit is contained in:
Tianqi Chen
2014-11-23 20:52:13 -08:00
parent b55fe80350
commit 2e444f8338
12 changed files with 32 additions and 28 deletions

View File

@@ -49,7 +49,7 @@ void Finalize(void);
* \param op reduction function
*/
template<typename DType>
void AllReduce(DType *sendrecvbuf, int count, ReduceOp op);
void AllReduce(DType *sendrecvbuf, size_t count, ReduceOp op);
/*!
* \brief broadcast an std::string to all others from root

View File

@@ -33,7 +33,7 @@ void Finalize(void) {
MPI::Finalize();
}
void AllReduce_(void *sendrecvbuf, int count, const MPI::Datatype &dtype, ReduceOp op) {
void AllReduce_(void *sendrecvbuf, size_t count, const MPI::Datatype &dtype, ReduceOp op) {
switch(op) {
case kBitwiseOR: MPI::COMM_WORLD.Allreduce(MPI_IN_PLACE, sendrecvbuf, count, dtype, MPI::BOR); return;
case kSum: MPI::COMM_WORLD.Allreduce(MPI_IN_PLACE, sendrecvbuf, count, dtype, MPI::SUM); return;
@@ -42,12 +42,12 @@ void AllReduce_(void *sendrecvbuf, int count, const MPI::Datatype &dtype, Reduce
}
template<>
void AllReduce<uint32_t>(uint32_t *sendrecvbuf, int count, ReduceOp op) {
void AllReduce<uint32_t>(uint32_t *sendrecvbuf, size_t count, ReduceOp op) {
AllReduce_(sendrecvbuf, count, MPI::UNSIGNED, op);
}
template<>
void AllReduce<float>(float *sendrecvbuf, int count, ReduceOp op) {
void AllReduce<float>(float *sendrecvbuf, size_t count, ReduceOp op) {
AllReduce_(sendrecvbuf, count, MPI::FLOAT, op);
}

View File

@@ -483,7 +483,7 @@ inline void ReduceBitOR(const void *src_, void *dst_, int len, const MPI::Dataty
}
template<>
void AllReduce<uint32_t>(uint32_t *sendrecvbuf, int count, ReduceOp op) {
void AllReduce<uint32_t>(uint32_t *sendrecvbuf, size_t count, ReduceOp op) {
typedef uint32_t DType;
switch(op) {
case kBitwiseOR: manager.AllReduce(sendrecvbuf, sizeof(DType), count, ReduceBitOR<DType>); return;
@@ -494,7 +494,7 @@ void AllReduce<uint32_t>(uint32_t *sendrecvbuf, int count, ReduceOp op) {
}
template<>
void AllReduce<float>(float *sendrecvbuf, int count, ReduceOp op) {
void AllReduce<float>(float *sendrecvbuf, size_t count, ReduceOp op) {
typedef float DType;
switch(op) {
case kSum: manager.AllReduce(sendrecvbuf, sizeof(DType), count, ReduceSum<DType>); return;