CUDA and Open MP

无人久伴 提交于 2020-01-03 03:43:07

问题


I dont have a Fermi at the moment but the targetting platform is tesla/Fermi, the question I want to ask is if Fermi support Open MP like this:

#pragma omp parallel for num_threads(N)

for (int i=0; i<1000; ++i)
{
  int threadID=omp_get_thread_num();
  cudafunctions<<<blocks, threads, 1024, streams[threadID]>>>(input+i*colsizeofinput);
}//where there are N streams created.

回答1:


Yes, something like that is possible. OpenMP doesn't provide any specific benefit when trying to launch multiple kernels to the same device (beyond what streams provide) and isn't necessary to achieve concurrent execution of kernels, if that is your intent.

A typical use case for OpenMP with CUDA is to manage multiple devices.



来源:https://stackoverflow.com/questions/15401145/cuda-and-open-mp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!