Skip to content

Commit 22a7440

Browse files
[SYCL][NFC] Optmize handler.hpp compilation for device [2/N] (#15698)
Moved some of the code under `#ifndef __SYCL_DEVICE_ONLY__`, because it is related to various runtime checks, namely: - `throwOnLocalAccessorMisuse` - `checkIfPlaceholderIsBoundToHandler` - `throwIfGraphAssociated` This should reduce amount of template insantiations which are performed during device compilation. Note that implementation of a couple of `memcpy` methods were made completely host-only.
1 parent a9be546 commit 22a7440

File tree

2 files changed

+108
-67
lines changed

2 files changed

+108
-67
lines changed

sycl/include/sycl/ext/oneapi/memcpy2d.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ template <typename T, typename>
1818
void handler::ext_oneapi_memcpy2d(void *Dest, size_t DestPitch, const void *Src,
1919
size_t SrcPitch, size_t Width,
2020
size_t Height) {
21+
#ifndef __SYCL_DEVICE_ONLY__
2122
throwIfGraphAssociated<
2223
ext::oneapi::experimental::detail::UnsupportedGraphFeatures::
2324
sycl_ext_oneapi_memcpy2d>();
@@ -30,6 +31,7 @@ void handler::ext_oneapi_memcpy2d(void *Dest, size_t DestPitch, const void *Src,
3031
throw sycl::exception(sycl::make_error_code(errc::invalid),
3132
"Source pitch must be greater than or equal "
3233
"to the width specified in 'ext_oneapi_memcpy2d'");
34+
#endif
3335

3436
// Get the type of the pointers.
3537
context Ctx = detail::createSyclObjFromImpl<context>(getContextImplPtr());

0 commit comments

Comments
 (0)