Skip to content

Commit 2385839

Browse files
romanovvladvladimirlaz
authored andcommitted
[SYCL] Refactoring of accessor class + introduction of Requirement class.
The Requirement class is added as base non-templated class for accessor. This class describes command group's requirement to memory object and is used to build dependency graph in Scheduler. Signed-off-by: Vlad Romanov <[email protected]>
1 parent 75fa67d commit 2385839

File tree

7 files changed

+987
-2
lines changed

7 files changed

+987
-2
lines changed

sycl/include/CL/sycl/access/access.hpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,21 @@ struct DeviceValueType<dataT, access::target::host_buffer> {
9797
using type = dataT;
9898
};
9999

100+
template <access::target accessTarget> struct TargetToAS {
101+
constexpr static access::address_space AS =
102+
access::address_space::global_space;
103+
};
104+
105+
template <> struct TargetToAS<access::target::local> {
106+
constexpr static access::address_space AS =
107+
access::address_space::local_space;
108+
};
109+
110+
template <> struct TargetToAS<access::target::constant_buffer> {
111+
constexpr static access::address_space AS =
112+
access::address_space::constant_space;
113+
};
114+
100115
template <typename ElementType, access::address_space addressSpace>
101116
struct PtrValueType;
102117

sycl/include/CL/sycl/accessor.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#ifdef SCHEDULER_20
10+
11+
#include <CL/sycl/accessor2.hpp>
12+
13+
#else
14+
915
#pragma once
1016

1117
#include <type_traits>
@@ -1028,3 +1034,4 @@ struct hash<cl::sycl::accessor<T, Dimensions, AccessMode, AccessTarget,
10281034
}
10291035
};
10301036
} // namespace std
1037+
#endif // SCHEDULER_20

0 commit comments

Comments
 (0)