See the code in src/device.jl that implements the do-block syntax (especially functions that take a function as their first argument). It's not a big file, so shouldn't be too hard to figure out what's happening.
--Tim On Tuesday, November 10, 2015 02:16:52 PM Andrei Zh wrote: > > But I can replicate the bug if I use CURAND. I'd suggest filing an issue > > with > > that package. Most likely it needs to (and, you need to) initialize > > resources > > according to these instructions: > > https://github.com/JuliaGPU/CUDArt.jl#initializing-and-freeing-ptx-modules > > CURAND.jl is a thin wrapper around the corresponding C library and doesn't > use any custom modules, so I suppose initializing resources is not > applicable to this case. > > Tim, except for loading utility functions (PtxUtils), is there anything > special in `device() ... do` block that I should pay attention to?