Closed SimeonEhrig closed 2 years ago
@sbastrakov Bernhard helped me to find the problem, why I cannot use plain __device__
functions with the CUDA and the HIP backend in vikunja. The reason is I use the attribute ALPAKA_FN_HOST_ACC
(__host__ __device__
) and I pass the function pointer of the host version to vikunja and not the pointer of the device version. To get the device pointer, I need the function cudaMemcpyFromSymbol
like in this example: https://newbedev.com/cuda-function-pointers
I think, this is the same reason, why we does not support plain __device__
functions in alpaka. Can you confirm this?
I think you are right wrt. function pointers, but lambda functions and functors should work. Maybe it is fine for vikunja to just not allow function pointers.
I also think you are right about __device__
functions in CUDA, but labmdas should work.
Yes, I forbid it. We have with structs with operator()
and lambda two working options and plain function would be only semantic sugar.
ready for review
The operator trait has two tasks: