code: func (d Device) RetainPrimaryCtx() (primaryContext CUContext, err error) {
  	if err = result(C.cuDevicePrimaryCtxRetain(&primaryContext.ctx, C.CUdevice(d))); err != nil {
  		return
  	}
  	return primaryContext, nil
  }
docs: // RetainPrimaryCtx retains the primary context on the GPU, creating it if necessary, increasing its usage count.
  //
  // The caller must call d.ReleasePrimaryCtx() when done using the context.
  // Unlike MakeContext() the newly created context is not pushed onto the stack.
  //
  // Context creation will fail with error `UnknownError` if the compute mode of the device is CU_COMPUTEMODE_PROHIBITED.
  // The function cuDeviceGetAttribute() can be used with CU_DEVICE_ATTRIBUTE_COMPUTE_MODE to determine the compute mode of the device.
  // The nvidia-smi tool can be used to set the compute mode for devices. Documentation for nvidia-smi can be obtained by passing a -h option to it.
  // Please note that the primary context always supports pinned allocations. Other flags can be specified by cuDevicePrimaryCtxSetFlags().