patflick / miopen-benchmark

benchmarking miopen
BSD 3-Clause "New" or "Revised" License
17 stars 15 forks source link

Invalid operands to binary expression for F.get() in multi_layers.hpp #5

Closed mattsinc closed 6 years ago

mattsinc commented 7 years ago

Upon downloading a fresh, up-to-date copy of the repo, and trying to compile them, I get the following (identical) errors in multi_layers.hpp:

In file included from resnet.cpp:5: ./multi_layers.hpp:277:22: error: invalid operands to binary expression ('int' and 'nullptr_t') assert(F.get() != nullptr);

./multi_layers.hpp:282:22: error: invalid operands to binary expression ('int' and 'nullptr_t') assert(F.get() != nullptr);

The simple fix is to change nullptr to NULL, or to overload !=, but it seems strange to me that the comparison to nullptr for F throws an error, while the identical checks for G does not fail (even though G and F are the same type). Not sure if there is a compiler version, include, or library issue?

Matt

patflick commented 7 years ago

This is pretty odd.

The shared pointer get() function should return a pointer Function* and not int (http://en.cppreference.com/w/cpp/memory/shared_ptr/get). I'm not quite sure why this error would arise. What compiler and C++ std library version are you using? Is it possible that you overloaded F somehow? Are you compiling with c++11 or higher (this is required)?

mattsinc commented 7 years ago

Yeah, it seemed strange to me too. I have not made any changes to the code, I even cloned a fresh copy of the repo and tried that to make sure it wasn't anything I could have changed. So I don't think I overloaded F.

Compiler: HCC clang version 5.0.0 (based on HCC 1.0.17262-7871d33-3953233-56b5abe ) C++: gcc/g++ 5.4.0 20160609, GLIBCXX has several versions installed, from 3.4 --> 3.4.21

Matt

patflick commented 7 years ago

I honestly have no clue. What happens if you remove the asserts? Does it compile and work?

mattsinc commented 7 years ago

If I change nullptr to NULL on both of those lines, it compiles with the following warnings (only showing for line 277 for brevity):

In file included from alexnet.cpp:5: ./multi_layers.hpp:277:24: warning: comparison between NULL and non-pointer ('bool' and NULL) [-Wnull-arithmetic] assert(F.get() != NULL);

In file included from alexnet.cpp:5: ./multi_layers.hpp:277:9: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses] assert(F.get() != NULL);

So it seems to compile happily. I am having a problem running them though, which leads into another question: is there any reason why I couldn't run these benchmarks on a gfx801 or gfx803 compliant GPU (assuming MIOpen, MIOpenGEMM are compliant with gfx801/803)? Or do they only support gfx900? Because the error I'm having is:

HCC RUNTIME ERROR: Fail to find compatible kernel at file: (...)

I am still digging through trying to figure out if this is really just an error with the target architecture or not though (I changed the Makefile target to 801 before compiling).

Matt

patflick commented 7 years ago

Not sure about the architecture support. @dagamayank might be able to help.

mattsinc commented 7 years ago

I believe @dagamayank told me previously that MIOpen only supports 803 and 900. However, I was able to get 9/10 of the basic MIOpen tests (the ones that come with make check in MIOpen) running on 801, so I was looking to see if these also ran on 801. The failure here is different from the failure for the basic tests though.

Matt