diff options
Diffstat (limited to 'src/Operators.c')
-rw-r--r-- | src/Operators.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Operators.c b/src/Operators.c index 2cbde16..01947b4 100644 --- a/src/Operators.c +++ b/src/Operators.c @@ -226,10 +226,18 @@ MoL_LinearCombination(cGH const *const cctkGH, { DECLARE_CCTK_PARAMETERS; - // Forward call to aliased function, if it is defined + // Forward call to aliased function, if it is defined and if we are + // using the device (accelerator) static int is_aliased = -1; if (is_aliased < 0) { - is_aliased = CCTK_IsFunctionAliased("LinearCombination"); + int is_device = 0; + if (CCTK_IsFunctionAliased("Device_GetDevice")) { + is_device = Device_GetDevice(cctkGH) >= 0; + } + is_aliased = 0; + if (is_device) { + is_aliased = CCTK_IsFunctionAliased("LinearCombination"); + } } if (is_aliased) { return |