Weird transfer time characteristic for Matlab 1kB H->D using Matlab

Hi,

I’m looking for fastes possible method of transfer data to GPU on Matlab. Look what weird trasfer time characteristic I’ve got.

Could anyone explain me, why transferring more than 1kB lasts 800% longer than less than 1kB?

I’m using Gainwardâ„¢ GeForce GTX 260, 1792 MB DDR3. Compute Capability 1.3.
weirdTransferr.png

A behavior like this is expected as CPU->GPU transfers under a certain size will be asynchronous, while longer transfers are done synchronously. The only surprise is if this jump occurs at 1 KB. The limit should actually be 64 KB, which would better fit with the labeling of your graph (assuming the jump actually happens at 8192 double values = 64 KB).

I’m sure it’s 1 KB and it must be something different than asynchronous data transfer because I’ve made the same test writing application in C and got graph without this jump. C graph is a line on 0.15 sec for the same data size.

If you want to load data directly onto the GPU and into MATLAB, avoiding the MATLAB overhead, use the Jacket SDK. Learn more here: http://blog.accelereyes.com/blog/2010/10/29/jacket_sdk_trumps_mex/