>>235
簡単にで良いなら.

// 前処理
#pragma omp parallel
{
  cuInit(); // 初期化
  cuDeviceGet(); // GPUへのハンドルを取得
  cuCtxCreate(); // コンテキストを作成し,ホストスレッドにバインド

  mallocとか色々

  cuCtxPopCurrent(); // コンテキストをアンバインド
}

glutMainLoop();

// カーネル実行
#pragma omp parallel
{
  cuCtxPushCurrent(); // バインド

  カーネル実行

  cuCtxPopCurrent(); // アンバインド
}

関数の引数は省略しました.