MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / DoSoftmaxImpl

Method DoSoftmaxImpl

tensorflow/stream_executor/cuda/cuda_dnn.cc:5139–5155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5137
5138template <class T>
5139port::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
5157bool CudnnSupport::DoBatchNormalizationForward(
5158 Stream* stream, const DeviceMemory<float>& x,

Callers

nothing calls this directly

Calls 4

ToCudnnDataTypeFunction · 0.85
opaqueMethod · 0.80
GetHandleMethod · 0.45
handleMethod · 0.45

Tested by

no test coverage detected