You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got the following when porting by search and replace from CUDA to cupla:
error: there are no arguments to ‘max’ that depend on a template parameter, so a declaration of ‘max’ must be available
cupla should provide such a function (also simple min was missing). CUDA provides this in math_functions.h which is included by common_functions.h which is included by cuda_runtime.h. I didn't include this manually, but I guess nvcc did include this for me just like it is unnecessary to write #include <cuda.h> in a .cu file.
I guess min and max are not the only missing functions, henceforth the title.
The problem is, that std::max and so on can't be called from a device function.
Current workaround:
#ifndef max
# define max( a, b ) ( ((a) > (b)) ? (a) : (b) )
#endif
#ifndef min
# define min( a, b ) ( ((a) < (b)) ? (a) : (b) )
#endif
The text was updated successfully, but these errors were encountered:
I got the following when porting by search and replace from CUDA to cupla:
cupla should provide such a function (also simple min was missing). CUDA provides this in
math_functions.h
which is included bycommon_functions.h
which is included bycuda_runtime.h
. I didn't include this manually, but I guessnvcc
did include this for me just like it is unnecessary to write#include <cuda.h>
in a.cu
file.I guess min and max are not the only missing functions, henceforth the title.
The problem is, that
std::max
and so on can't be called from a device function.Current workaround:
The text was updated successfully, but these errors were encountered: