Git Product home page Git Product logo

tts's Introduction

⚡ Short Intro ⚡

I am Joel Falcou, Destroyer of World, Terror of the Compilers.

In my spare time, I am an associated professor at the University Paris-Saclay and researcher at the Laboratoire de Recherche d’Informatique in Orsay, France. My research focuses on studying generative programming idioms and techniques to design tools for parallel software development.

I also have a rather personal take on humor as you may have noticed already.

❓ Research Activities ❓

The main parts of my research topic are:

  • the exploration of Embedded Domain Specific Language design for parallel computing on various architectures;
  • the definition of a formal framework for reasoning about meta-programs.

As I need something to pad my academic paper up to at least eight pages, I usually play around with various application fields like real-time image processing on embedded architectures or HPC on multi-core clusters.

👯C++ Community 👯

I am the co-host of the C++FRUG Meetup, president of the C++FRUG Association and I co-organize the CPPP Conference.

You can find me on Mastodon or on the #include Discord

tts's People

Contributors

jfalcou avatar jtlap avatar sadiinsosnowfall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tts's Issues

[BUG] tts compiles copies the values

Example test:

TTS_CASE_TPL("Check top_bits are printable", eve::test::simd::all_types)
<typename T>(tts::type<T>)
{
  using logical = eve::logical<T>;
  using top_bits = eve::top_bits<logical>;
  std::stringstream s;
  top_bits x;
  TTS_EXPECT_COMPILES(s, x, {s << x});
};

Error

/home/dyarosh/space/eve/test/tts/tts.hpp:1124:2: error: use of deleted function 'std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>::basic_stringstream(const std::__cxx11::basic_stringstream<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 1111 | [&]( TTS_ARG(__VA_ARGS__) )                                                                         \
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1112 | {                                                                                                   \
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1113 |   if constexpr( requires TTS_REMOVE_PARENS(EXPR) )                                                  \
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1114 |   {                                                                                                 \
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1115 |     ::tts::global_runtime.pass(); return ::tts::logger{false};                                      \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1116 |   }                                                                                                 \
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1117 |   else                                                                                              \
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1118 |   {                                                                                                 \
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1119 |     TTS_FAIL(     "Expression: " << TTS_STRING(TTS_REMOVE_PARENS(EXPR))                             \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1120 |               <<  " does not compile as expected."                                                  \
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1121 |             );                                                                                      \
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1122 |     return ::tts::logger{};                                                                         \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1123 |   }                                                                                                 \
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1124 | }(__VA_ARGS__)                                                                                      \
      | ~^~~~~~~~~~~~~
/home/dyarosh/space/eve/test/tts/tts.hpp:310:39: note: in expansion of macro 'TTS_EXPECT_COMPILES_IMPL'
  310 | #define TTS_VAL(x)                    x
      |                                       ^
/home/dyarosh/space/eve/test/tts/tts.hpp:1126:34: note: in expansion of macro 'TTS_VAL'
 1126 | #define TTS_EXPECT_COMPILES(...) TTS_VAL(TTS_EXPECT_COMPILES_IMPL TTS_REVERSE(__VA_ARGS__) )
      |                                  ^~~~~~~
/home/dyarosh/space/eve/test/unit/arch/top_bits.cpp:300:3: note: in expansion of macro 'TTS_EXPECT_COMPILES'
  300 |   TTS_EXPECT_COMPILES(s, x, {s << x});
      |   ^~~~~~~~~~~~~~~~~~~
/usr/aarch64-linux-gnu/include/c++/12/sstream:1057:7: note: declared here
 1057 |       basic_stringstream(const basic_stringstream&) = delete;
      |       ^~~~~~~~~~~~~~~~~~
/home/dyarosh/space/eve/test/tts/tts.hpp:1111:1: note:   initializing argument 2 of '<lambda(tts::type<T>)>::<lambda(auto:337, auto:338)> [with auto:337 = eve::top_bits<eve::logical<eve::arm_sve512_v0::wide<unsigned char, eve::fixed<128> > > >; auto:338 = std::__cxx11::basic_stringstream<char>]'
 1111 | [&]( TTS_ARG(__VA_ARGS__) )                                                                         \
      | ^
/home/dyarosh/space/eve/test/tts/tts.hpp:310:39: note: in expansion of macro 'TTS_EXPECT_COMPILES_IMPL'
  310 | #define TTS_VAL(x)                    x
      |                                       ^
/home/dyarosh/space/eve/test/tts/tts.hpp:1126:34: note: in expansion of macro 'TTS_VAL'
 1126 | #define TTS_EXPECT_COMPILES(...) TTS_VAL(TTS_EXPECT_COMPILES_IMPL TTS_REVERSE(__VA_ARGS__) )
      |                                  ^~~~~~~
/home/dyarosh/space/eve/test/unit/arch/top_bits.cpp:300:3: note: in expansion of macro 'TTS_EXPECT_COMPILES'
  300 |   TTS_EXPECT_COMPILES(s, x, {s << x});

Add support for TPL_CASES with meta-generator

Sometimes, we want to use TTS_TPL_CASE but instead of passing a known list of types, the types list need to be generated by a meta-function.

We have to add support such a use case:

template<int N> struct all_array_of
{
  using type = types_<array<int,N>, array<float,N>>:
};

TTS_TPL_CASES2("The scenario", all_array_of<4>)

[BUG] Macros needs braces, I believe

  TTS_EQUAL(movemask(x & y), movemask(x) & movemask(y));

