Question

In: Computer Science

Explain the CUDA memory model with respect to ( grid, block, thread)

Explain the CUDA memory model with respect to ( grid, block, thread)

Solutions

Expert Solution

Answer:

CUDA Memory(Compute Unified Device Architecture)

Apart from the device DRAM, CUDA supports several additional types of memory that can be used to increase the CGMA ratio for a kernel. We know that accessing the DRAM is slow and expensive. To overcome this problem, several low-capacity, high-bandwidth memories, both on-chip and off-chip are present on a CUDA GPU. If some data is used frequently, then CUDA caches it in one of the low-level memories. Thus, the processor does not need to access the DRAM every time.The following figure illustrates the memory architecture supported by CUDA and typically found on Nvidia cards

Device code:

  • R/W per-thread registers
  • R/W per-thread local memory
  • R/W per-block shared memory
  • R/W per-grid global memory
  • Read only per-grid constant memory

Thread: This is just an execution of a kernel with a given index. Each thread uses its index to access elements in array such that the collection of all threads cooperatively processes the entire data set.

Block: This is a group of threads. There’s not much you can say about the execution of threads within a block ,they could execute concurrently or serially and in no particular order. You can coordinate the threads, somewhat, using the _syncthreads() function that makes a thread stop at a certain point in the kernel until all the other threads in its block reach the same point.

Grid: This is a group of blocks. There’s no synchronization at all between the blocks.

Host code: This helps in transferring data to/from per grid global and constant memories.

Global Memory:

high-latency memory (the slowest in the figure). To increase the arithmetic intensity of our kernel, we want to reduce as many accesses to the global memory as possible. One thing to note about global memory is that there is no limitation on what threads may access it. All the threads of any block can access it. There are no restrictions, like there are in the case of shared memory or registers.

Constant Memory:

The constant memory can be written into and read by the host. It is used for storing data that will not change over the course of kernel execution. It supports short-latency, high-bandwidth, read-only access by the device when all threads simultaneously access the same location. There is a total of 64K constant memory on a CUDA capable device.

Shared Memory:

All threads of a block can access its shared memory. Shared memory can be used for inter-thread communication. Each block has its own shared-memory. Just like registers, shared memory is also on-chip, but they differ significantly in functionality and the respective access cost.


Related Solutions

Compare between off grid , on grid and Hybrid Inverter , with respect to components ,...
Compare between off grid , on grid and Hybrid Inverter , with respect to components , connection to system , efficiency , applications and main suppliers please put the answer in the table, them i swear i will rate u.. Quickly please thanks!
What is the main benefit of thread synchronization? Why do you think CUDA does not allow...
What is the main benefit of thread synchronization? Why do you think CUDA does not allow block synchronization?
explain the john adairs model and managerial grid with an example.
explain the john adairs model and managerial grid with an example.
Suppose that the collector is held at a small negative voltage with respect to the grid....
Suppose that the collector is held at a small negative voltage with respect to the grid. Will the accelerated electrons reach the collecting plate? Suppose that the collector is held at a small negative voltage with respect to the grid. Will the accelerated electrons reach the collecting plate? Yes, but only those electrons with energy less than the potential difference established between the grid and the collector will reach the collector. Yes, but only those electrons with energy greater than...
New electric grid elements and technologies are changing the traditional grid model of “generation ? transmission...
New electric grid elements and technologies are changing the traditional grid model of “generation ? transmission ? distribution ? load.” Identify what these new disruptive technologies and initiatives are and describe the impacts that each of these is likely to have on the traditional grid.
13. Briefly describe the three-stage model of memory, and explain how the memory stages interact. Also,...
13. Briefly describe the three-stage model of memory, and explain how the memory stages interact. Also, explain how flashbulb memories demonstrate that emotions and memories are interrelated. In your opinion, how does this overlap between emotions and memories contribute to the accuracy of one’s memories?
Three towns, A, B, and C, have a funny arrangement with respect to the power grid....
Three towns, A, B, and C, have a funny arrangement with respect to the power grid. They all get their power from a single hydraulic power plant up the river. Both cities A and B each have power lines that supply power directly from the plant. Furthermore, there is a supply line between A and B, so that either city will not lose power in the case that one of their direct lines from the plant fails. (Of course, if...
Of the following items, which are stored in the thread control block, which are stored in the process control block, and which in neither?
Of the following items, which are stored in the thread control block, which are stored in the process control block, and which in neither? a. Page table pointer b. Page table c. Stack pointer d. Segment table e. Ready list f CPU registers Program counter
Implement a Linux Block Driver which simulates a block device with a region of memory init,...
Implement a Linux Block Driver which simulates a block device with a region of memory init, exit, and IO functionalities must be included. Please use either C or C++ Programming for this Thank You!
Explain the associative network memory model of brand equity. Provide examples.
Explain the associative network memory model of brand equity. Provide examples.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT