| 139 | } |
| 140 | |
| 141 | int32_t DetectionLayer::initialize() noexcept |
| 142 | { |
| 143 | try |
| 144 | { |
| 145 | // Init the mValidCnt and mDecodedBboxes for max batch size. |
| 146 | std::vector<int32_t> tempValidCnt(mMaxBatchSize, mAnchorsCnt); |
| 147 | |
| 148 | mValidCnt = std::make_shared<CudaBind<int32_t>>(mMaxBatchSize); |
| 149 | |
| 150 | PLUGIN_CUASSERT(cudaMemcpy(mValidCnt->mPtr, static_cast<void*>(tempValidCnt.data()), |
| 151 | sizeof(int32_t) * mMaxBatchSize, cudaMemcpyHostToDevice)); |
| 152 | |
| 153 | return STATUS_SUCCESS; |
| 154 | } |
| 155 | catch (std::exception const& e) |
| 156 | { |
| 157 | caughtError(e); |
| 158 | } |
| 159 | return STATUS_FAILURE; |
| 160 | } |
| 161 | |
| 162 | void DetectionLayer::terminate() noexcept {} |
| 163 |
nothing calls this directly
no test coverage detected