This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp4.1 WIP] omp_target_* libgomp APIs
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ilya Verbin <iverbin at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Kirill Yukhin <kirill dot yukhin at gmail dot com>
- Date: Mon, 13 Jul 2015 21:36:11 +0200
- Subject: Re: [gomp4.1 WIP] omp_target_* libgomp APIs
- Authentication-results: sourceware.org; auth=none
- References: <20150709140657 dot GR10247 at tucnak dot redhat dot com> <20150713131729 dot GP1788 at tucnak dot redhat dot com> <20150713133833 dot GA56059 at msticlxl57 dot ims dot intel dot com> <20150713140306 dot GR1788 at tucnak dot redhat dot com> <20150713151545 dot GD56059 at msticlxl57 dot ims dot intel dot com> <20150713152643 dot GT1788 at tucnak dot redhat dot com> <20150713155029 dot GE56059 at msticlxl57 dot ims dot intel dot com> <20150713190624 dot GA29060 at msticlxl57 dot ims dot intel dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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