[petsc-dev] (no subject)
Matthew Knepley
knepley at gmail.com
Sat Oct 1 21:48:45 CDT 2011
On Sat, Oct 1, 2011 at 9:08 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
> Matt,
>
> I assume you wrote this? Does it make sense ti initialize the
> cublasInit() before setting the device? Seems like the cublasInit() should
> go after the other code?
>
I think you are probably right. I will move it.
Matt
> Barry
>
> #if defined(PETSC_HAVE_CUDA)
> cublasInit();
>
> ierr =
> PetscOptionsHasName(PETSC_NULL,"-cuda_show_devices",&flg);CHKERRQ(ierr);
> if (flg) {
> struct cudaDeviceProp prop;
> int devCount;
> int device;
>
> ierr = cudaGetDeviceCount(&devCount);CHKERRQ(ierr);
> for(device = 0; device < devCount; ++device) {
> ierr = cudaGetDeviceProperties(&prop, device);CHKERRQ(ierr);
> ierr = PetscPrintf(PETSC_COMM_WORLD, "CUDA device %d: %s\n", device,
> prop.name);CHKERRQ(ierr);
> }
> }
> {
> int device;
>
> ierr = PetscOptionsGetInt(PETSC_NULL,"-cuda_set_device", &device,
> &flg);CHKERRQ(ierr);
> if (flg) {
> ierr = cudaSetDevice(device);CHKERRQ(ierr);
> }
> }
> #endif
>
>
--
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20111001/0789d47a/attachment.html>
More information about the petsc-dev
mailing list