| 5137 | |
| 5138 | template <class T> |
| 5139 | port::Status CudnnSupport::DoSoftmaxImpl( |
| 5140 | Stream* stream, dnn::DataType input_data_type, |
| 5141 | const DeviceMemory<T>& x, const dnn::BatchDescriptor& x_desc, |
| 5142 | bool log, DeviceMemory<T>* y) |
| 5143 | { |
| 5144 | CudnnTensorDescriptor x_descriptor(x_desc, ToCudnnDataType(input_data_type)); |
| 5145 | cudnnSoftmaxMode_t mode = CUDNN_SOFTMAX_MODE_CHANNEL; |
| 5146 | cudnnSoftmaxAlgorithm_t algo = log ? CUDNN_SOFTMAX_LOG : CUDNN_SOFTMAX_ACCURATE; |
| 5147 | float one = 1.0; |
| 5148 | float zero = 0.0; |
| 5149 | auto cudnn = cudnn_->GetHandle(parent_, stream); |
| 5150 | |
| 5151 | RETURN_IF_CUDNN_ERROR(cudnnSoftmaxForward( |
| 5152 | cudnn.handle(), algo, mode, &one, x_descriptor.handle(), x.opaque(), |
| 5153 | &zero, x_descriptor.handle(), y->opaque())); |
| 5154 | return port::Status::OK(); |
| 5155 | } |
| 5156 | |
| 5157 | bool CudnnSupport::DoBatchNormalizationForward( |
| 5158 | Stream* stream, const DeviceMemory<float>& x, |
nothing calls this directly
no test coverage detected