Hi,I have watched the developer tutorial given by @Lunderberg in TVM Conf 21. 
The great talk helps me obtain the outline of adding a new device.

However, after checking the source code in [CUDA 
runtime](https://github.com/apache/tvm/tree/main/src/runtime/cuda) , I have 
following questions about ThreadEntry 
([CUDAThreadEntry](https://github.com/apache/tvm/blob/f4af81c5f7bbdf70f7271c5fe54f332857165cab/src/runtime/cuda/cuda_common.h#L55)),
 which is not included in the tutorial.


```
/*! \brief Thread local workspace */

class CUDAThreadEntry {

 public:

  /*! \brief The cuda stream */

  cudaStream_t stream{nullptr};

  /*! \brief thread local pool*/

  WorkspacePool pool;

  /*! \brief constructor */

  CUDAThreadEntry();

  // get the threadlocal workspace

  static CUDAThreadEntry* ThreadLocal();

};
```

To my understanding, the tvm runtime executes the OPs in a sequential order 
([graph_executor.cc](https://github.com/apache/tvm/blob/f4af81c5f7bbdf70f7271c5fe54f332857165cab/src/runtime/graph_executor/graph_executor.cc#L61));
 if so, what is the role of the class CUDAThreadEntry ?
Besides, when adding a new device, can I ignore this class and do not implement 
it ? (just as the instructions given in the tutorial) ?

Looking forward to help.





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/questions-about-threadentry-in-runtime-module/11746/1)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/824f5d518a7cb964a9f9e56041bab0377b2b85b20723fdd2192849a8ca6e897f).

Reply via email to