What is the CPU and GPU cache application for Cache?

What is Cache

basic concept

In the hierarchy of computer storage systems, high-speed, small-capacity memory is located between the central processor and main memory. Together with the main memory, it constitutes a level 1 memory. The scheduling and transmission of information between the cache memory and the main memory is performed automatically by the hardware.

Some machines even have a second-level L3 cache. Each cache is slower and has a larger capacity than the previous cache.

What is CacheCache CPU and GPU for cache applications

Composition structure

The cache memory is a primary memory existing between the main memory and the CPU, and is composed of a static memory chip (SRAM), which has a relatively small capacity but is much faster than the main memory and is close to the speed of the CPU.

It consists of three major components:

Cache memory: Stores instructions and data blocks loaded by main memory.

Address translation component: Create a directory table to achieve the conversion of the main memory address to the cache address.

Replacement component: When the buffer is full, replace the data block according to a certain strategy, and modify the address conversion component.

In recent years, GPUs have been widely used and high-performance fields, and their general-purpose computing capabilities have also been further utilized. Compared with the traditional CPU, GPU has obvious advantages in processing capacity and memory bandwidth, and does not need to pay too much cost and power consumption.

In the current mainstream CPU+GPU architecture, CPUs and GPUs are generally connected to each other via Northbridge chips, and each has its own external memory, which is memory and video memory. In this hybrid architecture, the CPU is responsible for logic-intensive things, and the GPU is mainly responsible for the higher computationally intensive parts. The difference in the design purpose leads to the difference in the architecture at design time. The difference in these architectures also ultimately affects their performance.

Why does the CPU need a lot of cache?

For a single CPU core, usually only one thread of instructions can be run at a time, and its multi-threading mechanism is parallel at the software level. When a thread interrupts or waits for certain resources, the operating system needs to perform a context switch, which usually brings huge overhead. Therefore, a large number of caches are needed to filter excessive memory accesses, reduce the latency of the access memory, and increase the response speed of the CPU. For the consistency of the cache, a complicated replacement mechanism is also needed, and a complicated logic control unit is needed.

On the other hand, in order to increase parallelism at the single-core instruction level, modern CPUs use superscalar, superpipelined, and extremely long instruction words. The operation of these methods also requires complex branch prediction mechanisms and a large number of caches.

Why doesn't a GPU need a lot of cache?

There is no complicated caching architecture and replacement mechanism in the GPU, and its cache is read-only, so there is no need to consider the cache consistency problem. The main function of the GPU cache is to filter requests to the memory controller and reduce the access to the video memory to resolve the memory bandwidth.

The GPU does not require a large amount of cache, another important reason is that the GPU handles a large number of parallel tasks. Its large number of blocks and a large number of threads of the same block guarantees that the GPU can implement zero-overhead thread switching. When a thread interrupts while waiting for resources, it goes to another ready thread to execute, where thread switching becomes a good thing. The delay can be hidden by calculation.

Draft-waiting For Releasing

There are some draft products here, which will not be displayed on the website. These products can be modified later to enrich the content of the website. If you want to know more about our company, you can go to our website to check, there will be what you want, or you can consult us. Nice to meet you and looking forward to our cooperation.

Draft-waiting For Releasing,Draft-waiting For Releasing,Draft-waiting For Releasing

ETOP WIREHARNESS LIMITED , https://www.wireharnessetop.com