I wanted to perform maxPool with C++ AMP. However, whenever I execute the code I face unexpected runtime exception and program just gets terminated.
Here is part of the code :
PoolLayer.h :
class PoolLayer : public Layer {
private:
const int outpR, outpC, pR, pC, inpR, inpC, depth;
std::vector<int> r_coordinate, c_coordinate;
Tensor forwardPassGPU(const Tensor& input) override;
}
PoolLayer.cpp:
Tensor PoolLayer::maxPoolGPU(const Tensor& input, int depth) {
Tensor ret(depth, outpR, outpC);
array_view<double, 3> aret(depth, outpR, outpC, ret.list); // exception occurs
array_view<const double, 3> ainput(depth, inpR, inpC, input.list); // exception doesn't occur
array_view<int, 3> ar_coord(depth, outpR, outpC, r_coordinate); // exception occurs
array_view<int, 3> ac_coord(depth, outpR, outpC, c_coordinate); // exception occurs
// ... do maxpool
}
Tensor is a class that I created, which has vector type variable "list". When I execute this code I get the error like : Microsoft C++ exception: Concurrency::runtime_exception, memory location 0x00D3F5A0. Currently I am using Visual Studio 2019, std:c++17 compiler. Also, I added /Zc:noexceptTypes- in command line to avoid any dynamic exception issues. Is there any way to solve this issue?