全局功能和设备功能之间的区别 [英] Difference between global and device functions

查看:97
本文介绍了全局功能和设备功能之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能描述 __ global __ __ device __ 之间的区别?

Can anyone describe the differences between __global__ and __device__ ?

何时应使用 __ device __ ,何时应使用 __ global __ ?。

When should I use __device__, and when to use __global__?.

推荐答案

全局函数也称为内核。是您可以使用CUDA内核调用语义(<<< ...>> )从主机端调用的函数。

Global functions are also called "kernels". It's the functions that you may call from the host side using CUDA kernel call semantics (<<<...>>>).

只能从其他设备或全局功能调用设备功能。 __ device __ 函数不能从主机代码中调用。

Device functions can only be called from other device or global functions. __device__ functions cannot be called from host code.

这篇关于全局功能和设备功能之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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