On Mon, Jul 13, 2015 at 10:06:24PM +0300, Ilya Verbin wrote: > libgomp/ > * libgomp.h (struct gomp_device_descr): Add dev2dev_func. > * target.c (omp_target_memcpy): Support device-to-device. > (omp_target_memcpy_rect_worker): Likewise. > (omp_target_memcpy_rect): Likewise. > (gomp_load_plugin_for_device): Check for GOMP_OFFLOAD_dev2dev. > * testsuite/libgomp.c/target-12.c (main): Extend for testing > device-to-device memcpy. > liboffloadmic/ > * plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_dev2dev): New > function. > * plugin/offload_target_main.cpp (__offload_target_tgt2tgt): New static > function, register it in liboffloadmic.
Ok, with a small change: > @@ -1437,10 +1449,6 @@ omp_target_memcpy_rect (void *dst, void *src, size_t > element_size, > src_devicep = NULL; > } > > - /* FIXME: Support device-to-device somehow? */ > - if (src_devicep != NULL && dst_devicep != NULL) > - return EINVAL; > - Please do here if (src_devicep != NULL && dst_devicep != NULL && src_devicep != dst_devicep) return EINVAL; anyway. No need to do all the locking and computations just to find out it will fail anyway. Jakub