aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/stream_executor/cuda/cuda_gpu_executor.h
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <nobody@tensorflow.org>2016-05-12 17:35:56 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-05-12 18:41:28 -0700
commit069547b9e89ce21ca11d8e298e419ff55bb0b87f (patch)
tree8bdf48d9f8a1991a8c4632ac3e901f4a461d71e7 /tensorflow/stream_executor/cuda/cuda_gpu_executor.h
parent1e5e9bed84e44b152a373cd3a6a2bb16e464bd87 (diff)
Maintain current cuda context in CUDADriver by checking against a threadlocal
that stores the id of the current context, and doesn't clear the context when the root scope is popped. On a single context case, this saves all context setting and getting cuda calls. Note that the verification that the current context has not been modified around us is removed. A debug option (kVerifyCudaContext) has been added that can be turned on to help debug those cases. Change: 122221352
Diffstat (limited to 'tensorflow/stream_executor/cuda/cuda_gpu_executor.h')
-rw-r--r--tensorflow/stream_executor/cuda/cuda_gpu_executor.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/stream_executor/cuda/cuda_gpu_executor.h b/tensorflow/stream_executor/cuda/cuda_gpu_executor.h
index ccbe6f26fd..6997e51a6b 100644
--- a/tensorflow/stream_executor/cuda/cuda_gpu_executor.h
+++ b/tensorflow/stream_executor/cuda/cuda_gpu_executor.h
@@ -217,7 +217,7 @@ class CUDAExecutor : public internal::StreamExecutorInterface {
void *CudaContextHack() override;
- CUcontext cuda_context();
+ CudaContext* cuda_context();
private:
// Attempts to find a more specific version of the file indicated by
@@ -272,7 +272,7 @@ class CUDAExecutor : public internal::StreamExecutorInterface {
CUdevice device_;
// Handle for session with the library/driver. Immutable post-initialization.
- CUcontext context_;
+ CudaContext* context_;
// The device ordinal value that this executor was initialized with; recorded
// for use in getting device metadata. Immutable post-initialization.