From 219a91cdbd74eff28ed50e7580182ab4eb19d5cf Mon Sep 17 00:00:00 2001 From: Hui Zhou Date: Fri, 15 Jan 2021 11:22:03 -0600 Subject: [PATCH] typerep/yaksa: remove nolonger used fastpath_memcpy The checking of pointer attributes and datatype now is done in the main code. --- .../datatype/typerep/src/typerep_yaksa_pack.c | 59 ------------------- 1 file changed, 59 deletions(-) diff --git a/src/mpi/datatype/typerep/src/typerep_yaksa_pack.c b/src/mpi/datatype/typerep/src/typerep_yaksa_pack.c index 81a1c935a81..794beb123df 100644 --- a/src/mpi/datatype/typerep/src/typerep_yaksa_pack.c +++ b/src/mpi/datatype/typerep/src/typerep_yaksa_pack.c @@ -57,65 +57,6 @@ typedef enum { MEMCPY_DIR__UNPACK, } memcpy_dir_e; -static inline bool fastpath_memcpy(const void *inbuf, void *outbuf, MPI_Datatype type, - MPI_Aint count, MPI_Aint offset, MPI_Aint max_bytes, - MPI_Aint * actual_bytes, memcpy_dir_e dir) -{ - bool ret = false; - - /* special case builtin types, over other contiguous types, to - * avoid the three pointer dereferences (for is_contig, size and - * true_lb) into the MPIR_Datatype structure */ - if (HANDLE_IS_BUILTIN(type)) { - MPL_pointer_attr_t inattr, outattr; - MPIR_GPU_query_pointer_attr(inbuf, &inattr); - MPIR_GPU_query_pointer_attr(outbuf, &outattr); - - if ((inattr.type == MPL_GPU_POINTER_UNREGISTERED_HOST || - inattr.type == MPL_GPU_POINTER_REGISTERED_HOST) && - (outattr.type == MPL_GPU_POINTER_UNREGISTERED_HOST || - outattr.type == MPL_GPU_POINTER_REGISTERED_HOST)) { - MPI_Aint size = MPIR_Datatype_get_basic_size(type); - *actual_bytes = MPL_MIN(count * size - offset, max_bytes); - if (dir == MEMCPY_DIR__PACK) - MPIR_Memcpy(outbuf, (const char *) inbuf + offset, *actual_bytes); - else - MPIR_Memcpy((char *) outbuf + offset, inbuf, *actual_bytes); - ret = true; - } - } else { - MPIR_Datatype *dtp; - MPIR_Datatype_get_ptr(type, dtp); - - if (dtp->is_contig) { - MPL_pointer_attr_t inattr, outattr; - - if (dir == MEMCPY_DIR__PACK) { - MPIR_GPU_query_pointer_attr((const char *) inbuf + dtp->true_lb + offset, &inattr); - MPIR_GPU_query_pointer_attr(outbuf, &outattr); - } else { - MPIR_GPU_query_pointer_attr(inbuf, &inattr); - MPIR_GPU_query_pointer_attr((char *) outbuf + dtp->true_lb + offset, &outattr); - } - - if ((inattr.type == MPL_GPU_POINTER_UNREGISTERED_HOST || - inattr.type == MPL_GPU_POINTER_REGISTERED_HOST) && - (outattr.type == MPL_GPU_POINTER_UNREGISTERED_HOST || - outattr.type == MPL_GPU_POINTER_REGISTERED_HOST)) { - *actual_bytes = MPL_MIN(count * dtp->size - offset, max_bytes); - if (dir == MEMCPY_DIR__PACK) - MPIR_Memcpy(outbuf, (const char *) inbuf + dtp->true_lb + offset, - *actual_bytes); - else - MPIR_Memcpy((char *) outbuf + dtp->true_lb + offset, inbuf, *actual_bytes); - ret = true; - } - } - } - - return ret; -} - int MPIR_Typerep_pack(const void *inbuf, MPI_Aint incount, MPI_Datatype datatype, MPI_Aint inoffset, void *outbuf, MPI_Aint max_pack_bytes, MPI_Aint * actual_pack_bytes)