Reply to comment

This discussion is closed: you can't post new comments.

Помогите с проблемой измерения времени исполения керналов.

Tagged:  

Такая ситуация

  1. execTime -= cutGetTimerValue( timer);
  2. //запускаю 9 керналов подряд
  3. execTime += cutGetTimerValue( timer);
  4. cutilSafeCall( cudaMemcpy( updateds, d_updateds, 1 * sizeof(int),
  5.                                         cudaMemcpyDeviceToHost) );

Получается время исполнения(значение execTime)
0.086315 мс
если же
  1. execTime -= cutGetTimerValue( timer);
  2. //запускаю 9 керналов подряд
  3. cutilSafeCall( cudaMemcpy( updateds, d_updateds, 1 * sizeof(int),
  4.                                         cudaMemcpyDeviceToHost) );
  5. execTime += cutGetTimerValue( timer);

то получается
8.067453613 мс
Как бы получается что копирование 1 элемента из глобальной памяти занимает ооооочень много времени. Однако
  1. execTime -= cutGetTimerValue( timer);
  2. //запускаю 9 керналов подряд
  3. cutilSafeCall( cudaMemcpy( updateds, d_updateds, 1 * sizeof(int),
  4.                                         cudaMemcpyDeviceToHost) );
  5. cutilSafeCall( cudaMemcpy( flags, d_flags, 12 * sizeof(int),
  6.                                         cudaMemcpyDeviceToHost) );
  7. execTime += cutGetTimerValue( timer);

execTime = 8.082438 мс
Исходя из этих данных получается что коприрование d_updateds( 1 элемент) занимает 8мс а d_flags(12 элементов) 0,015 мс
Что -то тут не так :-)

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <i> <table> <td> <tr> <th>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo].
  • Images can be added to this post.

More information about formatting options

Copyright © 2008-2011 Alex Tutubalin