CUDA和Open MP [英] CUDA and Open MP

查看:451
本文介绍了CUDA和Open MP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前没有费米,但目标平台是特斯拉/费米,我想问的问题是如果费米支持Open MP,像这样:

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.


推荐答案

是的,像是可能的。当尝试向同一设备(超出流提供)提供多个内核时,OpenMP不提供任何特定的好处,并且如果这是您的意图,则不必实现内核的并发执行。

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.

OpenMP与CUDA的典型用例是管理多个设备

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

这篇关于CUDA和Open MP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