Skip to content

Commit 1973849

Browse files
committed
Add empty streaming operator, so that std::cout << SMatrixGPU() does not fail
1 parent dcb767f commit 1973849

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Common/MathUtils/include/MathUtils/SMatrixGPU.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "GPUCommonMath.h"
3030
#include "GPUCommonAlgorithm.h"
3131
#include "GPUCommonLogger.h"
32+
#include "GPUCommonTypeTraits.h"
3233

3334
namespace o2::math_utils::detail
3435
{
@@ -468,6 +469,9 @@ class SMatrixGPU
468469
GPUd() const T& operator()(unsigned int i, unsigned int j) const;
469470
GPUd() T& operator()(unsigned int i, unsigned int j);
470471

472+
template <typename Y, typename X>
473+
GPUd() friend X& operator<<(Y& y, const SMatrixGPU&);
474+
471475
class SMatrixRowGPU
472476
{
473477
public:
@@ -512,6 +516,13 @@ class SMatrixGPU
512516
R mRep;
513517
};
514518

519+
template <class T, unsigned int D1, unsigned int D2, class R, typename Y, typename X = Y>
520+
requires(sizeof(typename X::traits_type::pos_type) != 0) // do not provide a template to fair::Logger, etc... (pos_type is a member type of all std::ostream classes)
521+
GPUd() X& operator<<(Y& y, const SMatrixGPU<T, D1, D2, R>&)
522+
{
523+
return y;
524+
}
525+
515526
template <class T, unsigned int D1, unsigned int D2, class R>
516527
GPUdi() SMatrixGPU<T, D1, D2, R>::SMatrixGPU(SMatrixIdentity)
517528
{

0 commit comments

Comments
 (0)