提交 e72c8872 authored 作者: Frédéric Bastien's avatar Frédéric Bastien 提交者: GitHub

Merge pull request #6341 from notoraptor/fix-segfault-with-dnn-conv

Try to fix segmentation fault related to last updates in cuDNN conv codes.
...@@ -299,7 +299,9 @@ def struct_gen(args, struct_builders, blocks, sub): ...@@ -299,7 +299,9 @@ def struct_gen(args, struct_builders, blocks, sub):
// now I am tired of chasing segfaults because // now I am tired of chasing segfaults because
// initialization code had an error and some pointer has // initialization code had an error and some pointer has
// a junk value. // a junk value.
#ifndef THEANO_DONT_MEMSET_STRUCT
memset(this, 0, sizeof(*this)); memset(this, 0, sizeof(*this));
#endif
} }
~%(name)s(void) { ~%(name)s(void) {
cleanup(); cleanup();
......
...@@ -9,6 +9,9 @@ hash_prefix = std::string("FWD|GPU#"); ...@@ -9,6 +9,9 @@ hash_prefix = std::string("FWD|GPU#");
int reuse_algo; int reuse_algo;
AlgoRec prev_algo; AlgoRec prev_algo;
std::string hash_prefix; std::string hash_prefix;
#define THEANO_DONT_MEMSET_STRUCT
#ifdef DEBUG #ifdef DEBUG
char algorithm_name[128]; char algorithm_name[128];
#endif #endif
......
...@@ -9,6 +9,9 @@ hash_prefix = std::string("GI|GPU#"); ...@@ -9,6 +9,9 @@ hash_prefix = std::string("GI|GPU#");
int reuse_algo; int reuse_algo;
AlgoRec prev_algo; AlgoRec prev_algo;
std::string hash_prefix; std::string hash_prefix;
#define THEANO_DONT_MEMSET_STRUCT
#ifdef DEBUG #ifdef DEBUG
char algorithm_name[128]; char algorithm_name[128];
#endif #endif
......
...@@ -9,6 +9,9 @@ hash_prefix = std::string("GW|GPU#"); ...@@ -9,6 +9,9 @@ hash_prefix = std::string("GW|GPU#");
int reuse_algo; int reuse_algo;
AlgoRec prev_algo; AlgoRec prev_algo;
std::string hash_prefix; std::string hash_prefix;
#define THEANO_DONT_MEMSET_STRUCT
#ifdef DEBUG #ifdef DEBUG
char algorithm_name[128]; char algorithm_name[128];
#endif #endif
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论