does not work since:

warning: & has lower precedence than ==; == will be evaluated first [-Wparentheses]
  TTS_EQUAL(movemask(x & y), movemask(x) & movemask(y));
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~

Add constexpr check

TTS_CONSTEXPR_EXPECT( EXPR )

do something like

TTS_EXPECT( bool_constant<EXPR>::value )

So we can forcefully check constexpr results of constexpr expression.

[FEATURE] ASSERT instead of EXPECT

When testing a large amount of data, you want to fail on first failure and not continue printing to log one gazillion messages. Needs some ASSERT failed mechanism.

[BUG] Required test doesn't print extra output

Test:

    TTS_EQUAL(expected, actual, REQUIRED)
        << "is_safe: " << is_safe << " m: " << m << " i0: " << i0 << " i1: " << i1;

Output:

[@] - Check compress copy behavior
  >  with [T = eve::wide<double, eve::fixed<4>>]
    [compress_copy_test.hpp:80] - @@ FATAL @@ : Expression: expected == actual is false because: { 6.95293e-310 6.95293e-310 6.95293e-310 4.6615e-310 } != { 0 0 0 0 }
@@ ABORTING DUE TO EARLY FAILURE @@ - 0 Tests not run
----------------------------------------------------------------

[BUG] Using precision tests with unsupported types triggers undefined behavior

Describe the bug
Passing non-integral, non-float types into the precision tests TTS_ABSOLUTE_EQUAL, TTS_RELATIVE_EQUAL or TTS_ULP_EQUAL/TTS_IEEE_EQUAL will cause execution to reach the end of a value-returning function without returning a value in absolute_distance, relative_distance or ulp_distance respectively.

To Reproduce

TTS_CASE("Test")
{
    TTS_ABSOLUTE_EQUAL("a", "b", 0);
};

(see https://godbolt.org/z/3sc5xK4Ko). Or, more likely to happen accidentally in practice:

TTS_CASE("Test")
{
    TTS_ABSOLUTE_EQUAL(std::vector{3}, std::vector{5}, 0);  // oops, meant to use TTS_ALL_ABSOLUTE_EQUAL
};

Expected behavior
I understand of course that this is an error on the user's side and something they have to fix. However, I expected a compilation error (or if not that, at least just a failed test) for such wrong inputs. I think adding a static_assert (something along the likes of https://godbolt.org/z/K886v48bT) or perhaps a concept for the input type of the functions would make this a lot more user-friendly.

Desktop (please complete the following information):

  • OS: any
  • Compiler: any
  • Version: trunk, v2.2, v2.1, v2.0, v1.0, v0.2, v0.1

[BUG] -Wgnu-zero-variadic-macro-arguments fails

Stack overflow

/home/dyarosh/space/eve/build/_deps/tts-src/include/tts/tts.hpp:199:89: note: expanded from macro 'TTS_TEST_ARITY'
#define TTS_TEST_ARITY(...)               TTS_APPLY(TTS_TEST_ARITY_I, (__VA_ARGS__, 2, 1))
                                                                                        ^
/home/dyarosh/space/eve/build/_deps/tts-src/include/tts/tts.hpp:200:9: note: macro 'TTS_TEST_ARITY_I' defined here
#define TTS_TEST_ARITY_I(a, b, c, ...)    c
        ^
In file included from tmp-src/unit.real.core.min/diff.scalar.cpp:19:
/home/dyarosh/space/eve/test/unit/module/real/core/min/diff/min.hpp:18:5: error: must specify at least one argument for '...' parameter of variadic macro [-Werror,-Wgnu-zero-variadic-macro-arguments]
    TTS_EXPR_IS(eve::diff(eve::min)(T(), T()), T);
**Desktop (please complete the following information):**
 - OS: [e.g. Arch Linux]
 - Compiler [e.g. g++ 10.1]
 - Version [e.g. 0.1]

**Additional context**
Add any other context about the problem here.

Add support for randomized tests

For any given unary function, we want to be able to exhaustively tests its return value against a given reference.

This comparison outputs a histogram of the number of value per ULps difference.

Due to the size of the test, this requires threading

[FEATURE] 2 files binaries.

How do I create two or more test files binaries?

Ideally smth like catch:

main.cc

#define TTS_MAIN
#include <tts/tts.hpp>  

test1.cc

namespace {

TTS_CASE("smth") {}

TTS_CASE("smth_else") {}

}. // namespace

test2.cc

namespace {

TTS_CASE("smth_else_entirely") {}

}. // namespace

CmakeList.txt

target_sources(tests PRIVATE
               test1.cc
               test2.cc
               main.cc
)

[FEATURE] Add a TTS_TYPED_EQUAL ?

We sometimes need to test if a and b are equal and have the same type. It is especially true for integral constant.

auto x =  int<5>;
TTS_EQUAL( x, 5); // pass but occult the fixed nature
TTS_TYPED_EQUAL(x,5); // fail , 5 is int
TTS_TYPED_EQUAL(x,int<5>); // pass , int<5> is fixed<5>

Add FetchContent integration method to documentation

This snippet can be added as an example for TTS integration:

include(FetchContent)

FetchContent_Declare(tts_content
  GIT_REPOSITORY https://github.com/jfalcou/tts.git
  GIT_TAG 1.0)

FetchContent_GetProperties(tts_content)
if(NOT tts_content_POPULATED)
  FetchContent_Populate(tts_content)
endif()

include_directories(${tts_content_SOURCE_DIR}/include)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.