Giter VIP home page Giter VIP logo

Comments (3)

mratsim avatar mratsim commented on August 17, 2024

And another showstopper bug was laying in wait, preventing the obvious workaround of getting the impl field out of the union: nim-lang/Nim#13093

So if that isn't solvable upstream in a reasonable time we will have to:

  • either only support C (and so no MSVC support)
  • or disable dataflow parallelism/pledges in C++ mode. (code touched is in nim-lang/Nim#13093)

from weave.

mratsim avatar mratsim commented on August 17, 2024

Adding to the C++ woes syncScope does not work with the C++ backend if used in a for loop: nim-lang/Nim#14118

Unfortunately that's where it's the most useful, to sync all tasks before going to the next iteration (which often updates the same buffer in-place hence why synchronization is needed)

from weave.

mratsim avatar mratsim commented on August 17, 2024

The bad codegen is due to atomics being non-copyable and non-movable in C++

Unfortunately due to Nim's new case-object rules we have to copy/move them in the code here:

proc initialize*(pledge: var Pledge, pool: var TLPoolAllocator, start, stop, stride: int32) =
## Initialize a pledge for iteration tasks
preCondition: stop > start
preCondition: stride > 0
preCondition: pledge.p.isNil
pledge.p = pool.borrow(deref(PledgePtr))
# We start refcount at 0 - and the need to workaround case object value change is a huge pain
pledge.p[] = deref(PledgePtr)(
kind: Iteration,
numBuckets: (stop - start + stride-1) div stride,
start: start,
stop: stop,
stride: stride
)

Following nim-lang/RFCs#209 and nim-lang/Nim#13995 this will be relaxed for --gc:arc however --gc:arc had several other issues related to threading at the moment and Weave base functionalities should work with most GC.

--> Avoid Nim case-objects and build our own.

from weave.

Related Issues (20)

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.