@@ -134,9 +134,9 @@ class Command {
134
134
return MEnqueueStatus == EnqueueResultT::SyclEnqueueBlocked;
135
135
}
136
136
137
- std::shared_ptr<queue_impl> getQueue () const { return MQueue; }
137
+ const QueueImplPtr & getQueue () const { return MQueue; }
138
138
139
- std::shared_ptr<event_impl> getEvent () const { return MEvent; }
139
+ const EventImplPtr & getEvent () const { return MEvent; }
140
140
141
141
// Methods needed to support SYCL instrumentation
142
142
@@ -179,11 +179,13 @@ class Command {
179
179
180
180
const char *getBlockReason () const ;
181
181
182
- virtual ContextImplPtr getContext () const ;
182
+ // / Get the context of the queue this command will be submitted to. Could
183
+ // / differ from the context of MQueue for memory copy commands.
184
+ virtual const ContextImplPtr &getWorkerContext () const ;
183
185
184
186
// / Get the queue this command will be submitted to. Could differ from MQueue
185
187
// / for memory copy commands.
186
- virtual QueueImplPtr getWorkerQueue () const ;
188
+ virtual const QueueImplPtr & getWorkerQueue () const ;
187
189
188
190
protected:
189
191
EventImplPtr MEvent;
@@ -205,7 +207,7 @@ class Command {
205
207
// /
206
208
// / Glueing (i.e. connecting) will be performed if and only if DepEvent is
207
209
// / not from host context and its context doesn't match to context of this
208
- // / command. Context of this command is fetched via getContext ().
210
+ // / command. Context of this command is fetched via getWorkerContext ().
209
211
// /
210
212
// / Optionality of Dep is set by Dep.MDepCommand not equal to nullptr.
211
213
void processDepEvent (EventImplPtr DepEvent, const DepDesc &Dep);
@@ -221,7 +223,7 @@ class Command {
221
223
friend class DispatchHostTask ;
222
224
223
225
public:
224
- const std::vector<EventImplPtr> getPreparedHostDepsEvents () const {
226
+ const std::vector<EventImplPtr> & getPreparedHostDepsEvents () const {
225
227
return MPreparedHostDepsEvents;
226
228
}
227
229
@@ -293,15 +295,15 @@ class EmptyCommand : public Command {
293
295
public:
294
296
EmptyCommand (QueueImplPtr Queue);
295
297
296
- void printDot (std::ostream &Stream) const final override ;
297
- const Requirement *getRequirement () const final override { return &MRequirements[0 ]; }
298
+ void printDot (std::ostream &Stream) const final ;
299
+ const Requirement *getRequirement () const final { return &MRequirements[0 ]; }
298
300
void addRequirement (Command *DepCmd, AllocaCommandBase *AllocaCmd,
299
301
const Requirement *Req);
300
302
301
303
void emitInstrumentationData () override ;
302
304
303
305
private:
304
- cl_int enqueueImp () final override ;
306
+ cl_int enqueueImp () final ;
305
307
306
308
// Employing deque here as it allows to push_back/emplace_back without
307
309
// invalidation of pointer or reference to stored data item regardless of
@@ -315,11 +317,11 @@ class ReleaseCommand : public Command {
315
317
public:
316
318
ReleaseCommand (QueueImplPtr Queue, AllocaCommandBase *AllocaCmd);
317
319
318
- void printDot (std::ostream &Stream) const final override ;
320
+ void printDot (std::ostream &Stream) const final ;
319
321
void emitInstrumentationData () override ;
320
322
321
323
private:
322
- cl_int enqueueImp () final override ;
324
+ cl_int enqueueImp () final ;
323
325
324
326
// / Command which allocates memory release command should dealocate.
325
327
AllocaCommandBase *MAllocaCmd = nullptr ;
@@ -337,7 +339,7 @@ class AllocaCommandBase : public Command {
337
339
338
340
virtual void *getMemAllocation () const = 0;
339
341
340
- const Requirement *getRequirement () const final override { return &MRequirement; }
342
+ const Requirement *getRequirement () const final { return &MRequirement; }
341
343
342
344
void emitInstrumentationData () override ;
343
345
@@ -369,12 +371,12 @@ class AllocaCommand : public AllocaCommandBase {
369
371
bool InitFromUserData = true ,
370
372
AllocaCommandBase *LinkedAllocaCmd = nullptr );
371
373
372
- void *getMemAllocation () const final override { return MMemAllocation; }
373
- void printDot (std::ostream &Stream) const final override ;
374
+ void *getMemAllocation () const final { return MMemAllocation; }
375
+ void printDot (std::ostream &Stream) const final ;
374
376
void emitInstrumentationData () override ;
375
377
376
378
private:
377
- cl_int enqueueImp () final override ;
379
+ cl_int enqueueImp () final ;
378
380
379
381
// / The flag indicates that alloca should try to reuse pointer provided by
380
382
// / the user during memory object construction.
@@ -387,13 +389,13 @@ class AllocaSubBufCommand : public AllocaCommandBase {
387
389
AllocaSubBufCommand (QueueImplPtr Queue, Requirement Req,
388
390
AllocaCommandBase *ParentAlloca);
389
391
390
- void *getMemAllocation () const final override ;
391
- void printDot (std::ostream &Stream) const final override ;
392
+ void *getMemAllocation () const final ;
393
+ void printDot (std::ostream &Stream) const final ;
392
394
AllocaCommandBase *getParentAlloca () { return MParentAlloca; }
393
395
void emitInstrumentationData () override ;
394
396
395
397
private:
396
- cl_int enqueueImp () final override ;
398
+ cl_int enqueueImp () final ;
397
399
398
400
AllocaCommandBase *MParentAlloca = nullptr ;
399
401
};
@@ -404,12 +406,12 @@ class MapMemObject : public Command {
404
406
MapMemObject (AllocaCommandBase *SrcAllocaCmd, Requirement Req, void **DstPtr,
405
407
QueueImplPtr Queue, access::mode MapMode);
406
408
407
- void printDot (std::ostream &Stream) const final override ;
408
- const Requirement *getRequirement () const final override { return &MSrcReq; }
409
+ void printDot (std::ostream &Stream) const final ;
410
+ const Requirement *getRequirement () const final { return &MSrcReq; }
409
411
void emitInstrumentationData () override ;
410
412
411
413
private:
412
- cl_int enqueueImp () final override ;
414
+ cl_int enqueueImp () final ;
413
415
414
416
AllocaCommandBase *MSrcAllocaCmd = nullptr ;
415
417
Requirement MSrcReq;
@@ -423,12 +425,12 @@ class UnMapMemObject : public Command {
423
425
UnMapMemObject (AllocaCommandBase *DstAllocaCmd, Requirement Req,
424
426
void **SrcPtr, QueueImplPtr Queue);
425
427
426
- void printDot (std::ostream &Stream) const final override ;
427
- const Requirement *getRequirement () const final override { return &MDstReq; }
428
+ void printDot (std::ostream &Stream) const final ;
429
+ const Requirement *getRequirement () const final { return &MDstReq; }
428
430
void emitInstrumentationData () override ;
429
431
430
432
private:
431
- cl_int enqueueImp () final override ;
433
+ cl_int enqueueImp () final ;
432
434
433
435
AllocaCommandBase *MDstAllocaCmd = nullptr ;
434
436
Requirement MDstReq;
@@ -443,14 +445,14 @@ class MemCpyCommand : public Command {
443
445
Requirement DstReq, AllocaCommandBase *DstAllocaCmd,
444
446
QueueImplPtr SrcQueue, QueueImplPtr DstQueue);
445
447
446
- void printDot (std::ostream &Stream) const final override ;
447
- const Requirement *getRequirement () const final override { return &MDstReq; }
448
- void emitInstrumentationData () final override ;
449
- ContextImplPtr getContext () const final override ;
450
- QueueImplPtr getWorkerQueue () const final override ;
448
+ void printDot (std::ostream &Stream) const final ;
449
+ const Requirement *getRequirement () const final { return &MDstReq; }
450
+ void emitInstrumentationData () final ;
451
+ const ContextImplPtr & getWorkerContext () const final ;
452
+ const QueueImplPtr & getWorkerQueue () const final ;
451
453
452
454
private:
453
- cl_int enqueueImp () final override ;
455
+ cl_int enqueueImp () final ;
454
456
455
457
QueueImplPtr MSrcQueue;
456
458
Requirement MSrcReq;
@@ -467,14 +469,14 @@ class MemCpyCommandHost : public Command {
467
469
Requirement DstReq, void **DstPtr, QueueImplPtr SrcQueue,
468
470
QueueImplPtr DstQueue);
469
471
470
- void printDot (std::ostream &Stream) const final override ;
471
- const Requirement *getRequirement () const final override { return &MDstReq; }
472
- void emitInstrumentationData () final override ;
473
- ContextImplPtr getContext () const final override ;
474
- QueueImplPtr getWorkerQueue () const final override ;
472
+ void printDot (std::ostream &Stream) const final ;
473
+ const Requirement *getRequirement () const final { return &MDstReq; }
474
+ void emitInstrumentationData () final ;
475
+ const ContextImplPtr & getWorkerContext () const final ;
476
+ const QueueImplPtr & getWorkerQueue () const final ;
475
477
476
478
private:
477
- cl_int enqueueImp () final override ;
479
+ cl_int enqueueImp () final ;
478
480
479
481
QueueImplPtr MSrcQueue;
480
482
Requirement MSrcReq;
@@ -493,8 +495,8 @@ class ExecCGCommand : public Command {
493
495
494
496
void clearStreams ();
495
497
496
- void printDot (std::ostream &Stream) const final override ;
497
- void emitInstrumentationData () final override ;
498
+ void printDot (std::ostream &Stream) const final ;
499
+ void emitInstrumentationData () final ;
498
500
499
501
detail::CG &getCG () const { return *MCommandGroup; }
500
502
@@ -512,7 +514,7 @@ class ExecCGCommand : public Command {
512
514
}
513
515
514
516
private:
515
- cl_int enqueueImp () final override ;
517
+ cl_int enqueueImp () final ;
516
518
517
519
AllocaCommandBase *getAllocaForReq (Requirement *Req);
518
520
@@ -531,12 +533,12 @@ class UpdateHostRequirementCommand : public Command {
531
533
UpdateHostRequirementCommand (QueueImplPtr Queue, Requirement Req,
532
534
AllocaCommandBase *SrcAllocaCmd, void **DstPtr);
533
535
534
- void printDot (std::ostream &Stream) const final override ;
535
- const Requirement *getRequirement () const final override { return &MDstReq; }
536
- void emitInstrumentationData () final override ;
536
+ void printDot (std::ostream &Stream) const final ;
537
+ const Requirement *getRequirement () const final { return &MDstReq; }
538
+ void emitInstrumentationData () final ;
537
539
538
540
private:
539
- cl_int enqueueImp () final override ;
541
+ cl_int enqueueImp () final ;
540
542
541
543
AllocaCommandBase *MSrcAllocaCmd = nullptr ;
542
544
Requirement MDstReq;
0 commit comments