Skip to content

[SYCL][Doc] Add Graph Scheduler design documentation #1457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 22 additions & 23 deletions sycl/include/CL/sycl/detail/cg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class interop_handler {
template <typename DataT, int Dims, access::mode AccMode,
access::target AccTarget, access::placeholder isPlaceholder>
friend class accessor;

public:
using QueueImplPtr = std::shared_ptr<detail::queue_impl>;
using ReqToMem = std::pair<detail::Requirement*, pi_mem>;
Expand Down Expand Up @@ -307,8 +308,7 @@ class HostKernel : public HostKernelBase {
template <class ArgT = KernelArgType>
typename std::enable_if<std::is_same<ArgT, nd_item<Dims>>::value>::type
runOnHost(const NDRDescT &NDRDesc) {
sycl::range<Dims> GroupSize(
InitializedVal<Dims, range>::template get<0>());
sycl::range<Dims> GroupSize(InitializedVal<Dims, range>::template get<0>());
for (int I = 0; I < Dims; ++I) {
if (NDRDesc.LocalSize[I] == 0 ||
NDRDesc.GlobalSize[I] % NDRDesc.LocalSize[I] != 0)
Expand All @@ -317,8 +317,7 @@ class HostKernel : public HostKernelBase {
GroupSize[I] = NDRDesc.GlobalSize[I] / NDRDesc.LocalSize[I];
}

sycl::range<Dims> LocalSize(
InitializedVal<Dims, range>::template get<0>());
sycl::range<Dims> LocalSize(InitializedVal<Dims, range>::template get<0>());
sycl::range<Dims> GlobalSize(
InitializedVal<Dims, range>::template get<0>());
sycl::id<Dims> GlobalOffset;
Expand Down Expand Up @@ -359,10 +358,9 @@ class HostKernel : public HostKernelBase {
NGroups[I] = NDRDesc.GlobalSize[I] / NDRDesc.LocalSize[I];
}

sycl::range<Dims> LocalSize(
InitializedVal<Dims, range>::template get<0>());
sycl::range<Dims> LocalSize(InitializedVal<Dims, range>::template get<0>());
sycl::range<Dims> GlobalSize(
InitializedVal<Dims, range>::template get<0>());
InitializedVal<Dims, range>::template get<0>());
for (int I = 0; I < Dims; ++I) {
LocalSize[I] = NDRDesc.LocalSize[I];
GlobalSize[I] = NDRDesc.GlobalSize[I];
Expand All @@ -378,10 +376,10 @@ class HostKernel : public HostKernelBase {
};

class stream_impl;
// The base class for all types of command groups.
/// Base class for all types of command groups.
class CG {
public:
// Type of the command group.
/// Type of the command group.
enum CGTYPE {
NONE,
KERNEL,
Expand Down Expand Up @@ -425,20 +423,20 @@ class CG {

private:
CGTYPE MType;
// The following storages needed to ensure that arguments won't die while
// The following storages are needed to ensure that arguments won't die while
// we are using them.
// Storage for standard layout arguments.
/// Storage for standard layout arguments.
vector_class<vector_class<char>> MArgsStorage;
// Storage for accessors.
/// Storage for accessors.
vector_class<detail::AccessorImplPtr> MAccStorage;
// Storage for shared_ptrs.
/// Storage for shared_ptrs.
vector_class<shared_ptr_class<const void>> MSharedPtrStorage;

public:
// List of requirements that specify which memory is needed for the command
// group to be executed.
/// List of requirements that specify which memory is needed for the command
/// group to be executed.
vector_class<Requirement *> MRequirements;
// List of events that order the execution of this CG
/// List of events that order the execution of this CG
vector_class<detail::EventImplPtr> MEvents;
// Member variables to capture the user code-location
// information from Q.submit(), Q.parallel_for() etc
Expand All @@ -448,9 +446,10 @@ class CG {
int32_t MLine, MColumn;
};

// The class which represents "execute kernel" command group.
/// "Execute kernel" command group class.
class CGExecKernel : public CG {
public:
/// Stores ND-range description.
NDRDescT MNDRDesc;
unique_ptr_class<HostKernelBase> MHostKernel;
shared_ptr_class<detail::kernel_impl> MSyclKernel;
Expand Down Expand Up @@ -488,7 +487,7 @@ class CGExecKernel : public CG {
}
};

// The class which represents "copy" command group.
/// "Copy memory" command group class.
class CGCopy : public CG {
void *MSrc;
void *MDst;
Expand All @@ -509,7 +508,7 @@ class CGCopy : public CG {
void *getDst() { return MDst; }
};

// The class which represents "fill" command group.
/// "Fill memory" command group class.
class CGFill : public CG {
public:
vector_class<char> MPattern;
Expand All @@ -529,7 +528,7 @@ class CGFill : public CG {
Requirement *getReqToFill() { return MPtr; }
};

// The class which represents "update host" command group.
/// "Update host" command group class.
class CGUpdateHost : public CG {
Requirement *MPtr;

Expand All @@ -548,7 +547,7 @@ class CGUpdateHost : public CG {
Requirement *getReqToUpdate() { return MPtr; }
};

// The class which represents "copy" command group for USM pointers.
/// "Copy USM" command group class.
class CGCopyUSM : public CG {
void *MSrc;
void *MDst;
Expand All @@ -572,7 +571,7 @@ class CGCopyUSM : public CG {
size_t getLength() { return MLength; }
};

// The class which represents "fill" command group for USM pointers.
/// "Fill USM" command group class.
class CGFillUSM : public CG {
vector_class<char> MPattern;
void *MDst;
Expand All @@ -595,7 +594,7 @@ class CGFillUSM : public CG {
int getFill() { return MPattern[0]; }
};

// The class which represents "prefetch" command group for USM pointers.
/// "Prefetch USM" command group class.
class CGPrefetchUSM : public CG {
void *MDst;
size_t MLength;
Expand Down
Loading