title: tensorflow add new op : how to get device id in Opkernel
body: <p>I add a new gpu kernel op(MyGpuOp), the use op in python, and specify device id by tf.device('/gpu:0' 
  example : </p>
  
  <pre><code>with tf.device('/gpu:0') :
     out1 = my_gpu_op(input1) 
  with tf.device('/gpu:1') :
     out2 = my_gpu_op(input2) 
  </code></pre>
  
  <p>then i use sess.run([out1, out2], the seens won't run concurrent in different Gpu Device. beacause the run time of sess.run[out1, out2] is  twice of sess.run(out1). </p>
  
  <p>in c++ op wraps(MyGpuOp), i run cuda kernel by pass steam(CudaStream_t) 
  like this : </p>
  
  <pre><code>    //ctx is OpKernelContext 
      GPUDevice d = ctx-&gt;eigen_device&lt;GPUDevice&gt;();
      CudaStream_t stream = d.stream();
      MyKernelName&lt;&lt;&lt;grid, block, 0, stream&gt;&gt;&gt; (....); 
  </code></pre>
  
  <p>Should I need get device id, then use CudaSetDevice(device_id) before run kernel fun?</p>