Skip to content
This repository was archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
CuDNN now accommodated with relu, video etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattphillipskitware committed Nov 13, 2017
1 parent 6e4bf1c commit c7c242e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
20 changes: 16 additions & 4 deletions C3D-v1.1/include/caffe/blob.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,25 @@ class Blob {
}

/// @brief Deprecated legacy shape accessor num: use shape(0) instead.
inline int num() const { return LegacyShape(0); }
inline int num() const
{
return num_axes() >= 5 ? shape(0) : LegacyShape(0);
}
/// @brief Deprecated legacy shape accessor channels: use shape(1) instead.
inline int channels() const { return LegacyShape(1); }
inline int channels() const
{
return num_axes() >= 5 ? shape(1) : LegacyShape(1);
}
/// @brief Deprecated legacy shape accessor height: use shape(2) instead.
inline int height() const { return LegacyShape(2); }
inline int height() const
{
return num_axes() >= 5 ? shape(2) : LegacyShape(2);
}
/// @brief Deprecated legacy shape accessor width: use shape(3) instead.
inline int width() const { return LegacyShape(3); }
inline int width() const
{
return num_axes() >= 5 ? shape(3) : LegacyShape(3);
}
inline int LegacyShape(int index) const {
CHECK_LE(num_axes(), 4)
<< "Cannot use legacy accessors on Blobs with > 4 axes.";
Expand Down
16 changes: 16 additions & 0 deletions C3D-v1.1/include/caffe/util/cudnn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ inline const char* cudnnGetErrorString(cudnnStatus_t status) {
return "CUDNN_STATUS_NOT_SUPPORTED";
case CUDNN_STATUS_LICENSE_ERROR:
return "CUDNN_STATUS_LICENSE_ERROR";
#if CUDNN_VERSION_MIN(6, 0, 0)
case CUDNN_STATUS_RUNTIME_PREREQUISITE_MISSING:
return "CUDNN_STATUS_RUNTIME_PREREQUISITE_MISSING";
#endif
#if CUDNN_VERSION_MIN(7, 0, 0)
case CUDNN_STATUS_RUNTIME_IN_PROGRESS:
return "CUDNN_STATUS_RUNTIME_IN_PROGRESS";
case CUDNN_STATUS_RUNTIME_FP_OVERFLOW:
return "CUDNN_STATUS_RUNTIME_FP_OVERFLOW";
#endif
}
return "Unknown cudnn status";
}
Expand Down Expand Up @@ -109,8 +119,14 @@ template <typename Dtype>
inline void setConvolutionDesc(cudnnConvolutionDescriptor_t* conv,
cudnnTensorDescriptor_t bottom, cudnnFilterDescriptor_t filter,
int pad_h, int pad_w, int stride_h, int stride_w) {
#if CUDNN_VERSION_MIN(6, 0, 0)
CUDNN_CHECK(cudnnSetConvolution2dDescriptor(*conv,
pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION,
dataType<Dtype>::type));
#else
CUDNN_CHECK(cudnnSetConvolution2dDescriptor(*conv,
pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION));
#endif
}

template <typename Dtype>
Expand Down

0 comments on commit c7c242e

Please sign in to comment.