| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| 3 | SLEPc - Scalable Library for Eigenvalue Problem Computations | ||
| 4 | Copyright (c) 2002-, Universitat Politecnica de Valencia, Spain | ||
| 5 | |||
| 6 | This file is part of SLEPc. | ||
| 7 | SLEPc is distributed under a 2-clause BSD license (see LICENSE). | ||
| 8 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| 9 | */ | ||
| 10 | |||
| 11 | #include <slepc/private/slepcimpl.h> | ||
| 12 | #include <slepcmagma.h> | ||
| 13 | |||
| 14 | static PetscBool SlepcBeganMagma = PETSC_FALSE; | ||
| 15 | |||
| 16 | 40 | static void slepc_magma_finalize(void PETSC_UNUSED *unused, magma_int_t *ierr) | |
| 17 | { | ||
| 18 | 40 | (void)unused; | |
| 19 | 40 | *ierr = magma_finalize(); | |
| 20 | 40 | return; | |
| 21 | } | ||
| 22 | |||
| 23 | 40 | static PetscErrorCode SlepcMagmaFinalize(void) | |
| 24 | { | ||
| 25 | 40 | PetscFunctionBegin; | |
| 26 | 40 | SlepcBeganMagma = PETSC_FALSE; | |
| 27 |
2/6✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
|
40 | PetscCallMAGMA(slepc_magma_finalize, NULL); |
| 28 | 40 | PetscFunctionReturn(PETSC_SUCCESS); | |
| 29 | } | ||
| 30 | |||
| 31 | 40 | static void slepc_magma_init(void PETSC_UNUSED *unused, magma_int_t *ierr) | |
| 32 | { | ||
| 33 | 40 | (void)unused; | |
| 34 | 40 | *ierr = magma_init(); | |
| 35 | 40 | return; | |
| 36 | } | ||
| 37 | |||
| 38 | 216 | PetscErrorCode SlepcMagmaInit(void) | |
| 39 | { | ||
| 40 | 216 | PetscFunctionBegin; | |
| 41 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 2 times.
|
216 | if (!SlepcBeganMagma) { |
| 42 |
2/6✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
|
40 | PetscCallMAGMA(slepc_magma_init, NULL); |
| 43 | 40 | SlepcBeganMagma = PETSC_TRUE; | |
| 44 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
40 | PetscCall(PetscRegisterFinalize(SlepcMagmaFinalize)); |
| 45 | } | ||
| 46 | PetscFunctionReturn(PETSC_SUCCESS); | ||
| 47 | } | ||
| 48 |