Hi,

I would argue you have some serious problem with your setup if copying 
of 1MB takes time in the order of minutes (and even if its milliseconds, 
i would consider this as way too much). I am also concerned that your 
new cpu timing is 0.

that resizing takes longer on a gpu is expected as you are doing 
something way more complicated when allocating storage on the gpu, 
compared to a cpu.

Also consider doing some real work. computing the norm of a 1MB vector 
is not really something one would consider the gpu for. All simple 
vector operations/reductions are a pain to get fast on a gpu. compare 
matrix-matrix multiplications or similar.

On 2017-02-18 16:02, Sensei wrote:
>> The GPU is an Intel HD Graphics 4000.
>> 
>> What worries me is not only the warmup, but the copy phase. In
>> release it can take a lot of time for a simple 1M items (169
>> seconds!). I suspect I should try to do everything on the GPU. Not
>> only that, but this call:
>> 
>> viennacl::vector<float> gpuv;
>> gpuv.resize(size);
>> 
>> is taking 6 times what it takes on the CPU.
>> 
>> How can I avoid these overheads? I am quite new with OpenCL...
>> 
>> Thank you!
> 
> Sorry, I forgot the log for the twice-computed norm:
> 
> COMPUTING NORM_1 ON GPU
> COMPUTING NORM_1 ON GPU 347
> 
> COMPUTING NORM_1 ON GPU (AGAIN)
> COMPUTING NORM_1 ON GPU 2
> 
> COMPUTING NORM_1 ON CPU
> COMPUTING NORM_1 ON CPU 0
> 
> As you can see, yes, the OpenCL compilation takes a lot of time, but
> still higher than the CPU (with cache and all, I know).
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> ViennaCL-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/viennacl-devel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
ViennaCL-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/viennacl-devel

Reply via email to