libxmp/libxmpf in Omni Compiler  1.3.4
xmp_coarray_local.c File Reference
#include <string.h>
#include <stdlib.h>
#include "xmp_internal.h"
#include "xmp_math_function.h"
Include dependency graph for xmp_coarray_local.c:

Functions

size_t _XMP_calc_copy_chunk (const int copy_chunk_dim, const _XMP_array_section_t *array)
 
void _XMP_local_put (_XMP_coarray_t *dst_desc, const void *src, const int dst_contiguous, const int src_contiguous, const int dst_dims, const int src_dims, const _XMP_array_section_t *dst_info, const _XMP_array_section_t *src_info, const size_t dst_elmts, const size_t src_elmts)
 
void _XMP_local_get (void *dst, const _XMP_coarray_t *src_desc, const int dst_contiguous, const int src_contiguous, const int dst_dims, const int src_dims, const _XMP_array_section_t *dst_info, const _XMP_array_section_t *src_info, const size_t dst_elmts, const size_t src_elmts)
 

Function Documentation

◆ _XMP_calc_copy_chunk()

size_t _XMP_calc_copy_chunk ( const int  copy_chunk_dim,
const _XMP_array_section_t array 
)
23 {
24  if(copy_chunk_dim == 0) // All elements are copied
25  return array[0].length * array[0].distance;
26 
27  if(array[copy_chunk_dim-1].stride == 1)
28  return array[copy_chunk_dim-1].length * array[copy_chunk_dim-1].distance;
29  else
30  return array[copy_chunk_dim-1].distance;
31 }
Here is the caller graph for this function:

◆ _XMP_local_get()

void _XMP_local_get ( void *  dst,
const _XMP_coarray_t src_desc,
const int  dst_contiguous,
const int  src_contiguous,
const int  dst_dims,
const int  src_dims,
const _XMP_array_section_t dst_info,
const _XMP_array_section_t src_info,
const size_t  dst_elmts,
const size_t  src_elmts 
)
600 {
601  size_t dst_offset = _XMP_get_offset(dst_info, dst_dims);
602  size_t src_offset = _XMP_get_offset(src_info, src_dims);
603  size_t elmt_size = src_desc->elmt_size;
604 
605  if(dst_contiguous && src_contiguous)
606  _XMP_local_contiguous_copy((char *)dst+dst_offset, (char *)src_desc->real_addr+src_offset,
607  dst_elmts, src_elmts, elmt_size);
608  else
609  _local_NON_contiguous_copy((char *)dst+dst_offset, (char *)src_desc->real_addr+src_offset,
610  dst_dims, src_dims, dst_info, src_info, dst_elmts, src_elmts, elmt_size);
611 }
Here is the call graph for this function:

◆ _XMP_local_put()

void _XMP_local_put ( _XMP_coarray_t dst_desc,
const void *  src,
const int  dst_contiguous,
const int  src_contiguous,
const int  dst_dims,
const int  src_dims,
const _XMP_array_section_t dst_info,
const _XMP_array_section_t src_info,
const size_t  dst_elmts,
const size_t  src_elmts 
)
566 {
567  size_t dst_offset = _XMP_get_offset(dst_info, dst_dims);
568  size_t src_offset = _XMP_get_offset(src_info, src_dims);
569  size_t elmt_size = dst_desc->elmt_size;
570 
571  if(dst_contiguous && src_contiguous)
572  _XMP_local_contiguous_copy((char *)dst_desc->real_addr+dst_offset, (char *)src+src_offset,
573  dst_elmts, src_elmts, elmt_size);
574  else
575  _local_NON_contiguous_copy((char *)dst_desc->real_addr+dst_offset, (char *)src+src_offset,
576  dst_dims, src_dims, dst_info, src_info, dst_elmts, src_elmts, elmt_size);
577 }
Here is the call graph for this function:
_XMP_array_section::length
long length
Definition: xmp_data_struct.h:377
xmp_coarray::real_addr
char * real_addr
Definition: xmp_data_struct.h:336
xmp_coarray::elmt_size
size_t elmt_size
Definition: xmp_data_struct.h:339
_XMP_get_offset
size_t _XMP_get_offset(const _XMP_array_section_t *array_info, const int dims)
Definition: xmp_coarray_utils.c:22
_XMP_array_section::distance
long distance
Definition: xmp_data_struct.h:380
_XMP_local_contiguous_copy
void _XMP_local_contiguous_copy(char *dst, const char *src, const size_t dst_elmts, const size_t src_elmts, const size_t elmt_size)
Definition: xmp_coarray_utils.c:79