Do cuDevicePrimaryCtxReset() and cudaDeviceReset() do the same thing?

einpoklum

Reading the CUDA Runtime API and Driver API docs, it seems that the two functions:

CUresult cuDevicePrimaryCtxReset ( CUdevice dev );
__host__ ​cudaError_t cudaDeviceReset ( void );

do the same thing (upto having to cudaSetDevice(dev) before the runtime API call):

Destroy all allocations and reset all state on the primary context.

for the first and

Destroy all allocations and reset all state on the current device in the current process.

Do they, indeed, do the same? Or are there perhaps subtle differences that I'm missing or that aren't documented? e.g. something related to threads-vs-processes?

einpoklum

They're quite different.

Examining the program @RobertCrovella linked to, it seems cudaDeviceReset() destroys all contexts for the specified device, removing them from the context stack.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

if and else if do the same thing

Cin and scanf do the same thing?

Do constructors do the same thing as the '=' operator?

Three layouts that do the same thing for one activity

Buttons that have different scripts but do the same thing

How to do the same thing n times in Haskell

how to write a function, it will do the same thing with replace()

Do these 2 SQL statements return the same thing?

Group buttons to do the same thing when pressed

JS: Making two functions do the same thing

Do 0.0.0.0:0 and *:* represent the same thing?

Do socket and buffer mean the same thing?

convert python to ruby to do same thing

Why erase and kill characters do the same thing?

Do const if statements do the same thing as #ifdef macros in Go?

How do I make Bind and Command do the same thing in tkinter?

Do both parentheses and braces around expressions basically do the same thing?

How do I make these properties that do the same thing DRY?

Do object oriented PHP and procedural PHP do the same thing?

how do i do the same thing in iOS from javascript

Do the same thing for 4 conditions else do something else

Does HTTP `TRACE` method do the same thing as `curl --trace`?

Do these two ways of deleting vector pointers result in the same thing?

Do people provide multiple mechanisms for doing the same thing in an API?

Why does max(*list) and max(list) do the same thing in python?

Why is there such a large performance difference between these two scrips that do the same thing?

Is there a way to do the same thing in tensorflow as it's done below in numpy?

In python why do lists use "+" and dictionaries use "|" to achieve the same thing?

Does Azure Service Fabric do the same thing as Docker?