Skip to content

Build error in case DLAF_ASSERTs are disabled #1333

@albestro

Description

@albestro

The problem is introduced by #1321 with

: Matrix<T, D>((DLAF_ASSERT(size.size() == 2, size.size()),
GlobalElementSize{*size.begin(), *(size.begin() + 1)}),
tile_size, alloc, ld) {}

where the DLAF_ASSERT is used to check the correct size of the initializer_list with a comma operator.

Disabling DLAF_ASSERT makes them "empty" expressions, making the comma operator complaining that the first operand is missing.

In constructor 'dlaf::matrix::Matrix<T, D>::Matrix(std::initializer_list<long int>, const dlaf::TileElementSize&, dlaf::matrix::MatrixAllocation, dlaf::matrix::LdSpec)':
/capstor/store/cscs/cscs/csstaff/ialberto/workspace/dla-future.master/include/dlaf/matrix/matrix.h:97:65: error: expected primary-expression before ',' token
   97 |       : Matrix<T, D>((DLAF_ASSERT(size.size() == 2, size.size()),
      |                                                                 ^

The fix for this might be opinionated, so I opted for opening an issue instead of a PR with one of the possible changes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions