Welcome to 16892 Developer Community-Open, Learning,Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
646 views
Welcome To Ask or Share your Answers For Others

1 Answer

Error occurred because oupR, outpC value was 0. Sorry for asking bad question.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to 16892 Developer Community-Open, Learning and Share
...