CPU和GPU的差异 [英] CPU and GPU differences

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

问题描述

CPU的单个处理单元和GPU的单个处理单元有什么区别?


我在互联网上遇到的大多数地方都掩盖了两者之间的高度差异。我想知道每个指令可以执行什么指令,它们执行的速度有多快?这些处理单元如何集成到竞争体系结构中?


似乎是一个长答案的问题。所以很多链接都很好。



编辑:

在CPU中,FPU运行实数运算。每个GPU内核中完成相同操作的速度有多快?如果快,那为什么会快?


我知道我的问题很普通,但是我的目标是要回答这样的问题。

What is the difference between a single processing unit of CPU and single processing unit of GPU?
Most places I've come along on the internet cover the high level differences between the two. I want to know what instructions can each perform and how fast are they and how are these processing units integrated in the compete architecture?
It seems like a question with a long answer. So lots of links are fine.

edit:
In the CPU, the FPU runs real number operations. How fast are the same operations being done in each GPU core? If fast then why is it fast?
I know my question is very generic but my goal is to have such questions answered.

推荐答案

简短答案



GPU与CPU之间的主要区别在于,GPU被设计为在许多独立数据元素上并行执行相同的操作,而CPU被设计为

Short answer

The main difference between GPUs and CPUs is that GPUs are designed to execute the same operation in parallel on many independent data elements, while CPUs are designed to execute a single stream of instructions as quickly as possible.

部分问题要问


在CPU中,FPU运行实数运算。每个GPU内核中完成相同的
操作有多快?如果很快,为什么会这么快?

In the CPU, the FPU runs real number operations. How fast are the same operations being done in each GPU core? If fast then why is it fast?

这是指CPU和GPU中使用的浮点(FP)执行单元。 主要区别不是如何实现单个FP执行单元。相反,不同之处在于,CPU内核将只有少数几个FP执行单元以独立指令进行操作,而GPU将有数百个FP执行单元以独立数据进行操作。平行。

This refers to the floating point (FP) execution units that are used in CPUs and GPUs. The main difference is not how a single FP execution unit is implemented. Rather the difference is that a CPU core will only have a few FP execution units that operate on independent instructions, while a GPU will have hundreds of them that operate on independent data in parallel.

GPU最初是为图形应用程序执行计算而开发的,在这些应用程序中,相同的操作在数百万个不同的数据点上重复执行(想象一下应用一个屏幕上的每个像素)。通过使用 SIMD SIMT 操作GPU减少了处理单个指令的开销,但需要多个指令以锁步方式进行操作。

GPUs were originally developed to perform computations for graphics applications, and in these applications the same operation is performed repeatedly on millions of different data points (imagine applying an operation that looks at each pixel on your screen). By using SIMD or SIMT operations the GPU reduces the overhead of processing a single instruction, at the cost of requiring multiple instructions to operate in lock-step.

后来的 GPGPU编程之所以流行,是因为除了图形之外,还有许多其他类型的编程问题模型。主要特征是问题是数据并行的,即可以在许多单独的数据元素上独立执行相同的操作。

Later GPGPU programming became popular because there are many types of programming problems besides graphics that are suited to this model. The main characteristic is that the problem is data parallel, namely the same operations can be performed independently on many separate data elements.

与GPU相比,CPU经过优化可以执行尽快完成一条指令流。 CPU使用流水线处理,缓存,分支预测,乱序执行等方法来实现此目标。执行单个浮点指令所花费的大多数晶体管和精力都花费在管理指令流经管线而不是FP执行单元的开销中。尽管GPU和CPU的FP单元可能会有所不同,但这并不是两种架构之间的主要区别。主要区别在于指令流的处理方式。 CPU也往往在单独的内核之间具有缓存一致性内存,而GPU则没有。

In contrast to GPUs, CPUs are optimized to execute a single stream of instructions as quickly as possible. CPUs use pipelining, caching, branch prediction, out-of-order execution, etc. to achieve this goal. Most of the transistors and energy spent executing a single floating point instruction is spent in the overhead of managing that instructions flow through the pipeline, rather than in the FP execution unit. While a GPU and CPU's FP unit will likely differ somewhat, this is not the main difference between the two architectures. The main difference is in how the instruction stream is handled. CPUs also tend to have cache coherent memory between separate cores, while GPUs do not.

当然,具体的CPU和GPU的实现方式有很多变化。但是高级编程的不同之处在于,GPU针对数据并行工作负载进行了优化,而CPU内核针对尽快执行一条指令流进行了优化。

There are of course many variations in how specific CPUs and GPUs are implemented. But the high-level programming difference is that GPUs are optimized for data-parallel workloads, while CPUs cores are optimized for executing a single stream of instructions as quickly as possible.

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

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