<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">Hi,</span></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">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?</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> blockSize = </span><span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">min</span><span style="font-variant-ligatures: no-common-ligatures" class="">(512, </span><span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">count</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> blockCount = (</span><span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">count</span><span style="font-variant-ligatures: no-common-ligatures" class="">+blockSize-1)/blockSize</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">device</span><span style="font-variant-ligatures: no-common-ligatures" class="">.sync { // Launch CUDA kernel</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">try</span><span style="font-variant-ligatures: no-common-ligatures" class="">! fill&lt;&lt;&lt;</span><span style="font-variant-ligatures: no-common-ligatures" class="">(blockSize, blockCount)&gt;&gt;&gt;[</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;.pointer(to: &amp;</span><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">self</span><span style="font-variant-ligatures: no-common-ligatures" class="">), .value(value), .value(</span><span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">Int64</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">count</span><span style="font-variant-ligatures: no-common-ligatures" class="">))</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;]</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><img apple-inline="yes" id="71C69807-0FFC-443D-8B4A-8C4D1A477885" src="cid:609F752C-C004-45F5-8EB2-A1D0ECB1FE58@connectivityu.com" class=""></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-size: 11px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-size: 11px;" class="">-Richard</span></div></body></html>