MCPcopy Create free account
hub / github.com/NVIDIA/cccl / try_push_context

Function try_push_context

c/parallel/src/util/context.cpp:15–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#include "errors.h"
14
15bool try_push_context()
16{
17 CUcontext context = nullptr;
18
19 check(cuCtxGetCurrent(&context));
20
21 if (context == nullptr)
22 {
23 const int default_device = 0;
24 check(cuDevicePrimaryCtxRetain(&context, default_device));
25 check(cuCtxPushCurrent(context));
26
27 return true;
28 }
29
30 return false;
31}

Callers

nothing calls this directly

Calls 1

checkFunction · 0.70

Tested by

no test coverage detected