@@ -28,16 +28,16 @@ class AscendStream;
2828// ! @{
2929
3030// ===================================================================================
31- // NpuMat
31+ // AscendMat
3232// ===================================================================================
3333
3434/* * @brief Base storage class for NPU memory with reference counting.
35- * NpuMat class has a similar interface with Mat and NpuMat , and work on [Ascend
35+ * AscendMat class has a similar interface with Mat and AscendMat , and work on [Ascend
3636 * NPU](https://www.hiascend.com/) backend.
3737 * @sa Mat cuda::GpuMat
3838 */
3939class AscendStream ;
40- class CV_EXPORTS_W NpuMat
40+ class CV_EXPORTS_W AscendMat
4141{
4242public:
4343 class CV_EXPORTS_W Allocator
@@ -47,85 +47,85 @@ class CV_EXPORTS_W NpuMat
4747 // basic allocator
4848 virtual std::shared_ptr<uchar> allocate (size_t size) = 0;
4949 // allocator must fill data, step and refcount fields
50- virtual bool allocate (NpuMat * mat, int rows, int cols, size_t elemSize) = 0;
50+ virtual bool allocate (AscendMat * mat, int rows, int cols, size_t elemSize) = 0;
5151 };
5252
5353 /* *
54- * @brief Create default allocator for NpuMat . This allocator alloc memory from device for
54+ * @brief Create default allocator for AscendMat . This allocator alloc memory from device for
5555 * specific size.
5656 */
57- CV_WRAP static NpuMat ::Allocator* defaultAllocator ();
57+ CV_WRAP static AscendMat ::Allocator* defaultAllocator ();
5858
5959 /* *
60- * @brief Set allocator for NpuMat .
60+ * @brief Set allocator for AscendMat .
6161 * @param allocator
6262 */
63- CV_WRAP static void setDefaultAllocator (NpuMat ::Allocator* allocator);
63+ CV_WRAP static void setDefaultAllocator (AscendMat ::Allocator* allocator);
6464
6565 // ! default constructor
66- CV_WRAP explicit NpuMat (NpuMat ::Allocator* allocator_ = NpuMat ::defaultAllocator());
66+ CV_WRAP explicit AscendMat (AscendMat ::Allocator* allocator_ = AscendMat ::defaultAllocator());
6767
68- // ! constructs NpuMat of the specified size and type
69- CV_WRAP NpuMat (int rows, int cols, int type,
70- NpuMat ::Allocator* allocator = NpuMat ::defaultAllocator());
71- // ! constructs NpuMat of the specified size and type
72- CV_WRAP NpuMat (Size size, int type, NpuMat ::Allocator* allocator = NpuMat ::defaultAllocator());
68+ // ! constructs AscendMat of the specified size and type
69+ CV_WRAP AscendMat (int rows, int cols, int type,
70+ AscendMat ::Allocator* allocator = AscendMat ::defaultAllocator());
71+ // ! constructs AscendMat of the specified size and type
72+ CV_WRAP AscendMat (Size size, int type, AscendMat ::Allocator* allocator = AscendMat ::defaultAllocator());
7373
74- // ! constructs NpuMat and fills it with the specified value s
75- CV_WRAP NpuMat (int rows, int cols, int type, Scalar& s,
76- NpuMat ::Allocator* allocator = NpuMat ::defaultAllocator());
77- // ! constructs NpuMat and fills it with the specified value s
78- CV_WRAP NpuMat (Size size, int type, Scalar& s,
79- NpuMat ::Allocator* allocator = NpuMat ::defaultAllocator());
74+ // ! constructs AscendMat and fills it with the specified value s
75+ CV_WRAP AscendMat (int rows, int cols, int type, Scalar& s,
76+ AscendMat ::Allocator* allocator = AscendMat ::defaultAllocator());
77+ // ! constructs AscendMat and fills it with the specified value s
78+ CV_WRAP AscendMat (Size size, int type, Scalar& s,
79+ AscendMat ::Allocator* allocator = AscendMat ::defaultAllocator());
8080
8181 // ! copy constructor
82- CV_WRAP NpuMat (const NpuMat & m);
82+ CV_WRAP AscendMat (const AscendMat & m);
8383
84- // ! constructs NpuMat by crop a certain area from another
85- CV_WRAP NpuMat (InputArray _m, const Rect& roi);
86- CV_WRAP NpuMat (InputArray _m, const Rect& roi, AscendStream& stream);
84+ // ! constructs AscendMat by crop a certain area from another
85+ CV_WRAP AscendMat (InputArray _m, const Rect& roi);
86+ CV_WRAP AscendMat (InputArray _m, const Rect& roi, AscendStream& stream);
8787
88- // ! builds NpuMat from host memory (Blocking call)
89- CV_WRAP explicit NpuMat (InputArray arr, AscendStream& stream,
90- NpuMat ::Allocator* allocator = NpuMat ::defaultAllocator());
88+ // ! builds AscendMat from host memory (Blocking call)
89+ CV_WRAP explicit AscendMat (InputArray arr, AscendStream& stream,
90+ AscendMat ::Allocator* allocator = AscendMat ::defaultAllocator());
9191
9292 // ! assignment operators
93- NpuMat & operator =(const NpuMat & m);
93+ AscendMat & operator =(const AscendMat & m);
9494
95- // ! sets some of the NpuMat elements to s (Blocking call)
96- CV_WRAP NpuMat & setTo (const Scalar& s);
97- // ! sets some of the NpuMat elements to s (Non-Blocking call)
98- CV_WRAP NpuMat & setTo (const Scalar& s, AscendStream& stream);
95+ // ! sets some of the AscendMat elements to s (Blocking call)
96+ CV_WRAP AscendMat & setTo (const Scalar& s);
97+ // ! sets some of the AscendMat elements to s (Non-Blocking call)
98+ CV_WRAP AscendMat & setTo (const Scalar& s, AscendStream& stream);
9999
100- // ! sets all of the NpuMat elements to float (Blocking call)
101- CV_WRAP NpuMat & setTo (float sc);
100+ // ! sets all of the AscendMat elements to float (Blocking call)
101+ CV_WRAP AscendMat & setTo (float sc);
102102
103- // ! sets all of the NpuMat elements to float (Non-Blocking call)
104- CV_WRAP NpuMat & setTo (float sc, AscendStream& stream);
103+ // ! sets all of the AscendMat elements to float (Non-Blocking call)
104+ CV_WRAP AscendMat & setTo (float sc, AscendStream& stream);
105105
106106 // ! swaps with other smart pointer
107- CV_WRAP void swap (NpuMat & mat);
107+ CV_WRAP void swap (AscendMat & mat);
108108
109- // ! allocates new NpuMat data unless the NpuMat already has specified size and type
109+ // ! allocates new AscendMat data unless the AscendMat already has specified size and type
110110 CV_WRAP void create (int rows, int cols, int type);
111111
112- // ! upload host memory data to NpuMat (Blocking call)
112+ // ! upload host memory data to AscendMat (Blocking call)
113113 CV_WRAP void upload (InputArray arr);
114- // ! upload host memory data to NpuMat (Non-Blocking call)
114+ // ! upload host memory data to AscendMat (Non-Blocking call)
115115 CV_WRAP void upload (InputArray arr, AscendStream& stream);
116116
117- // ! download data from NpuMat to host (Blocking call)
117+ // ! download data from AscendMat to host (Blocking call)
118118 CV_WRAP void download (OutputArray dst) const ;
119- // ! download data from NpuMat to host (Non-Blocking call)
119+ // ! download data from AscendMat to host (Non-Blocking call)
120120 CV_WRAP void download (OutputArray dst, AscendStream& stream) const ;
121121
122- // ! converts NpuMat to another datatype (Blocking call)
123- CV_WRAP void convertTo (CV_OUT NpuMat & dst, int rtype) const ;
122+ // ! converts AscendMat to another datatype (Blocking call)
123+ CV_WRAP void convertTo (CV_OUT AscendMat & dst, int rtype) const ;
124124
125- // ! converts NpuMat to another datatype (Non-Blocking call)
126- CV_WRAP void convertTo (CV_OUT NpuMat & dst, int rtype, AscendStream& stream) const ;
125+ // ! converts AscendMat to another datatype (Non-Blocking call)
126+ CV_WRAP void convertTo (CV_OUT AscendMat & dst, int rtype, AscendStream& stream) const ;
127127
128- // ! returns true iff the NpuMat data is continuous
128+ // ! returns true iff the AscendMat data is continuous
129129 // ! (i.e. when there are no gaps between successive rows)
130130 CV_WRAP bool isContinuous () const ;
131131
@@ -147,10 +147,10 @@ class CV_EXPORTS_W NpuMat
147147 // ! returns step/elemSize1()
148148 CV_WRAP size_t step1 () const ;
149149
150- // ! returns NpuMat size : width == number of columns, height == number of rows
150+ // ! returns AscendMat size : width == number of columns, height == number of rows
151151 CV_WRAP Size size () const ;
152152
153- // ! returns true if NpuMat data is NULL
153+ // ! returns true if AscendMat data is NULL
154154 CV_WRAP bool empty () const ;
155155
156156 // ! internal use method: updates the continuity flag
@@ -279,13 +279,13 @@ CV_EXPORTS_W AscendStream wrapStream(size_t AscendStreamAddress);
279279// ! @{
280280
281281// ! Get Ascend matrix object from Input array, upload matrix memory if need. (Non-Blocking call)
282- NpuMat getInputMat (InputArray src, AscendStream& stream);
282+ AscendMat getInputMat (InputArray src, AscendStream& stream);
283283
284284// ! Get Ascend matrix object from Output array, upload matrix memory if need.
285- NpuMat getOutputMat (OutputArray dst, int rows, int cols, int type, AscendStream& stream);
285+ AscendMat getOutputMat (OutputArray dst, int rows, int cols, int type, AscendStream& stream);
286286
287287// ! Sync output matrix to Output array, download matrix memory if need.
288- void syncOutput (const NpuMat & dst, OutputArray _dst, AscendStream& stream);
288+ void syncOutput (const AscendMat & dst, OutputArray _dst, AscendStream& stream);
289289
290290/* *
291291 * @brief Choose Ascend npu device.
0 commit comments