Skip to content

Commit ad441a0

Browse files
Alexander BatashevromanovvladArtem Gindinsonsergey-semenov
authored
[SYCL][Doc] Add Graph Scheduler design documentation (#1457)
Signed-off-by: Alexander Batashev <[email protected]> Co-authored-by: Vlad Romanov <[email protected]> Co-Authored-By: Artem Gindinson <[email protected]> Co-Authored-By: Sergey Semenov <[email protected]>
1 parent 62f841d commit ad441a0

File tree

4 files changed

+612
-183
lines changed

4 files changed

+612
-183
lines changed

sycl/include/CL/sycl/detail/cg.hpp

+22-23
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class interop_handler {
4343
template <typename DataT, int Dims, access::mode AccMode,
4444
access::target AccTarget, access::placeholder isPlaceholder>
4545
friend class accessor;
46+
4647
public:
4748
using QueueImplPtr = std::shared_ptr<detail::queue_impl>;
4849
using ReqToMem = std::pair<detail::Requirement*, pi_mem>;
@@ -306,8 +307,7 @@ class HostKernel : public HostKernelBase {
306307
template <class ArgT = KernelArgType>
307308
typename std::enable_if<std::is_same<ArgT, nd_item<Dims>>::value>::type
308309
runOnHost(const NDRDescT &NDRDesc) {
309-
sycl::range<Dims> GroupSize(
310-
InitializedVal<Dims, range>::template get<0>());
310+
sycl::range<Dims> GroupSize(InitializedVal<Dims, range>::template get<0>());
311311
for (int I = 0; I < Dims; ++I) {
312312
if (NDRDesc.LocalSize[I] == 0 ||
313313
NDRDesc.GlobalSize[I] % NDRDesc.LocalSize[I] != 0)
@@ -316,8 +316,7 @@ class HostKernel : public HostKernelBase {
316316
GroupSize[I] = NDRDesc.GlobalSize[I] / NDRDesc.LocalSize[I];
317317
}
318318

319-
sycl::range<Dims> LocalSize(
320-
InitializedVal<Dims, range>::template get<0>());
319+
sycl::range<Dims> LocalSize(InitializedVal<Dims, range>::template get<0>());
321320
sycl::range<Dims> GlobalSize(
322321
InitializedVal<Dims, range>::template get<0>());
323322
sycl::id<Dims> GlobalOffset;
@@ -358,10 +357,9 @@ class HostKernel : public HostKernelBase {
358357
NGroups[I] = NDRDesc.GlobalSize[I] / NDRDesc.LocalSize[I];
359358
}
360359

361-
sycl::range<Dims> LocalSize(
362-
InitializedVal<Dims, range>::template get<0>());
360+
sycl::range<Dims> LocalSize(InitializedVal<Dims, range>::template get<0>());
363361
sycl::range<Dims> GlobalSize(
364-
InitializedVal<Dims, range>::template get<0>());
362+
InitializedVal<Dims, range>::template get<0>());
365363
for (int I = 0; I < Dims; ++I) {
366364
LocalSize[I] = NDRDesc.LocalSize[I];
367365
GlobalSize[I] = NDRDesc.GlobalSize[I];
@@ -377,10 +375,10 @@ class HostKernel : public HostKernelBase {
377375
};
378376

379377
class stream_impl;
380-
// The base class for all types of command groups.
378+
/// Base class for all types of command groups.
381379
class CG {
382380
public:
383-
// Type of the command group.
381+
/// Type of the command group.
384382
enum CGTYPE {
385383
NONE,
386384
KERNEL,
@@ -424,20 +422,20 @@ class CG {
424422

425423
private:
426424
CGTYPE MType;
427-
// The following storages needed to ensure that arguments won't die while
425+
// The following storages are needed to ensure that arguments won't die while
428426
// we are using them.
429-
// Storage for standard layout arguments.
427+
/// Storage for standard layout arguments.
430428
vector_class<vector_class<char>> MArgsStorage;
431-
// Storage for accessors.
429+
/// Storage for accessors.
432430
vector_class<detail::AccessorImplPtr> MAccStorage;
433-
// Storage for shared_ptrs.
431+
/// Storage for shared_ptrs.
434432
vector_class<shared_ptr_class<const void>> MSharedPtrStorage;
435433

436434
public:
437-
// List of requirements that specify which memory is needed for the command
438-
// group to be executed.
435+
/// List of requirements that specify which memory is needed for the command
436+
/// group to be executed.
439437
vector_class<Requirement *> MRequirements;
440-
// List of events that order the execution of this CG
438+
/// List of events that order the execution of this CG
441439
vector_class<detail::EventImplPtr> MEvents;
442440
// Member variables to capture the user code-location
443441
// information from Q.submit(), Q.parallel_for() etc
@@ -447,9 +445,10 @@ class CG {
447445
int32_t MLine, MColumn;
448446
};
449447

450-
// The class which represents "execute kernel" command group.
448+
/// "Execute kernel" command group class.
451449
class CGExecKernel : public CG {
452450
public:
451+
/// Stores ND-range description.
453452
NDRDescT MNDRDesc;
454453
unique_ptr_class<HostKernelBase> MHostKernel;
455454
shared_ptr_class<detail::kernel_impl> MSyclKernel;
@@ -487,7 +486,7 @@ class CGExecKernel : public CG {
487486
}
488487
};
489488

490-
// The class which represents "copy" command group.
489+
/// "Copy memory" command group class.
491490
class CGCopy : public CG {
492491
void *MSrc;
493492
void *MDst;
@@ -508,7 +507,7 @@ class CGCopy : public CG {
508507
void *getDst() { return MDst; }
509508
};
510509

511-
// The class which represents "fill" command group.
510+
/// "Fill memory" command group class.
512511
class CGFill : public CG {
513512
public:
514513
vector_class<char> MPattern;
@@ -528,7 +527,7 @@ class CGFill : public CG {
528527
Requirement *getReqToFill() { return MPtr; }
529528
};
530529

531-
// The class which represents "update host" command group.
530+
/// "Update host" command group class.
532531
class CGUpdateHost : public CG {
533532
Requirement *MPtr;
534533

@@ -547,7 +546,7 @@ class CGUpdateHost : public CG {
547546
Requirement *getReqToUpdate() { return MPtr; }
548547
};
549548

550-
// The class which represents "copy" command group for USM pointers.
549+
/// "Copy USM" command group class.
551550
class CGCopyUSM : public CG {
552551
void *MSrc;
553552
void *MDst;
@@ -571,7 +570,7 @@ class CGCopyUSM : public CG {
571570
size_t getLength() { return MLength; }
572571
};
573572

574-
// The class which represents "fill" command group for USM pointers.
573+
/// "Fill USM" command group class.
575574
class CGFillUSM : public CG {
576575
vector_class<char> MPattern;
577576
void *MDst;
@@ -594,7 +593,7 @@ class CGFillUSM : public CG {
594593
int getFill() { return MPattern[0]; }
595594
};
596595

597-
// The class which represents "prefetch" command group for USM pointers.
596+
/// "Prefetch USM" command group class.
598597
class CGPrefetchUSM : public CG {
599598
void *MDst;
600599
size_t MLength;

0 commit comments

Comments
 (0)