FWIW, seeing this too. Also, when I boiled the project down to a macOS command
line and run the “leaks" cli I don’t see the leak. 🤔
Ray
> On Oct 14, 2016, at 9:42 AM, Chris Chirogene via swift-users
> wrote:
>
> Xcode8 is showing a memory leak in instruments and the memory graph. I have
>
> On Dec 16, 2016, at 3:54 PM, Richard Wei wrote:
>
> 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 Has
> On Dec 16, 2016, at 15:54, Richard Wei via swift-users
> wrote:
>
> 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-n
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
> On Dec 16, 2016, at 12:10 PM, Richard Wei wrote:
>
> `sync` is not escaping. Shadow copy causes the device memory to make a copy,
> which can’t be a solution either. I’ll file a radar.
>
>> Note that, independently, this part looks fishy:
>>
>>> try! fill<<<(blockSize, blockCount)>>>[
>>>
`sync` is not escaping. Shadow copy causes the device memory to make a copy,
which can’t be a solution either. I’ll file a radar.
> Note that, independently, this part looks fishy:
>
>> try! fill<<<(blockSize, blockCount)>>>[
>>.pointer(to: &self)
>
> UnsafePointers formed by passin
> On Dec 15, 2016, at 11:46 PM, Richard Wei via swift-users
> wrote:
>
> 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+blockS
Below code should work:
let blockSize = min(512, count)
let blockCount = (count+blockSize-1)/blockSize
let boxedClosure = { (foo:inout MutableDeviceCollection) -> () in
device.sync { // Launch CUDA kernel
try! fill<<<(blockSize, blockCount)>>>[
.poi
The original file’s here:
https://github.com/rxwei/cuda-swift/blob/master/Sources/Warp/CollectionOperations.swift
I’m assuming this change has affected Dispatch users as well. It's not a good
idea for such high-level APIs to rely on explicit pointers to pass mutating
self for struct types.
-Ric
It’s not the correct choice here :)
> On Dec 16, 2016, at 03:04, Rien wrote:
>
> Just because it is called “Unsafe” does not mean it is unsafe :-)
> It all depends on how you use it.
>
> Regards,
> Rien
>
> Site: http://balancingrock.nl
> Blog: http://swiftrien.blogspot.com
> Github: http://gi
Just because it is called “Unsafe” does not mean it is unsafe :-)
It all depends on how you use it.
Regards,
Rien
Site: http://balancingrock.nl
Blog: http://swiftrien.blogspot.com
Github: http://github.com/Swiftrien
Project: http://swiftfire.nl
> On 16 Dec 2016, at 09:52, Richard Wei wrote:
Zhao, it’s not a class.
Rien, unsafe pointers is the last thing I would ever want to introduce in my
library…
Capturing self was clean, working perfectly, until Swift 3.0.2.
-Richard
> On Dec 16, 2016, at 02:49, Zhao Xin wrote:
>
> What is the type of self? If it is a class, try [unowned sel
What is the type of self? If it is a class, try [unowned self].
Zhaoxin
On Fri, Dec 16, 2016 at 4:33 PM, Rien via swift-users wrote:
> How about using:
>
> UnsafeMutablePointer
>
> ?
>
> Regards,
> Rien
>
> Site: http://balancingrock.nl
> Blog: http://swiftrien.blogspot.com
> Github: http:
How about using:
UnsafeMutablePointer
?
Regards,
Rien
Site: http://balancingrock.nl
Blog: http://swiftrien.blogspot.com
Github: http://github.com/Swiftrien
Project: http://swiftfire.nl
> On 16 Dec 2016, at 09:10, Richard Wei via swift-users
> wrote:
>
> Capturing makes it immutable, whic
Capturing makes it immutable, which unfortunately can't solve this problem.
-Richard
> On Dec 16, 2016, at 02:05, Zhao Xin wrote:
>
> I did not test the code. But if you cannot implicitly capture a mutating
> self, you should do it explicitly, right?
>
> let blockSize = min(512, count)
> let
I did not test the code. But if you cannot implicitly capture a mutating
self, you should do it explicitly, right?
let blockSize = min(512, count)
let blockCount = (count+blockSize-1)/blockSize
device.sync { *[self] () -> () in* // Launch CUDA kernel
try! fill<<<(blockSize, blockCount)>>>[
16 matches
Mail list logo