@@ -23,40 +23,20 @@ extern "C" {
2323#define VTA_DEBUG_SKIP_WRITE_BARRIER (1 << 4)
2424#define VTA_DEBUG_FORCE_SERIAL (1 << 5)
2525
26- /*! \brief VTA command handle */
27- typedef void * VTACommandHandle ;
28-
29- /*! \brief Shutdown hook of VTA to cleanup resources */
30- void VTARuntimeShutdown ();
31-
32- /*!
33- * \brief Get thread local command handle.
34- * \return A thread local command handle.
35- */
36- VTACommandHandle VTATLSCommandHandle ();
37-
3826/*!
3927 * \brief Allocate data buffer.
4028 * \param cmd The VTA command handle.
4129 * \param size Buffer size.
4230 * \return A pointer to the allocated buffer.
4331 */
44- void * VTABufferAlloc (VTACommandHandle cmd , size_t size );
32+ void * VTABufferAlloc (size_t size );
4533
4634/*!
4735 * \brief Free data buffer.
4836 * \param cmd The VTA command handle.
4937 * \param buffer The data buffer to be freed.
5038 */
51- void VTABufferFree (VTACommandHandle cmd , void * buffer );
52-
53- /*!
54- * \brief Get the buffer access pointer on CPU.
55- * \param cmd The VTA command handle.
56- * \param buffer The data buffer.
57- * \return The pointer that can be accessed by the CPU.
58- */
59- void * VTABufferCPUPtr (VTACommandHandle cmd , void * buffer );
39+ void VTABufferFree (void * buffer );
6040
6141/*!
6242 * \brief Copy data buffer from one location to another.
@@ -68,20 +48,32 @@ void* VTABufferCPUPtr(VTACommandHandle cmd, void* buffer);
6848 * \param size Size of copy.
6949 * \param kind_mask The memory copy kind.
7050 */
71- void VTABufferCopy (VTACommandHandle cmd ,
72- const void * from ,
51+ void VTABufferCopy (const void * from ,
7352 size_t from_offset ,
7453 void * to ,
7554 size_t to_offset ,
7655 size_t size ,
7756 int kind_mask );
7857
58+ /*! \brief VTA command handle */
59+ typedef void * VTACommandHandle ;
60+
61+ /*! \brief Shutdown hook of VTA to cleanup resources */
62+ void VTARuntimeShutdown ();
63+
7964/*!
80- * \brief Set debug mode on the command handle.
65+ * \brief Get thread local command handle.
66+ * \return A thread local command handle.
67+ */
68+ VTACommandHandle VTATLSCommandHandle ();
69+
70+ /*!
71+ * \brief Get the buffer access pointer on CPU.
8172 * \param cmd The VTA command handle.
82- * \param debug_flag The debug flag.
73+ * \param buffer The data buffer.
74+ * \return The pointer that can be accessed by the CPU.
8375 */
84- void VTASetDebugMode (VTACommandHandle cmd , int debug_flag );
76+ void * VTABufferCPUPtr (VTACommandHandle cmd , void * buffer );
8577
8678/*!
8779 * \brief Perform a write barrier to make a memory region visible to the CPU.
@@ -92,9 +84,10 @@ void VTASetDebugMode(VTACommandHandle cmd, int debug_flag);
9284 * \param extent The end of the region (in elements).
9385 */
9486void VTAWriteBarrier (VTACommandHandle cmd ,
95- void * buffer , uint32_t elem_bits ,
96- uint32_t start , uint32_t extent );
97-
87+ void * buffer ,
88+ uint32_t elem_bits ,
89+ uint32_t start ,
90+ uint32_t extent );
9891/*!
9992 * \brief Perform a read barrier to a memory region visible to VTA.
10093 * \param cmd The VTA command handle.
@@ -104,8 +97,17 @@ void VTAWriteBarrier(VTACommandHandle cmd,
10497 * \param extent The end of the region (in elements).
10598 */
10699void VTAReadBarrier (VTACommandHandle cmd ,
107- void * buffer , uint32_t elem_bits ,
108- uint32_t start , uint32_t extent );
100+ void * buffer ,
101+ uint32_t elem_bits ,
102+ uint32_t start ,
103+ uint32_t extent );
104+
105+ /*!
106+ * \brief Set debug mode on the command handle.
107+ * \param cmd The VTA command handle.
108+ * \param debug_flag The debug flag.
109+ */
110+ void VTASetDebugMode (VTACommandHandle cmd , int debug_flag );
109111
110112/*!
111113 * \brief Perform a 2D data load from DRAM.
0 commit comments