Skip to content

Commit 206c6da

Browse files
committed
Applied clang-format
1 parent 40eaf08 commit 206c6da

File tree

5 files changed

+59
-21
lines changed

5 files changed

+59
-21
lines changed

sycl/include/sycl/ext/oneapi/experimental/enqueue_functions.hpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ template <typename T>
327327
void copy(queue Q, const T *Src, T *Dest, size_t Count,
328328
const sycl::detail::code_location &CodeLoc =
329329
sycl::detail::code_location::current()) {
330-
submit(Q, [&](handler &CGH) { copy<T>(CGH, Src, Dest, Count); }, CodeLoc);
330+
submit(
331+
Q, [&](handler &CGH) { copy<T>(CGH, Src, Dest, Count); }, CodeLoc);
331332
}
332333

333334
inline void memset(handler &CGH, void *Ptr, int Value, size_t NumBytes) {
@@ -347,7 +348,8 @@ template <typename T>
347348
void fill(sycl::queue Q, T *Ptr, const T &Pattern, size_t Count,
348349
const sycl::detail::code_location &CodeLoc =
349350
sycl::detail::code_location::current()) {
350-
submit(Q, [&](handler &CGH) { fill<T>(CGH, Ptr, Pattern, Count); }, CodeLoc);
351+
submit(
352+
Q, [&](handler &CGH) { fill<T>(CGH, Ptr, Pattern, Count); }, CodeLoc);
351353
}
352354

353355
inline void prefetch(handler &CGH, void *Ptr, size_t NumBytes,
@@ -367,7 +369,8 @@ inline void prefetch(queue Q, void *Ptr, size_t NumBytes,
367369
prefetch_type type = prefetch_type::device,
368370
const sycl::detail::code_location &CodeLoc =
369371
sycl::detail::code_location::current()) {
370-
submit(Q, [&](handler &CGH) { prefetch(CGH, Ptr, NumBytes, type); }, CodeLoc);
372+
submit(
373+
Q, [&](handler &CGH) { prefetch(CGH, Ptr, NumBytes, type); }, CodeLoc);
371374
}
372375

373376
inline void mem_advise(handler &CGH, void *Ptr, size_t NumBytes, int Advice) {
@@ -382,7 +385,8 @@ inline void barrier(handler &CGH) { CGH.ext_oneapi_barrier(); }
382385

383386
inline void barrier(queue Q, const sycl::detail::code_location &CodeLoc =
384387
sycl::detail::code_location::current()) {
385-
submit(Q, [&](handler &CGH) { barrier(CGH); }, CodeLoc);
388+
submit(
389+
Q, [&](handler &CGH) { barrier(CGH); }, CodeLoc);
386390
}
387391

388392
inline void partial_barrier(handler &CGH, const std::vector<event> &Events) {
@@ -392,7 +396,8 @@ inline void partial_barrier(handler &CGH, const std::vector<event> &Events) {
392396
inline void partial_barrier(queue Q, const std::vector<event> &Events,
393397
const sycl::detail::code_location &CodeLoc =
394398
sycl::detail::code_location::current()) {
395-
submit(Q, [&](handler &CGH) { partial_barrier(CGH, Events); }, CodeLoc);
399+
submit(
400+
Q, [&](handler &CGH) { partial_barrier(CGH, Events); }, CodeLoc);
396401
}
397402

398403
inline void execute_graph(queue Q, command_graph<graph_state::executable> &G,

sycl/source/detail/cg.hpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ class NDRDescT {
114114

115115
NDRDescT(sycl::range<3> NumWorkItems, sycl::range<3> LocalSize,
116116
sycl::id<3> Offset, int DimsArg)
117-
: GlobalSize{NumWorkItems}, LocalSize{LocalSize}, GlobalOffset{Offset},
118-
Dims{size_t(DimsArg)} {
117+
: GlobalSize{NumWorkItems}, LocalSize{LocalSize},
118+
GlobalOffset{Offset}, Dims{size_t(DimsArg)} {
119119
setNDRangeLeftover();
120120
}
121121

@@ -230,7 +230,7 @@ class CG {
230230
getAuxiliaryResources() const {
231231
return {};
232232
}
233-
virtual void clearAuxiliaryResources() {};
233+
virtual void clearAuxiliaryResources(){};
234234

235235
virtual ~CG() = default;
236236

@@ -323,8 +323,8 @@ class CGCopy : public CG {
323323
CGCopy(CGType CopyType, void *Src, void *Dst, CG::StorageInitHelper CGData,
324324
std::vector<std::shared_ptr<const void>> AuxiliaryResources,
325325
detail::code_location loc = {})
326-
: CG(CopyType, std::move(CGData), std::move(loc)), MSrc(Src), MDst(Dst),
327-
MAuxiliaryResources{AuxiliaryResources} {}
326+
: CG(CopyType, std::move(CGData), std::move(loc)), MSrc(Src),
327+
MDst(Dst), MAuxiliaryResources{AuxiliaryResources} {}
328328
void *getSrc() { return MSrc; }
329329
void *getDst() { return MDst; }
330330

@@ -415,16 +415,17 @@ class CGPrefetchUSMExp : public CG {
415415
void *MDst;
416416
size_t MLength;
417417
ext::oneapi::experimental::prefetch_type MPrefetchType;
418+
418419
public:
419420
CGPrefetchUSMExp(void *DstPtr, size_t Length, CG::StorageInitHelper CGData,
420-
ext::oneapi::experimental::prefetch_type Type,
421-
detail::code_location loc = {})
421+
ext::oneapi::experimental::prefetch_type Type,
422+
detail::code_location loc = {})
422423
: CG(CGType::PrefetchUSMExp, std::move(CGData), std::move(loc)),
423424
MDst(DstPtr), MLength(Length), MPrefetchType(Type) {}
424425
void *getDst() { return MDst; }
425426
size_t getLength() { return MLength; }
426427
ext::oneapi::experimental::prefetch_type getPrefetchType() {
427-
return MPrefetchType
428+
return MPrefetchType;
428429
}
429430
};
430431
#else

sycl/source/detail/graph_impl.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,19 @@ class node_impl : public std::enable_shared_from_this<node_impl> {
242242
return createCGCopy<sycl::detail::CGFillUSM>();
243243
case sycl::detail::CGType::PrefetchUSM:
244244
return createCGCopy<sycl::detail::CGPrefetchUSM>();
245+
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
246+
case sycl::detail::CGType::PrefetchUSMExp:
247+
throw sycl::exception(sycl::make_error_code(errc::feature_not_supported),
248+
"Prefetch as a part of the experimental enqueue "
249+
"function extension is currently not supported by "
250+
"SYCL Graph extension.");
251+
// return createCGCopy<sycl::detail::CGPrefetchUSMExp>();
252+
#else
245253
case sycl::detail::CGType::PrefetchUSMExpD2H:
246254
throw sycl::exception(sycl::make_error_code(errc::feature_not_supported),
247255
"Prefetch from device to host is currently not "
248256
"supported by SYCL Graph extension.");
257+
#endif
249258
case sycl::detail::CGType::AdviseUSM:
250259
return createCGCopy<sycl::detail::CGAdviseUSM>();
251260
case sycl::detail::CGType::Copy2DUSM:

sycl/source/detail/scheduler/commands.cpp

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,9 +1935,15 @@ static std::string_view cgTypeToString(detail::CGType Type) {
19351935
case detail::CGType::PrefetchUSM:
19361936
return "prefetch usm";
19371937
break;
1938+
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
1939+
case detail::CGType::PrefetchUSMExp:
1940+
return "prefetch usm (enqueue extension, experimental)";
1941+
break;
1942+
#else
19381943
case detail::CGType::PrefetchUSMExpD2H:
19391944
return "prefetch usm (experimental, device to host)";
19401945
break;
1946+
#endif
19411947
case detail::CGType::CodeplayHostTask:
19421948
return "host task";
19431949
break;
@@ -3033,6 +3039,21 @@ ur_result_t ExecCGCommand::enqueueImpCommandBuffer() {
30333039
MEvent->setSyncPoint(OutSyncPoint);
30343040
return UR_RESULT_SUCCESS;
30353041
}
3042+
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
3043+
case CGType::PrefetchUSMExp: {
3044+
CGPrefetchUSMExp *Prefetch = (CGPrefetchUSMExp *)MCommandGroup.get();
3045+
if (auto Result = callMemOpHelper(
3046+
MemoryManager::ext_oneapi_prefetch_usm_cmd_buffer,
3047+
MQueue->getContextImplPtr(), MCommandBuffer, Prefetch->getDst(),
3048+
Prefetch->getLength(), std::move(MSyncPointDeps), &OutSyncPoint,
3049+
Prefetch->getPrefetchType());
3050+
Result != UR_RESULT_SUCCESS)
3051+
return Result;
3052+
3053+
MEvent->setSyncPoint(OutSyncPoint);
3054+
return UR_RESULT_SUCCESS;
3055+
}
3056+
#else
30363057
case CGType::PrefetchUSMExpD2H: {
30373058
CGPrefetchUSMExpD2H *Prefetch = (CGPrefetchUSMExpD2H *)MCommandGroup.get();
30383059
if (auto Result = callMemOpHelper(
@@ -3046,6 +3067,7 @@ ur_result_t ExecCGCommand::enqueueImpCommandBuffer() {
30463067
MEvent->setSyncPoint(OutSyncPoint);
30473068
return UR_RESULT_SUCCESS;
30483069
}
3070+
#endif
30493071
case CGType::AdviseUSM: {
30503072
CGAdviseUSM *Advise = (CGAdviseUSM *)MCommandGroup.get();
30513073
if (auto Result = callMemOpHelper(
@@ -3264,11 +3286,11 @@ ur_result_t ExecCGCommand::enqueueImpQueue() {
32643286
// next ABI breaking window, or rename PrefetchUSM to "PrefetchUSMH2D"
32653287
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
32663288
case CGType::PrefetchUSMExp: {
3267-
CGPrefetchUSMExp *Prefetch = (CGPrefetchUSMExp*) MCommandGroup.get();
3268-
if (auto Result = callMemOpHelper(
3269-
MemoryManager::prefetch_usm, Prefetch->getDst(), MQueue,
3270-
Prefetch->getLength(), std::move(RawEvents), Event, MEvent,
3271-
Prefetch->getPrefetchType);
3289+
CGPrefetchUSMExp *Prefetch = (CGPrefetchUSMExp *)MCommandGroup.get();
3290+
if (auto Result =
3291+
callMemOpHelper(MemoryManager::prefetch_usm, Prefetch->getDst(),
3292+
MQueue, Prefetch->getLength(), std::move(RawEvents),
3293+
Event, MEvent, Prefetch->getPrefetchType());
32723294
Result != UR_RESULT_SUCCESS)
32733295
return Result;
32743296

@@ -3277,7 +3299,7 @@ ur_result_t ExecCGCommand::enqueueImpQueue() {
32773299
}
32783300
#else
32793301
case CGType::PrefetchUSMExpD2H: {
3280-
CGPrefetchUSMExpD2H *Prefetch = (CGPrefetchUSMExpD2H*) MCommandGroup.get();
3302+
CGPrefetchUSMExpD2H *Prefetch = (CGPrefetchUSMExpD2H *)MCommandGroup.get();
32813303
if (auto Result = callMemOpHelper(
32823304
MemoryManager::prefetch_usm, Prefetch->getDst(), MQueue,
32833305
Prefetch->getLength(), std::move(RawEvents), Event, MEvent,

sycl/source/handler.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -985,8 +985,9 @@ void handler::prefetch(const void *Ptr, size_t Count) {
985985
}
986986

987987
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
988-
void handler::ext_oneapi_prefetch_exp(const void *Ptr, size_t Count,
989-
ext::oneapi::experimental::prefetch_type Type) {
988+
void handler::ext_oneapi_prefetch_exp(
989+
const void *Ptr, size_t Count,
990+
ext::oneapi::experimental::prefetch_type Type) {
990991

991992
throwIfActionIsCreated();
992993
MDstPtr = const_cast<void *>(Ptr);

0 commit comments

Comments
 (0)