Skip to content

Commit

Permalink
common: remove support for SyCL older than 2020
Browse files Browse the repository at this point in the history
  • Loading branch information
spalicki committed Nov 13, 2024
1 parent 34c28a1 commit b29fa15
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 61 deletions.
12 changes: 1 addition & 11 deletions src/gpu/intel/sycl/compat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,8 @@ status_t make_kernel(std::unique_ptr<::sycl::kernel> &sycl_kernel,
uint64_t init_extensions(const ::sycl::device &dev) {
uint64_t extensions = 0;

#if DNNL_USE_SYCL121_API
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
constexpr auto base_atomics_aspect = ::sycl::aspect::int64_base_atomics;
constexpr auto extended_atomics_aspect
= ::sycl::aspect::int64_extended_atomics;
#else
constexpr auto base_atomics_aspect = ::sycl::aspect::atomic64;
constexpr auto extended_atomics_aspect = ::sycl::aspect::atomic64;
#endif

for (uint64_t i_ext = 1; i_ext < (uint64_t)device_ext_t::last;
i_ext <<= 1) {
Expand Down Expand Up @@ -142,9 +134,7 @@ uint64_t init_extensions(const ::sycl::device &dev) {
}
if (is_ext_supported) extensions |= i_ext;
}
#if DNNL_USE_SYCL121_API
#pragma clang diagnostic pop
#endif

return extensions;
}

Expand Down
16 changes: 3 additions & 13 deletions src/graph/utils/sycl_check.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2023 Intel Corporation
* Copyright 2023-2024 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,18 +26,8 @@
#error "Unsupported compiler"
#endif

#if defined(__INTEL_LLVM_COMPILER)
#if (__INTEL_LLVM_COMPILER < 20230000)
#define DNNL_USE_SYCL121_API 1
#else
#define DNNL_USE_SYCL121_API 0
#endif
#elif defined(__LIBSYCL_MAJOR_VERSION)
#if (__LIBSYCL_MAJOR_VERSION < 6)
#define DNNL_USE_SYCL121_API 1
#else
#define DNNL_USE_SYCL121_API 0
#endif
#if defined(__INTEL_LLVM_COMPILER) && __INTEL_LLVM_COMPILER >= 20230000
#elif defined(__LIBSYCL_MAJOR_VERSION) && __LIBSYCL_MAJOR_VERSION >= 6
#else
#error "Unsupported compiler"
#endif
Expand Down
16 changes: 0 additions & 16 deletions src/xpu/sycl/compat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,6 @@ inline void host_task(H &cgh, F &&f) {

constexpr auto target_device = ::sycl::target::device;

#if DNNL_USE_SYCL121_API
template <typename T, int dims>
using local_accessor = ::sycl::accessor<T, dims,
::sycl::access::mode::read_write, ::sycl::access::target::local>;

constexpr auto ext_intel_gpu_slices
= ::sycl::info::device::ext_intel_gpu_slices;
constexpr auto ext_intel_gpu_subslices_per_slice
= ::sycl::info::device::ext_intel_gpu_subslices_per_slice;

const auto cpu_selector_v = ::sycl::cpu_selector {};
const auto gpu_selector_v = ::sycl::gpu_selector {};
#else

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
template <typename T, int dims>
Expand All @@ -86,8 +72,6 @@ using ext_intel_gpu_subslices_per_slice
inline const auto &cpu_selector_v = ::sycl::cpu_selector_v;
inline const auto &gpu_selector_v = ::sycl::gpu_selector_v;

#endif

} // namespace compat
} // namespace sycl
} // namespace xpu
Expand Down
14 changes: 2 additions & 12 deletions src/xpu/sycl/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,8 @@
#error "Unsupported compiler"
#endif

#if defined(__INTEL_LLVM_COMPILER)
#if (__INTEL_LLVM_COMPILER < 20230000)
#define DNNL_USE_SYCL121_API 1
#else
#define DNNL_USE_SYCL121_API 0
#endif
#elif defined(__LIBSYCL_MAJOR_VERSION)
#if (__LIBSYCL_MAJOR_VERSION < 6)
#define DNNL_USE_SYCL121_API 1
#else
#define DNNL_USE_SYCL121_API 0
#endif
#if defined(__INTEL_LLVM_COMPILER) && __INTEL_LLVM_COMPILER >= 20230000
#elif defined(__LIBSYCL_MAJOR_VERSION) && __LIBSYCL_MAJOR_VERSION >= 6
#else
#error "Unsupported compiler"
#endif
Expand Down
4 changes: 0 additions & 4 deletions tests/benchdnn/dnnl_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -889,11 +889,7 @@ bool is_f64_supported(const dnnl_engine_t &engine) {
if (is_sycl_engine(engine)) {
auto eng = dnnl::engine(engine, true);
auto dev = dnnl::sycl_interop::get_device(eng);
#ifdef DNNL_SYCL_INTEROP_USE_SYCL121
return dev.has_extension("cl_khr_fp64");
#else
return dev.has(::sycl::aspect::fp64);
#endif
}
#endif
#if DNNL_GPU_RUNTIME == DNNL_RUNTIME_OCL
Expand Down
5 changes: 0 additions & 5 deletions tests/benchdnn/dnnl_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,12 +489,7 @@ void dnn_mem_t::memset(int value, size_t size) const {
auto &buf = *static_cast<::sycl::buffer<uint8_t, 1> *>(
mem_handle);
queue.submit([&](::sycl::handler &cgh) {
#ifdef DNNL_SYCL_INTEROP_USE_SYCL121
constexpr auto target_device
= ::sycl::target::global_buffer;
#else
constexpr auto target_device = ::sycl::target::device;
#endif
::sycl::accessor<uint8_t, 1, ::sycl::access::mode::write,
target_device>
acc(buf, cgh);
Expand Down

0 comments on commit b29fa15

Please sign in to comment.