1.
질문 1Constant memory size on a GPU is in direct relation to the number of streaming multiprocessors (SMs).
False
This is the correct answer. Based on the GPU device, there is a fixed maximum amount of constant memory that can be allocated, which is not based on the number of SMs.
2.
Shared memory sizes for GPU devices has always been larger than 128 MB.
False
3.
질문 3The extern keyword is used in conjunction with shared memory allocation in which execution target(s) to indicate dynamic memory will be shared on the GPU card?
device
This keyword indicates that this function is executed on the GPU and being called by a function also on the device. When the extern keyword is used during memory allocation on the GPU, the memory available is dynamic, determined during runtime.
global
This keyword indicates that the function will executed on the device, and in this case shared memory would be dynamic.
4.
질문 4
Which keyword is used as part of shared memory allocation?
__shared__
5.
질문 5When writing code that uses shared memory, which of the following are valid considerations (pros and cons) for whether to use this type of memory?
Shared memory can be faster than global memory
This is correct because if the size of shared memory allocation is within per SM limits, it will be faster than global memory.
Shared memory is an mechanism for threads within the same block to share data in a fast manner.
This is correct. It is a common way for threads within a block to communicate, such as giving access to interim results that will not be placed in global memory.
The value in shared memory may change based on the logical and physical order of reads and writes, so tools such as thread barriers will need to be considered.
This is correct, as you will need to consider this when developing device kernels.
6.
질문 6
Which function is used to allocate transfer data from the host to device constant memory?
cudaMemcpyToSymbol
'Coursera' 카테고리의 다른 글
[GPU programming] CPU and GPU Global Memory Quiz (0) | 2022.07.27 |
---|---|
[GPU programming] Multidimensional Data and Computation on the GPU Quiz (0) | 2022.07.18 |
[GPU programming] GPU Programming Quiz (0) | 2022.06.27 |
[GPU programming] Nvidia Software and Hardware Quiz (0) | 2022.06.26 |
[GPU programming] c++ Parallel Programming Quiz (0) | 2022.06.23 |