HOME
| OPENMP API Specification: Version 5.0 November 2018

3.6.5  omp_target_memcpy_rect

SummaryThe omp_target_memcpy_rect routine copies a rectangular subvolume from a multi-dimensional array to another multi-dimensional array. The copies can use any combination of host and device pointers.

Format  

 
int omp_target_memcpy_rect( 
  void *dst, 
  const void *src, 
  size_t element_size, 
  int num_dims, 
  const size_t *volume, 
  const size_t *dst_offsets, 
  const size_t *src_offsets, 
  const size_t *dst_dimensions, 
  const size_t *src_dimensions, 
  int dst_device_num, 
  int src_device_num 
);  

Constraints on ArgumentsThe length of the offset and dimension arrays must be at least the value of num_dims. The dst_device_num and src_device_num must be greater than or equal to zero and less than the result of omp_get_num_devices() or equal to the result of a call to omp_get_initial_device(). The value of num_dims must be between 1 and the implementation-defined limit, which must be at least three.

EffectThis routine copies a rectangular subvolume of src, in the device data environment of device src_device_num, to dst, in the device data environment of device dst_device_num. The volume is specified in terms of the size of an element, number of dimensions, and constant arrays of length num_dims. The maximum number of dimensions supported is at least three, support for higher dimensionality is implementation defined. The volume array specifies the length, in number of elements, to copy in each dimension from src to dst. The dst_offsets (src_offsets) parameter specifies number of elements from the origin of dst (src) in elements. The dst_dimensions (src_dimensions) parameter specifies the length of each dimension of dst (src) The routine returns zero if successful. If both dst and src are NULL pointers, the routine returns the number of dimensions supported by the implementation for the specified device numbers. The host device and host device data environment can be referenced with the device number returned by omp_get_initial_device. Otherwise, it returns a non-zero value. The routine contains a task scheduling point.

When called from within a target region the effect of this routine is unspecified.

Execution Model EventsThe target-data-op event occurs when a thread transfers data on a target device.

Tool Callbacks A thread invokes a registered ompt_callback_target_data_op callback for each occurrence of a target-data-op event in that thread. The callback occurs in the context of the target task and has type signature ompt_callback_target_data_op_t.

Cross References