Alpaka: Make sure that the kernel function returns void with `ALPAKA_ACC_GPU_CUDA_ONLY_MODE`

Created on 9 Nov 2018  路  5Comments  路  Source: alpaka-group/alpaka

We should check at compile time that the TKernelFnObj passed into the executor returns void.
There is no way to handle functions returning a value because each thread produces one.

Help Wanted Enhancement

All 5 comments

With #695 an static_assert has been added that checks the return type.
It is disabled when ALPAKA_ACC_GPU_CUDA_ONLY_MODE is set. This restirction should be investigated and removed.

Seems to be a problem with pure __device__ functions only: https://github.com/ComputationalRadiationPhysics/alpaka/pull/695#issuecomment-446103194

But as I can see from the comments in #695 we can get the correct return type on the device side. This means we can add a check for CUDA function within the device code.
I will open a PR for it.

I don't see yet how since the signature does not contain void but just some generic int... surprise me :)

I opened #711 with the implementation for the device side validation for CUDA and HIP (to guard the case that CUDA is used as HIP backend)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ax3l picture ax3l  路  5Comments

tdd11235813 picture tdd11235813  路  4Comments

SimeonEhrig picture SimeonEhrig  路  5Comments

psychocoderHPC picture psychocoderHPC  路  4Comments

jkelling picture jkelling  路  4Comments