#pragma once #include "../common.hpp" namespace kel { namespace lbm { template saw::data> round_to_unsigned(const saw::data>& inp){ saw::data> rv; auto zero = static_cast::type>(0); auto half = static_cast::type>(0.5); for(uint64_t i{0u}; i < D; ++i){ auto val = inp.at({{i}}).get()+half; val = std::max(zero,val); rv.at({i}).set(static_cast(val)); } return rv; } } }