Make complex math functions host-device #2479
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the immediate fix requested in here for the following problem: Compiling in
alpaka_ACC_GPU_CUDA_ONLY_MODE=ON
resolvesALPAKA_FN_ACC
into__device__
(and not__host__ __device__
). However, in some situations the compiler has problems deducing the correct return type (for return typeauto
) if it only ever knows the device code and doesn't generate host code. This results in weird compilation errors along the lines oferror: invalid use of void expression
for functions that clearly return a non-void
value. In our case, the complex math functions are the culprit.CUDA-only mode is currently not run in CI (presumably because some examples explicitly need
AccCpuSerial
). @SimeonEhrig, could we run CUDA-only mode in CI?CAUTION: Running
test/unit/math/mathTest
in CUDA-only mode still fails after this fix with the following error message:(running in debug mode generates the SIGILL which seems to be somehow hidden otherwise). This disappears by disabling CUDA-only mode (still activating only a single accelerator). So apparently there's something more going on here.
cuda-gdb
reveals that it's whilegetValidWorkDiv
failing to get function properties. This is likely related, potentially because I haven't found all instances of this happening. We need to dig into this further but I would still welcome merging this partial fix already because it's needed for PIConGPU.As @psychocoderHPC is on vacation, would you, @AuroraPerego or someone else, do the honours please?