Code Monkey home page Code Monkey logo

cachedfunctions.jl's People

Contributors

longemen3000 avatar pallharaldsson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

pallharaldsson

cachedfunctions.jl's Issues

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Readme example doesn't run?

using CachedFunctions
function f!(y,x)
    y[1] = exp(sum(x))
    y[2] = x[1]+x[2] - x[3]
    y
end

x1 = rand(3)
x2 = rand(3)
x3 = rand(Float32,3)
x4 = rand(Float32,3)

f = CachedFunction(f!,3,2)

Returns

ERROR: MethodError: no method matching prototype(::Int64)

I'm using Version 1.5.4 (2021-03-11)

Multiple input argument support [enhancement]

Thanks a lot for the package, I think this will really help me reduce allocation-based slowdown in my application.

One incompatibility I have is that my functions are for dynamical systems and are of the form f!(y,x,t), i.e. I pass in the time t::Number in addition to the state vector x::Vector, and y=similar(x).

This seems like the sort of thing Julia should be able to generalize to cover really easily, but I can't see how to force this into the mold of a single input state vector without allocating push!(x,t) which defeats the purpose of caching.

Multihreading Support

as mencioned by tkf in discourse, there is a need to make this structure Thread-safe. there are some approaches to this:

  • lock on call: everytime that a call is done, lock, wait for the result and unlock. but this has the obvious disadvantage that in a multithreaded setting, the execution would be linear, defeating the purpose
  • duplicate caches: each thread can only access one cache. that maybe be acomplished by using the key(eltype(x),Val(threadId)). What i don't know is if the get call to the thread function is safe itself.

To test this, a good example is also necessary

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.