[swift-users] DLVM: Swift-based machine learning compiler and DSLs

2017-11-10 Thread Richard Wei via swift-users
Hi swift-users, I’m sharing a project I created in academia. DLVM is a modern compiler infrastructure for deep learning systems, inspired obviously by LLVM and SIL. DLVM has a linear algebra IR, automatic differentiation, domain-specific optimizations and a CPU/GPU code generator. NNKit, a stag

Re: [swift-users] Implicitly capture a mutating self

2016-12-16 Thread Richard Wei via swift-users
Thanks. That’s true, but there are cases (like making BLAS calls) where I have to nest more than 4 `withUnsafeMutable…` closures. It’s safe by really clumsy. I just wish there were a cleaner way that looks like the do-notation in Haskell or for-notation in Scala. -Richard > On Dec 16, 2016, at

Re: [swift-users] Implicitly capture a mutating self

2016-12-16 Thread Richard Wei via swift-users
s to the kernel are passed in by pointers, IMO using a bunch of `withUnsafe...` clauses would only make it look unnecessarily clumsy. -Richard > On Dec 16, 2016, at 12:41, Joe Groff wrote: > > >> On Dec 15, 2016, at 11:46 PM, Richard Wei via swift-users >> wrote: >>

Re: [swift-users] Implicitly capture a mutating self

2016-12-16 Thread Richard Wei via swift-users
t;>>> >>>> >>>> >>>> On Fri, Dec 16, 2016 at 4:33 PM, Rien via swift-users >>>> wrote: >>>> How about using: >>>> >>>> UnsafeMutablePointer >>>> >>>> ? >>>> >>>&g

Re: [swift-users] Implicitly capture a mutating self

2016-12-16 Thread Richard Wei via swift-users
f]. >>> >>> Zhaoxin >>> >>> >>> >>> >>> >>> >>> On Fri, Dec 16, 2016 at 4:33 PM, Rien via swift-users >>> wrote: >>> How about using: >>> >>> UnsafeMutablePointer >>&g

Re: [swift-users] Implicitly capture a mutating self

2016-12-16 Thread Richard Wei via swift-users
> Site: http://balancingrock.nl <http://balancingrock.nl/> > Blog: http://swiftrien.blogspot.com <http://swiftrien.blogspot.com/> > Github: http://github.com/Swiftrien <http://github.com/Swiftrien> > Project: http://swiftfire.nl <http://swiftfire.nl/> > > > > > &g

Re: [swift-users] Implicitly capture a mutating self

2016-12-16 Thread Richard Wei via swift-users
t; Hope above code works. > > Zhaoxin > > On Fri, Dec 16, 2016 at 3:46 PM, Richard Wei via swift-users > mailto:swift-users@swift.org>> wrote: > Hi, > > Swift 3.0.2 seems to have broken my code due to mutating self capture. But I > have to pass inout se

[swift-users] Implicitly capture a mutating self

2016-12-15 Thread Richard Wei via swift-users
Hi, Swift 3.0.2 seems to have broken my code due to mutating self capture. But I have to pass inout self to the closure. Any workaround? let blockSize = min(512, count) let blockCount = (count+blockSize-1)/blockSize device.sync { // Launch CUDA kernel try! fill<<<(blockSize,

[swift-users] [SwiftPM] Build system module package to .a/.dylib?

2016-10-30 Thread Richard Wei via swift-users
Hi, Is there a way to build a system module package into a static/dynamic library, so that a Swift script can link against this library to find the module? Adding library products to Package.swift doesn’t seem to work. Thanks, Richard ___ swift-user