Skip to content

Commit 27b3110

Browse files
committed
Address review comments
1 parent 072803c commit 27b3110

File tree

7 files changed

+32
-59
lines changed

7 files changed

+32
-59
lines changed

sycl/cmake/modules/AddSYCLUnitTest.cmake

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function(add_sycl_unittest_internal test_dirname link_variant is_preview is_no_c
6767
target_compile_definitions(${test_dirname}
6868
PRIVATE __INTEL_PREVIEW_BREAKING_CHANGES)
6969
if (${is_no_cgh})
70-
set(sycl_cache_suffix "_preview_no_cgh")
70+
set(sycl_cache_suffix "_non_preview_no_cgh")
7171
else()
7272
set(sycl_cache_suffix "_preview")
7373
endif()
@@ -165,7 +165,6 @@ function(add_sycl_unittest_internal test_dirname link_variant is_preview is_no_c
165165
-Wno-inconsistent-missing-override
166166
)
167167
endif()
168-
169168
target_compile_definitions(${test_dirname} PRIVATE SYCL_DISABLE_FSYCL_SYCLHPP_WARNING)
170169
endfunction()
171170

@@ -176,6 +175,6 @@ endfunction()
176175
# Produces two binaries, named `basename(test_name_prefix_non_preview)` and `basename(test_name_prefix_preview)`
177176
macro(add_sycl_unittest test_name_prefix link_variant)
178177
add_sycl_unittest_internal(${test_name_prefix}_non_preview ${link_variant} FALSE FALSE ${ARGN})
178+
add_sycl_unittest_internal(${test_name_prefix}_non_preview_no_cgh ${link_variant} FALSE TRUE ${ARGN})
179179
add_sycl_unittest_internal(${test_name_prefix}_preview ${link_variant} TRUE FALSE ${ARGN})
180-
add_sycl_unittest_internal(${test_name_prefix}_preview_no_cgh ${link_variant} TRUE TRUE ${ARGN})
181180
endmacro()

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

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ template <typename KernelName, typename PropertiesT, typename KernelType,
118118
void submit_direct_impl(const queue &Q, PropertiesT Props, nd_range<Dims> Range,
119119
const KernelType &KernelFunc,
120120
const sycl::detail::code_location &CodeLoc) {
121-
Q.submit_direct_without_event<KernelName, __SYCL_USE_FALLBACK_ASSERT,
121+
Q.submit_direct_without_event<KernelName,
122122
PropertiesT, KernelType, Dims>(
123123
Props, Range, KernelFunc, CodeLoc);
124124
}
@@ -127,7 +127,7 @@ template <typename KernelName, typename PropertiesT, typename KernelType,
127127
event submit_direct_with_event_impl(
128128
const queue &Q, PropertiesT Props, nd_range<Dims> Range,
129129
const KernelType &KernelFunc, const sycl::detail::code_location &CodeLoc) {
130-
return Q.submit_direct_with_event<KernelName, __SYCL_USE_FALLBACK_ASSERT,
130+
return Q.submit_direct_with_event<KernelName,
131131
PropertiesT, KernelType, Dims>(
132132
Props, Range, KernelFunc, CodeLoc);
133133
}
@@ -304,11 +304,11 @@ void nd_launch(handler &CGH, nd_range<Dimensions> Range,
304304
KernelObj);
305305
}
306306

307-
#ifdef __DPCPP_ENABLE_UNFINISHED_NO_CGH_SUBMIT
308307
template <typename KernelName = sycl::detail::auto_name, int Dimensions,
309308
typename KernelType, typename... ReductionsT>
310309
void nd_launch(queue Q, nd_range<Dimensions> Range, const KernelType &KernelObj,
311310
ReductionsT &&...Reductions) {
311+
#ifdef __DPCPP_ENABLE_UNFINISHED_NO_CGH_SUBMIT
312312
if constexpr (sizeof...(ReductionsT) == 0) {
313313
submit<KernelName>(std::move(Q), empty_properties_t{}, Range, KernelObj);
314314
} else {
@@ -317,18 +317,13 @@ void nd_launch(queue Q, nd_range<Dimensions> Range, const KernelType &KernelObj,
317317
std::forward<ReductionsT>(Reductions)...);
318318
});
319319
}
320-
}
321320
#else
322-
template <typename KernelName = sycl::detail::auto_name, int Dimensions,
323-
typename KernelType, typename... ReductionsT>
324-
void nd_launch(queue Q, nd_range<Dimensions> Range, const KernelType &KernelObj,
325-
ReductionsT &&...Reductions) {
326321
submit(std::move(Q), [&](handler &CGH) {
327322
nd_launch<KernelName>(CGH, Range, KernelObj,
328323
std::forward<ReductionsT>(Reductions)...);
329324
});
330-
}
331325
#endif
326+
}
332327

