[petsc-dev] Backend independent VecGetArray for GPUs

Jed Brown jed at jedbrown.org
Fri Oct 17 11:40:29 CDT 2014


Karl Rupp <rupp at iue.tuwien.ac.at> writes:
> If this should be provided, then the right names were
>   VecCUDAGetArray()
>   VecOpenCLGetArray()
> The former returns an object of type PetscScalar* and the latter an 
> object of type cl_mem. Because one is stuck with two incompatible 
> pointer types here, I'd suggest not to provide a single interface at the 
> expense of giving up type safety. 

Agreed.

Does cl_mem have a "null"?

> Also, even if one gives up type safety, one would immediately have to
> switch-case into a backend-specific implementation again, so there's
> little value in a common interface.

It's useful to have a non-error path for calling.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20141017/32d56cb2/attachment.sig>


More information about the petsc-dev mailing list