Re: Audio/Video File Read/Write Support In NIM

2017-09-09 Thread cumulonimbus
The most complete library for audio/video file reading, writing, decoding, and everything else is ffmpeg's (the library is called "libav", but there's a fork of ffmpeg called "libav" so it's really confusing; so I'll just call it "ffmpeg") There is no other offering, free or not, that has compa

Re: Custom memory allocator and memory region

2017-09-09 Thread Araq
`--gc:regions` will let you do that and is not far away, maybe a couple of weeks...

Re: Custom memory allocator and memory region

2017-09-09 Thread LeuGim
Yes, seems you're right. Then you probably need to create something seq-like via pointers, with `alloc` and the like...

Re: Custom memory allocator and memory region

2017-09-09 Thread mratsim
Interesting, however if I understand this correctly: proc newMySeq[T](size = 0.Natural): Cuda ptr MySeq[T] = result = cast[ptr[Cuda, MySeq[T]]](alloc sizeOf(MySeq[T])) result.data = newSeq[T](size) `result = ...` uses the custom allocator for the pointer to result.da

Re: Custom memory allocator and memory region

2017-09-09 Thread LeuGim
While direct support for seqs and strings is not here (it's planned, according to the manual), you can wrap them in objects. type MySeq[T] = object data: seq[T] Cuda = object var foo = cast[ptr[Cuda, MySeq[int]]](alloc sizeOf(MySeq[int])) foo.data = n

Re: Custom memory allocator and memory region

2017-09-09 Thread mratsim
Thanks, that's really cool. If I can't use a custom allocator with "new" or "newSeq" in the next couple months, I will probably go with that.

Re: Custom memory allocator and memory region

2017-09-09 Thread LeuGim
Well, just following that manual section and compiler messages, replace `memRegion` (a variable) in the last line with a type, the type you want to point to, `PinnedArray[int]` in your case, and to the left to that `ptr` put another object type, serving to distinguish your memory region, like:

Custom memory allocator and memory region

2017-09-09 Thread mratsim
I would like to use `cudaHostAlloc` as a custom allocator. It's a replacement to C `malloc` that * allocates page-locked memory * greatly improve Host<->GPU memory transfer via Direct Memory Access * enable non-blocking host<->GPU memcpy w.r.t. both host and GPU computations Here is [Nim

Re: Killing an AsyncHttpServer

2017-09-09 Thread def_pri_pub
Yeah, I have the killServer = true in a block somewhere. Adding return after server.close() does work, but I need to mark server with {.threadsafe.}. It also causes an issue with the HTTP Request (on the browser side) doesn't get finished and just hangs. Interestingly enough this doesn't actual

c2nim - Multi-character constants and structs

2017-09-09 Thread emg
Hi all, I'm trying to use c2nim tool to convert some internal c library's header and I ran into two issues. The C Header has preprocessor defines like the following #define TK_DataType_FBR 'FBR8' Trying to parse this gives me an error like this