[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-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,

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

2016-12-16 Thread Richard Wei via swift-users
org> wrote: >>> How about using: >>> >>> UnsafeMutablePointer >>> >>> ? >>> >>> Regards, >>> Rien >>> >>> Site: http://balancingrock.nl >>> Blog: http://swiftrien.blogspot.com >>> G

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,

[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