shared_ptr migrations

This commit is contained in:
Harshvardhan Chandirasekar
2021-03-17 22:26:26 +05:30
parent 6aa8666be5
commit 304ab49897
4 changed files with 25 additions and 6 deletions
+6 -1
View File
@@ -6,6 +6,7 @@
#include "Network.h"
#include "Layer.h"
#include "NvInfer.h"
#include <memory>
namespace tk { namespace dnn {
@@ -59,7 +60,8 @@ public:
#if NV_TENSORRT_MAJOR >= 6
nvinfer1::IBuilderConfig *configRT;
#endif
nvinfer1::ICudaEngine *engineRT;
std::shared_ptr<nvinfer1::ICudaEngine> engineRT;
//nvinfer1::ICudaEngine *engineRT;
nvinfer1::IExecutionContext *contextRT;
const static int MAX_BUFFERS_RT = 10;
@@ -114,6 +116,9 @@ public:
bool serialize(const char *filename);
bool deserialize(const char *filename);
};
}}
+11
View File
@@ -110,6 +110,17 @@ double t_ns = time_ms.count();
FatalError(_error.str()); \
} \
}
struct InferDeleter
{
template <typename T>
void operator()(T* obj) const
{
if (obj)
{
obj->destroy();
}
}
};
typedef enum {
ERROR_CUDNN = 2,