Skip to content

Commit

Permalink
workaround for disappearing assertions
Browse files Browse the repository at this point in the history
We sometimes use assertions in a constexpr context.
For this, we use the comma operator like

  return GKO_ASSERT(...), value;

For some constellation of include files

  #include <ginkgo/core/base/math.hpp>
  #include <gtest/gtest.h>
  #include <hip/hip_runtime.h>
  #include "hip/test/utils.hip.hpp"

the assertions in gko::dim disappear completely for reasons
I did not want to chase down too much

  include/ginkgo/core/base/dim.hpp(109): error: expected an expression

This is a simple workaround for that issue
  • Loading branch information
upsj committed Mar 3, 2020
1 parent 612ed9c commit 8891e79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion hip/test/base/hip_executor.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************<GINKGO LICENSE>*******************************/

// prevent compilation failure related to disappearing assert(...) statements
#include <hip/hip_runtime.h>


#include <ginkgo/core/base/executor.hpp>


Expand All @@ -38,7 +42,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include <gtest/gtest.h>
#include <hip/hip_runtime.h>


#include <ginkgo/core/base/exception.hpp>
Expand Down
5 changes: 4 additions & 1 deletion hip/test/base/math.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************<GINKGO LICENSE>*******************************/

// prevent compilation failure related to disappearing assert(...) statements
#include <hip/hip_runtime.h>


#include <ginkgo/core/base/math.hpp>


Expand All @@ -39,7 +43,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include <gtest/gtest.h>
#include <hip/hip_runtime.h>


#include <ginkgo/core/base/array.hpp>
Expand Down

0 comments on commit 8891e79

Please sign in to comment.