Makes a function memoizing the result for each argument and device.
This is a similar version of
cupy.memoize(). The difference is that this function can be used in the global scope even if CUDA is not available. In such case, this function does nothing.
This decorator acts as a dummy if CUDA is not available. It cannot be used for general purpose memoization even if
for_each_deviceis set to False.