srkreddy1238 commented on code in PR #17571:
URL: https://github.com/apache/tvm/pull/17571#discussion_r1941716587
##########
include/tvm/runtime/device_api.h:
##########
@@ -135,12 +136,32 @@ class TVM_DLL DeviceAPI {
*/
virtual void* AllocDataSpace(Device dev, int ndim, const int64_t* shape,
DLDataType dtype,
Optional<String> mem_scope = NullOpt);
+
+ /*!
+ * \brief Create a new view with given spec over existing tensor.
+ * \param dev The device device to perform operation.
+ * \param data The source array.
+ * \param shape The shape of allocated tensor.
+ * \param dtype The type of elements.
+ * \param mem_scope The memory scope of allocated tensor.
+ * \return The allocated device pointer.
+ */
+ virtual void* AllocDataSpaceView(Device dev, void* data, ShapeTuple shape,
DLDataType dtype,
Review Comment:
Another question,
Device allocator types are specified externally (from like VM Init as
kPooled or kNaive). How could we enforce OpenCL device always use our new
allocator ?
Or
Do I use existing allocators (NaiveAllocator, PooledAllocator) and
CreateView will be specialized for device type kDLOpenCL alone ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]