blob: 0abefd903d1bbc72801b0216f140f0583f721382 [file] [log] [blame]
#include "THCUNN.h"
#include "THCHalf.h"
#include "THCHalfAutoNumerics.cuh"
template <typename T>
struct absupdateOutput_functor
{
__device__ void operator()(T* output, const T* input) const
{
*output = abs(*input);
}
};
template <typename T>
struct absupdateGradInput_functor
{
__device__ void operator()(T* gradInput, const T* input, const T* gradOutput) const
{
*gradInput = *input < 0 ? - *gradOutput : *gradOutput;
}
};
#include "generic/Abs.cu"
#include "THCGenerateFloatTypes.h"