@@ -66,7 +66,6 @@ class Device {
6666 // / Called by Tensor.
6767 void FreeBlock (Block* block);
6868
69- void AppendInfo (string block_info);
7069 void * UpdateGpuPtrInfo (const Block* block_ptr);
7170
7271 // / Return the size (bytes) of memory in use
@@ -107,7 +106,7 @@ class Device {
107106 int id () const { return id_; }
108107
109108 virtual void * UpdateGpuPtr (const Block* block_ptr) = 0;
110-
109+ virtual void Append (DeviceOptInfoToAppend dev_opt_info) = 0;
111110 private:
112111 Device () {};
113112
@@ -124,7 +123,7 @@ class Device {
124123 // / Free device memory.
125124 virtual void Free (void * ptr) = 0;
126125 virtual void AppendAfterMalloc (Block* block,void * data_ptr,int size) = 0;
127- virtual void Append (string block_info) = 0;
126+
128127
129128 protected:
130129 int id_ = 0 ;
@@ -154,6 +153,7 @@ class CppCPU : public Device {
154153
155154 std::shared_ptr<Device> host () const override { return defaultDevice;}
156155 void SetRandSeed (unsigned seed) override ;
156+ void Append (DeviceOptInfoToAppend dev_opt_info) override {}
157157
158158 protected:
159159 void DoExec (function<void (Context*)>&& fn, int executor) override ;
@@ -167,7 +167,7 @@ class CppCPU : public Device {
167167 // / Free cpu memory.
168168 void Free (void * ptr) override ;
169169 void AppendAfterMalloc (Block* block,void * data_ptr,int size) override {}
170- void Append (string block_info) override {}
170+
171171 void * UpdateGpuPtr (const Block* block_ptr) override {}
172172
173173};
@@ -188,6 +188,8 @@ class CudaGPU : public Device {
188188
189189 void SetRandSeed (unsigned seed) override ;
190190 size_t GetAllocatedMem () override ;
191+ void Append (DeviceOptInfoToAppend dev_opt_info) override {}
192+
191193
192194 protected:
193195 void DoExec (function<void (Context*)>&& fn, int executor) override ;
@@ -201,7 +203,6 @@ class CudaGPU : public Device {
201203 // / Free cpu memory.
202204 void Free (void * ptr) override ;
203205 void AppendAfterMalloc (Block* block,void * data_ptr,int size) override {}
204- void Append (string block_info) override ;
205206 void * UpdateGpuPtr (const Block* block_ptr) override ;
206207
207208 private:
@@ -284,6 +285,8 @@ class SwapGPU : public Device {
284285
285286 void SetRandSeed (unsigned seed) override ;
286287 size_t GetAllocatedMem () override ;
288+ // Append at every index: free, read, mutable
289+ void Append (DeviceOptInfoToAppend dev_opt_info) override ;
287290
288291 protected:
289292 void DoExec (function<void (Context*)>&& fn, int executor) override ;
@@ -295,10 +298,7 @@ class SwapGPU : public Device {
295298 void * Malloc (int size) override ;
296299
297300 // / Free cpu memory.
298- void Free (void * ptr) override ;
299-
300- // Append at every index: free, read, mutable
301- void Append (string block_info) override ;
301+ void Free (void * ptr) override ;
302302
303303 // append info after Malloc, as Block* is not available till Malloc() done.
304304 void AppendAfterMalloc (Block* block,void * data_ptr,int size) override ;
@@ -408,7 +408,7 @@ class OpenclDevice : public singa::Device {
408408 virtual void CopyDataToFrom (Block* dst, Block* src, size_t nBytes,
409409 CopyDirection direction, int dst_offset = 0 ,
410410 int src_offset = 0 ) override ;
411-
411+ void Append (DeviceOptInfoToAppend dev_opt_info) override {}
412412protected:
413413 // / The OpenCL device that this object represents.
414414 // / Each OpenclDevice contains exactly one cl::Device for the lifetime of the
@@ -439,7 +439,7 @@ class OpenclDevice : public singa::Device {
439439 // / This has the effect of freeing up device memory.
440440 void Free (void * ptr) override ;
441441 void AppendAfterMalloc (Block* block,void * data_ptr,int size) override {}
442- void Append (string block_info) override {}
442+
443443 void * UpdateGpuPtr (const Block* block_ptr) override {}
444444
445445
0 commit comments