OpenMP-Accelerators: interoperability

Forum for the public review of the OpenMP 4.0 API Release Candidates. (Read Only)
Forum rules
This forum is now closed.

OpenMP-Accelerators: interoperability

Postby JPoznanovic » Mon Dec 03, 2012 5:27 am

Hello,

How does OpenMP (for accelerator targets) provide interoperability between itself and another programming language or numerical library? (e.g. keeping data persistent on the device between OpenMP accelerator regions and an external accelerator-targeted library call)

Seems like there should be a way to expose and/or use device data addresses on the host side. Without this, it seems like it would be difficult to allow device data persistence between uses of OpenMP and alternative approaches.

Please let me know your plans on this topic and/or if I've overlooked something.

Thanks,

Jeff
JPoznanovic
 
Posts: 2
Joined: Fri Nov 30, 2012 1:24 am
Location: Lugano, Switzerland

Re: OpenMP-Accelerators: interoperability

Postby RaviNarayanaswamy » Mon Dec 17, 2012 2:37 pm

The OpenMP-Accelerator sub-committee understands the need for being able to pass around a device pointer address.
We are discussing 2 alternatives 1) specify "ptr" attribute to a pointer to indicate the value of the pointer should be sent/received as show in Example 1
or 2) if you use “p” instead of p[:] in map clause then the pointer value is sent instead of what it points to


Example 1
foo()
{
int *p;

#pragma target mapfrom(ptr:p) {
p = malloc(100*sizeof(int));
initialize(p);
}

#pragma target mapto(ptr:p)
{
Use(p);
free(p);
}
}
RaviNarayanaswamy
 
Posts: 2
Joined: Mon Dec 17, 2012 2:11 pm

Re: OpenMP-Accelerators: interoperability

Postby JPoznanovic » Fri Jan 11, 2013 3:36 am

Dear Ravi,

I think this makes sense, as it appears to work in two key situations:

1) If the device data was allocated by the alternative approach and then used by OpenMP

2) If the device data was allocated by OpenMP and then used by the alternative approach

Thanks for the response.

Regards,

Jeff
JPoznanovic
 
Posts: 2
Joined: Fri Nov 30, 2012 1:24 am
Location: Lugano, Switzerland

Re: OpenMP-Accelerators: interoperability

Postby wapeter » Tue Apr 23, 2013 10:18 am

JPoznanovic wrote:Dear Ravi,

I think this makes sense, as it appears to work in two key situations:

1) If the device data was allocated by the alternative approach and then used by OpenMP

2) If the device data was allocated by OpenMP and then used by the alternative approach

Thanks for the response.

Regards,

Jeff


Ravi which one did you end up going for? Excuse my newbieness but I'm just curious
Peter
Ever had dreams about snakes? Use dream dictionary now to find out the meaning.
wapeter
 
Posts: 1
Joined: Tue Apr 23, 2013 9:30 am


Return to OpenMP 4.0 Public Review Release Candidates

Who is online

Users browsing this forum: No registered users and 2 guests

cron