Exemplo n.º 1
0
  CuDNNTanHLayer<Dtype>::~CuDNNTanHLayer() {
    // Check that handles have been setup before destroying.
    if (!handles_setup_) {return;}

    cudnnDestroyTensor4dDescriptor(this->bottom_desc_);
    cudnnDestroyTensor4dDescriptor(this->top_desc_);
    cudnnDestroy(this->handle_);
  }
  CuDNNPoolingLayer<Dtype>::~CuDNNPoolingLayer() {
    // Check that handles have been setup before destroying.
    if (!handles_setup_) {return;}

    cudnnDestroyTensor4dDescriptor(bottom_desc_);
    cudnnDestroyTensor4dDescriptor(top_desc_);
    cudnnDestroyPoolingDescriptor(pooling_desc_);
    cudnnDestroy(handle_);
  }
Exemplo n.º 3
0
CuDNNConvolutionLayer<Dtype>::~CuDNNConvolutionLayer() {
  for (int i = 0; i < bottom_descs_.size(); i++) {
    cudnnDestroyTensor4dDescriptor(bottom_descs_[i]);
    cudnnDestroyTensor4dDescriptor(top_descs_[i]);
    cudnnDestroyConvolutionDescriptor(conv_descs_[i]);
  }
  if (this->bias_term_) {
    cudnnDestroyTensor4dDescriptor(bias_desc_);
  }
  cudnnDestroyFilterDescriptor(filter_desc_);

  for (int g = 0; g < this->group_ * CUDNN_STREAMS_PER_GROUP; g++) {
    cudaStreamDestroy(stream_[g]);
    cudnnDestroy(handle_[g]);
  }

  delete [] stream_;
  delete [] handle_;
}
CuDNNTanHLayer<Dtype>::~CuDNNTanHLayer() {
  cudnnDestroyTensor4dDescriptor(this->bottom_desc_);
  cudnnDestroyTensor4dDescriptor(this->top_desc_);
  cudnnDestroy(this->handle_);
}