全局功能和设备功能之间的区别

全局功能和设备功能之间的区别

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

问题描述

限时删除!!

谁能描述 __ 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.

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

1403页,肝出来的..

09-06 09:13