333328
template <typename KernelName = sycl::detail::auto_name, int Dimensions,
334329
typename Properties, typename KernelType, typename... ReductionsT>
@@ -344,11 +339,11 @@ void nd_launch(handler &CGH,
344339
std::forward<ReductionsT>(Reductions)..., KernelObj);
345340
}
346341

347-
#ifdef __DPCPP_ENABLE_UNFINISHED_NO_CGH_SUBMIT
348342
template <typename KernelName = sycl::detail::auto_name, int Dimensions,
349343
typename Properties, typename KernelType, typename... ReductionsT>
350344
void nd_launch(queue Q, launch_config<nd_range<Dimensions>, Properties> Config,
351345
const KernelType &KernelObj, ReductionsT &&...Reductions) {
346+
#ifdef __DPCPP_ENABLE_UNFINISHED_NO_CGH_SUBMIT
352347
if constexpr (sizeof...(ReductionsT) == 0) {
353348
ext::oneapi::experimental::detail::LaunchConfigAccess<nd_range<Dimensions>,
354349
Properties>
@@ -361,18 +356,13 @@ void nd_launch(queue Q, launch_config<nd_range<Dimensions>, Properties> Config,
361356
std::forward<ReductionsT>(Reductions)...);
362357
});
363358
}
364-
}
365359
#else
366-
template <typename KernelName = sycl::detail::auto_name, int Dimensions,
367-
typename Properties, typename KernelType, typename... ReductionsT>
368-
void nd_launch(queue Q, launch_config<nd_range<Dimensions>, Properties> Config,
369-
const KernelType &KernelObj, ReductionsT &&...Reductions) {
370360
submit(std::move(Q), [&](handler &CGH) {
371361
nd_launch<KernelName>(CGH, Config, KernelObj,
372362
std::forward<ReductionsT>(Reductions)...);
373363
});
374-
}
375364
#endif
365+
}
376366

377367
template <int Dimensions, typename... ArgsT>
378368
void nd_launch(handler &CGH, nd_range<Dimensions> Range,

sycl/include/sycl/queue.hpp

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class __SYCL_EXPORT SubmissionInfo {
151151
ext::oneapi::experimental::event_mode_enum::none;
152152
};
153153

154-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
154+
//#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
155155
using KernelParamDescGetterFuncPtr = detail::kernel_param_desc_t (*)(int);
156156

157157
// This class is intended to store the kernel runtime information,
@@ -215,7 +215,7 @@ class __SYCL_EXPORT KernelRuntimeInfo {
215215
bool MKernelHasSpecialCaptures = true;
216216
detail::KernelNameBasedCacheT *MKernelNameBasedCachePtr = nullptr;
217217
};
218-
#endif //__INTEL_PREVIEW_BREAKING_CHANGES
218+
//#endif //__INTEL_PREVIEW_BREAKING_CHANGES
219219

220220
} // namespace v1
221221
} // namespace detail
@@ -3283,7 +3283,6 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
32833283
TlsCodeLocCapture.query());
32843284
}
32853285

