Code Monkey home page Code Monkey logo

jitcat's People

Contributors

mvhooren avatar zueuk 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

Forkers

zueuk

jitcat's Issues

Unnecessary if's in CatFunctionCall::execute()

I wanted to add more trigonometric functions, and noticed this:

case CatBuiltInFunctionType::Sin:
    if (argumentTypes[0].isFloatType())
    {
        return (float)std::sin(std::any_cast<float>(argumentValues[0]));
    }
    else
    {
        return (float)std::sin((float)std::any_cast<int>(argumentValues[0]));
    }

happening a lot.

As I understand, this branching would make sense if return type depended on the argument type(s), but in many cases the result is always float - so the only problem is converting type of the argument value - and I see that there is a CatGenericType::convertToFloat(), that seems to do exactly that.

Wouldn't be better to rewrite these functions like this:

case CatBuiltInFunctionType::Sin:
    return (float)std::sin(CatGenericType::convertToFloat(argumentValues[0], argumentTypes[0]));

Segfault on Windows/MSVC in release builds when using a recent checkout of LLVM

This is due to an incompatibility between LLVM compiled with C++14 and JitCat compiled with C++17. I have filed a bugreport with LLVM: https://bugs.llvm.org/show_bug.cgi?id=44131

Meanwhile a workaround is to find Compiler.h in the llvm repo and commenting out or delete the #ifdef __cpp_aligned_new blocks within the allocate_buffer and deallocate_buffer functions.
Like this:

inline void *allocate_buffer(size_t Size, size_t Alignment) {
  return ::operator new(Size
/*#ifdef __cpp_aligned_new
                        ,
                        std::align_val_t(Alignment)
#endif*/
  );
}

and

inline void deallocate_buffer(void *Ptr, size_t Size, size_t Alignment) {
  ::operator delete(Ptr
#ifdef __cpp_sized_deallocation
                    ,
                    Size
#endif
/*#ifdef __cpp_aligned_new
                    ,
                    std::align_val_t(Alignment)
#endif*/
  );
}

Found abs() being tested instead of tan()

SECTION("Tan_obj")
{
    Expression<float> testExpression(&context, "abs(nestedObject)");
    doChecks(0.0f, true, false, false, testExpression, context);
}

Won't be surprized if there's more, that Tests.cpp is way too big...

llvm::make_unique() is no longer a thing

LLVM seems to have migrated to C++14, and no longer has its own version of make_unique().
I had to search/replace it with std::make_unique() in the JitCat sources to compile it.

Expression<double> gives a compile error

The BasicExample fails to compile if I just replace the float type with double.

Whoops, my bad - it seems that this type needs to be added to CatGenericTypes first.

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.