What is a CUDA context?

Can someone explain or pass me a good source of information on what is the CUDA context? I was looking for a CUDA developer guide and I was not happy with that.

Any explanation or help would be wonderful.

+5
source share
2 answers

The cuda API provides stateful library functions: two consecutive calls relate to each other. In short, context is its state.

The runtime API is a wrapper / helper for the driver API . In the driver API, you can see that the context is explicitly available, and for convenience you can use the context stack. There is one specific context that is shared between the driver and the runtime APU (see main context ).

The context contains all the management data for managing and using the device. For example, it contains a list of allocated memory, loaded modules containing device code, a mapping between the CPU and GPU memory for a zero copy, etc.

Finally, note that this post is more about experience than documentation.

+6
source

essentially a data structure that contains information related to state matching between calls you make, for example. (open) (execute) (close)

This means that the functions you call can send signals in the right direction, even if you do not specifically tell them what direction it is.

+2
source

Source: https://habr.com/ru/post/1266395/


All Articles