3286-
#ifdef __DPCPP_ENABLE_UNFINISHED_NO_CGH_SUBMIT
32873286
/// parallel_for version with a kernel represented as a lambda + nd_range that
32883287
/// specifies global, local sizes and offset.
32893288
///
@@ -3296,8 +3295,9 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
32963295
parallel_for(nd_range<Dims> Range, RestT &&...Rest) {
32973296
constexpr detail::code_location CodeLoc = getCodeLocation<KernelName>();
32983297
detail::tls_code_loc_t TlsCodeLocCapture(CodeLoc);
3298+
#ifdef __DPCPP_ENABLE_UNFINISHED_NO_CGH_SUBMIT
32993299
if constexpr (sizeof...(RestT) == 1) {
3300-
return submit_direct_with_event<KernelName, false>(
3300+
return submit_direct_with_event<KernelName>(
33013301
ext::oneapi::experimental::empty_properties_t{}, Range, Rest...);
33023302
} else {
33033303
return submit(
@@ -3306,27 +3306,15 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
33063306
},
33073307
TlsCodeLocCapture.query());
33083308
}
3309-
}
33103309
#else
3311-
/// parallel_for version with a kernel represented as a lambda + nd_range that
3312-
/// specifies global, local sizes and offset.
3313-
///
3314-
/// \param Range specifies the global and local work spaces of the kernel
3315-
/// \param Rest acts as-if: "ReductionTypes&&... Reductions,
3316-
/// const KernelType &KernelFunc".
3317-
template <typename KernelName = detail::auto_name, int Dims,
3318-
typename... RestT>
3319-
std::enable_if_t<detail::AreAllButLastReductions<RestT...>::value, event>
3320-
parallel_for(nd_range<Dims> Range, RestT &&...Rest) {
3321-
constexpr detail::code_location CodeLoc = getCodeLocation<KernelName>();
3322-
detail::tls_code_loc_t TlsCodeLocCapture(CodeLoc);
3323-
return submit(
3324-
[&](handler &CGH) {
3325-
CGH.template parallel_for<KernelName>(Range, Rest...);
3326-
},
3327-
TlsCodeLocCapture.query());
3328-
}
3310+
return submit(
3311+
[&](handler &CGH) {
3312+
CGH.template parallel_for<KernelName>(Range, Rest...);
3313+
},
3314+
TlsCodeLocCapture.query());
33293315
#endif
3316+
}
3317+
33303318
/// parallel_for version with a kernel represented as a lambda + nd_range that
33313319
/// specifies global, local sizes and offset.
33323320
///
@@ -3832,7 +3820,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
38323820
const detail::code_location &CodeLoc,
38333821
bool IsTopCodeLoc) const;
38343822

3835-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
3823+
//#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
38363824
event submit_direct_with_event_impl(
38373825
nd_range<1> Range, const detail::v1::SubmissionInfo &SubmitInfo,
38383826
const detail::v1::KernelRuntimeInfo &KRInfo,
@@ -3862,7 +3850,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
38623850
nd_range<3> Range, const detail::v1::SubmissionInfo &SubmitInfo,
38633851
const detail::v1::KernelRuntimeInfo &KRInfo,
38643852
const detail::code_location &CodeLoc, bool IsTopCodeLoc) const;
3865-
#endif //__INTEL_PREVIEW_BREAKING_CHANGES
3853+
//#endif //__INTEL_PREVIEW_BREAKING_CHANGES
38663854

