libxmp/libxmpf in Omni Compiler
1.3.4
|
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
#include "xmp.h"
#include "xmp_internal.h"
#include "xmp_math_function.h"
|
void | xmpc_gmv_g_alloc_acc (_XMP_gmv_desc_t **gmv_desc, _XMP_array_t *ap, void *dev_addr) |
|
void | xmpc_gmv_l_alloc_acc (_XMP_gmv_desc_t **gmv_desc, void *local_data, int n) |
|
void | _XMP_gmove_array_array_common_acc (_XMP_gmv_desc_t *gmv_desc_leftp, _XMP_gmv_desc_t *gmv_desc_rightp, int *dst_l, int *dst_u, int *dst_s, unsigned long long *dst_d, int *src_l, int *src_u, int *src_s, unsigned long long *src_d, int mode) |
|
void | _XMP_gmove_garray_garray_acc (_XMP_gmv_desc_t *gmv_desc_leftp, _XMP_gmv_desc_t *gmv_desc_rightp, int mode) |
|
void | xmpc_gmv_do_acc (_XMP_gmv_desc_t *gmv_desc_leftp, _XMP_gmv_desc_t *gmv_desc_rightp, int mode) |
|
◆ _XACC_MAX_NUM_SENDRECVS
#define _XACC_MAX_NUM_SENDRECVS 4 |
◆ _XACC_NUM_COMM_CACHES
#define _XACC_NUM_COMM_CACHES 4 |
◆ _XACC_gmv_comm_t
◆ _XACC_sendrecv_comm_t
◆ _XMP_gmove_array_array_common_acc()
void _XMP_gmove_array_array_common_acc |
( |
_XMP_gmv_desc_t * |
gmv_desc_leftp, |
|
|
_XMP_gmv_desc_t * |
gmv_desc_rightp, |
|
|
int * |
dst_l, |
|
|
int * |
dst_u, |
|
|
int * |
dst_s, |
|
|
unsigned long long * |
dst_d, |
|
|
int * |
src_l, |
|
|
int * |
src_u, |
|
|
int * |
src_s, |
|
|
unsigned long long * |
src_d, |
|
|
int |
mode |
|
) |
| |
630 if (_XMP_gmove_garray_garray_acc_opt(gmv_desc_leftp, gmv_desc_rightp,
631 dst_l, dst_u, dst_s, dst_d,
632 src_l, src_u, src_s, src_d))
return;
637 _XMP_fatal(
"_XMP_gmove_1to1 for acc is not implemented");
◆ _XMP_gmove_garray_garray_acc()
658 _XACC_gmv_comm_t *gmv_comm = find_gmv_comm(gmv_desc_leftp, gmv_desc_rightp);
659 if(gmv_comm != NULL){
661 exec_gmv_comm(gmv_comm);
671 unsigned long long dst_total_elmts = 1;
672 int dst_dim = dst_array->
dim;
673 int dst_l[dst_dim], dst_u[dst_dim], dst_s[dst_dim];
674 unsigned long long dst_d[dst_dim];
675 int dst_scalar_flag = 1;
676 for (
int i = 0; i < dst_dim; i++) {
677 dst_l[i] = gmv_desc_leftp->
lb[i];
678 dst_u[i] = gmv_desc_leftp->
ub[i];
679 dst_s[i] = gmv_desc_leftp->
st[i];
683 dst_scalar_flag &= (dst_s[i] == 0);
687 unsigned long long src_total_elmts = 1;
688 int src_dim = src_array->
dim;
689 int src_l[src_dim], src_u[src_dim], src_s[src_dim];
690 unsigned long long src_d[src_dim];
691 int src_scalar_flag = 1;
692 for (
int i = 0; i < src_dim; i++) {
693 src_l[i] = gmv_desc_rightp->
lb[i];
694 src_u[i] = gmv_desc_rightp->
ub[i];
695 src_s[i] = gmv_desc_rightp->
st[i];
699 src_scalar_flag &= (src_s[i] == 0);
702 if (dst_total_elmts != src_total_elmts && !src_scalar_flag){
703 _XMP_fatal(
"wrong assign statement for gmove");
711 if (dst_scalar_flag && src_scalar_flag){
717 _XMP_fatal(
"_XMP_gmove_SENDRECV_GSCALAR() for acc is not implemented");
720 else if (!dst_scalar_flag && src_scalar_flag){
725 _XMP_fatal(
"_XMP_gmove_BCAST_GSCALAR() and _XMP_gmove_gsection_scalar() for acc is not implemented");
731 dst_l, dst_u, dst_s, dst_d,
732 src_l, src_u, src_s, src_d,
739 gmv_comm->
desc_left = alloc_gmv_desc(gmv_desc_leftp);
740 gmv_comm->
desc_right = alloc_gmv_desc(gmv_desc_rightp);
744 for(
int i = 0; i < g_current_comm.
num_recvs; i++){
747 for(
int i = 0; i < g_current_comm.
num_sends; i++){
750 cache_comm(gmv_comm);
◆ xmpc_gmv_do_acc()
762 _XMP_fatal(
"gmv_do_acc: currently both sides must be global.");
◆ xmpc_gmv_g_alloc_acc()
198 if (!gp || !gp->
kind || !gp->
lb || !gp->
st)
199 _XMP_fatal(
"gmv_g_alloc: cannot alloc memory");
209 gp->a_dev = dev_addr;
◆ xmpc_gmv_l_alloc_acc()
void xmpc_gmv_l_alloc_acc |
( |
_XMP_gmv_desc_t ** |
gmv_desc, |
|
|
void * |
local_data, |
|
|
int |
n |
|
) |
| |
234 gp->a_dev = local_data;
int num_recvs
Definition: xmp_gmove_acc.c:23
void _XMP_gmove_array_array_common_acc(_XMP_gmv_desc_t *gmv_desc_leftp, _XMP_gmv_desc_t *gmv_desc_rightp, int *dst_l, int *dst_u, int *dst_s, unsigned long long *dst_d, int *src_l, int *src_u, int *src_s, unsigned long long *src_d, int mode)
Definition: xmp_gmove_acc.c:624
Definition: xmp_gmove_acc.c:20
_Bool xmp_is_async()
Definition: xmp_async.c:20
void * _XMP_alloc(size_t size)
Definition: xmp_util.c:21
int * lb
Definition: xmp_data_struct.h:398
int * st
Definition: xmp_data_struct.h:400
_XACC_sendrecv_comm_t recvs[_XACC_MAX_NUM_SENDRECVS]
Definition: xmp_gmove_acc.c:25
#define _XMP_N_GMOVE_NORMAL
Definition: xmp_constant.h:69
int * ub
Definition: xmp_data_struct.h:399
#define _XACC_MAX_NUM_SENDRECVS
Definition: xmp_gmove_acc.c:10
void _XMP_gmove_garray_garray_acc(_XMP_gmv_desc_t *gmv_desc_leftp, _XMP_gmv_desc_t *gmv_desc_rightp, int mode)
Definition: xmp_gmove_acc.c:648
Definition: xmp_data_struct.h:386
int * a_ub
Definition: xmp_data_struct.h:395
_XMP_gmv_desc_t * desc_left
Definition: xmp_gmove_acc.c:21
_XACC_sendrecv_comm_t sends[_XACC_MAX_NUM_SENDRECVS]
Definition: xmp_gmove_acc.c:26
int * kind
Definition: xmp_data_struct.h:397
_XMP_gmv_desc_t * desc_right
Definition: xmp_gmove_acc.c:22
void * local_data
Definition: xmp_data_struct.h:393
Definition: xmp_data_struct.h:266
int ndims
Definition: xmp_data_struct.h:389
size_t type_size
Definition: xmp_data_struct.h:274
_XMP_array_info_t info[1]
Definition: xmp_data_struct.h:313
#define _XMP_ASSERT(_flag)
Definition: xmp_internal.h:34
_Bool is_global
Definition: xmp_data_struct.h:388
int dim
Definition: xmp_data_struct.h:272
void _XMP_fatal(char *msg)
Definition: xmp_util.c:42
_XMP_array_t * a_desc
Definition: xmp_data_struct.h:391
unsigned long long dim_acc
Definition: xmp_data_struct.h:242
#define _XMP_M_COUNT_TRIPLETi(l_, u_, s_)
Definition: xmp_gpu_func.hpp:25
int num_sends
Definition: xmp_gmove_acc.c:24
int type
Definition: xmp_data_struct.h:273
void _XMP_normalize_array_section(int *lower, int *upper, int *stride)
int * a_lb
Definition: xmp_data_struct.h:394