38673855
/// A template-free version of submit_without_event as const member function.
38683856
void submit_without_event_impl(const detail::type_erased_cgfo_ty &CGH,
@@ -3908,7 +3896,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
39083896

39093897
#ifdef __DPCPP_ENABLE_UNFINISHED_NO_CGH_SUBMIT
39103898

3911-
template <typename KernelName = detail::auto_name, bool UseFallbackAssert,
3899+
template <typename KernelName = detail::auto_name,
39123900
typename PropertiesT, typename KernelType, int Dims>
39133901
event submit_direct_with_event(PropertiesT Props, nd_range<Dims> Range,
39143902
const KernelType &KernelFunc,
@@ -3928,14 +3916,12 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
39283916
detail::KernelWrapper<detail::WrapAs::parallel_for, NameT, KernelType,
39293917
sycl::nd_item<Dims>, PropertiesT>::wrap(KernelFunc);
39303918

3931-
// TODO UseFallbackAssert
3932-
39333919
return submit_direct_with_event_impl(Range, SI, KRInfo,
39343920
TlsCodeLocCapture.query(),
39353921
TlsCodeLocCapture.isToplevel());
39363922
}
39373923

3938-
template <typename KernelName = detail::auto_name, bool UseFallbackAssert,
3924+
template <typename KernelName = detail::auto_name,
39393925
typename PropertiesT, typename KernelType, int Dims>
39403926
void submit_direct_without_event(PropertiesT Props, nd_range<Dims> Range,
39413927
const KernelType &KernelFunc,
@@ -3955,8 +3941,6 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
39553941
detail::KernelWrapper<detail::WrapAs::parallel_for, NameT, KernelType,
39563942
sycl::nd_item<Dims>, PropertiesT>::wrap(KernelFunc);
39573943

3958-
// TODO UseFallbackAssert
3959-
39603944
submit_direct_without_event_impl(Range, SI, KRInfo,
39613945
TlsCodeLocCapture.query(),
39623946
TlsCodeLocCapture.isToplevel());

sycl/source/detail/queue_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ queue_impl::submit_impl(const detail::type_erased_cgfo_ty &CGF,
403403
return EventImpl;
404404
}
405405

406-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
406+
//#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
407407

408408
std::vector<ArgDesc> queue_impl::extractArgsAndReqsFromLambda(
409409
char *LambdaPtr, detail::kernel_param_desc_t (*ParamDescGetter)(int),
@@ -515,7 +515,7 @@ detail::EventImplPtr queue_impl::submit_direct_impl(
515515
return CallerNeedsEvent ? EventImpl : nullptr;
516516
}
517517

518-
#endif //__INTEL_PREVIEW_BREAKING_CHANGES
518+
//#endif //__INTEL_PREVIEW_BREAKING_CHANGES
519519

520520
template <typename HandlerFuncT>
521521
event queue_impl::submitWithHandler(const std::vector<event> &DepEvents,

sycl/source/detail/queue_impl.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ class queue_impl : public std::enable_shared_from_this<queue_impl> {
365365
return createSyclObjFromImpl<event>(ResEvent);
366366
}
367367

368-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
368+
//#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
369369
event submit_direct_with_event(nd_range<1> Range,
370370
const detail::v1::SubmissionInfo &SubmitInfo,
371371
const detail::v1::KernelRuntimeInfo &KRInfo,
@@ -422,7 +422,7 @@ class queue_impl : public std::enable_shared_from_this<queue_impl> {
422422
submit_direct_impl(NDRDescT{Range}, SubmitInfo, KRInfo, false, CodeLoc,
423423
IsTopCodeLoc);
424424
}
425-
#endif //__INTEL_PREVIEW_BREAKING_CHANGES
425+
//#endif //__INTEL_PREVIEW_BREAKING_CHANGES
426426

427427
void submit_without_event(const detail::type_erased_cgfo_ty &CGF,
428428
const v1::SubmissionInfo &SubmitInfo,
@@ -952,7 +952,7 @@ class queue_impl : public std::enable_shared_from_this<queue_impl> {
952952
bool IsTopCodeLoc,
953953
const v1::SubmissionInfo &SubmitInfo);
954954

955-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
955+
//#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
956956
std::vector<ArgDesc> extractArgsAndReqsFromLambda(
957957
char *LambdaPtr, detail::kernel_param_desc_t (*ParamDescGetter)(int),
958958
size_t NumKernelParams);
@@ -975,7 +975,7 @@ class queue_impl : public std::enable_shared_from_this<queue_impl> {
975975
bool CallerNeedsEvent,
976976
const detail::code_location &CodeLoc,
977977
bool IsTopCodeLoc);
978-
#endif //__INTEL_PREVIEW_BREAKING_CHANGES
978+
//#endif //__INTEL_PREVIEW_BREAKING_CHANGES
979979
/// Helper function for submitting a memory operation with a handler.
980980
/// \param DepEvents is a vector of dependencies of the operation.
981981
/// \param HandlerFunc is a function that submits the operation with a

sycl/source/queue.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ event queue::submit_with_event_impl(
315315
return impl->submit_with_event(CGH, SubmitInfo, CodeLoc, IsTopCodeLoc);
316316
}
317317

318-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
318+
//#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
319319
event queue::submit_direct_with_event_impl(
320320
nd_range<1> Range, const detail::v1::SubmissionInfo &SubmitInfo,
321321
const detail::v1::KernelRuntimeInfo &KRInfo,
@@ -364,7 +364,7 @@ void queue::submit_direct_without_event_impl(
364364
IsTopCodeLoc);
365365
}
366366

367-
#endif //__INTEL_PREVIEW_BREAKING_CHANGES
367+
//#endif //__INTEL_PREVIEW_BREAKING_CHANGES
368368

369369
void queue::submit_without_event_impl(
370370
const detail::type_erased_cgfo_ty &CGH,

sycl/unittests/xpti_trace/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ add_sycl_unittest(XptiTraceTests OBJECT
88
)
99
target_link_libraries(XptiTraceTests_non_preview PRIVATE xpti xptitest_subscriber)
1010
target_link_libraries(XptiTraceTests_preview PRIVATE xpti xptitest_subscriber)
11-
target_link_libraries(XptiTraceTests_preview_no_cgh PRIVATE xpti xptitest_subscriber)
11+
target_link_libraries(XptiTraceTests_non_preview_no_cgh PRIVATE xpti xptitest_subscriber)

0 commit comments

Comments
 (0)