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 Dec 16, 2024
1 parent 041140b commit 09f34d3
Show file tree
Hide file tree
Showing 19 changed files with 9 additions and 126 deletions.
6 changes: 2 additions & 4 deletions examples/sycl_interop_buffer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2019-2023 Intel Corporation
* Copyright 2019-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 Down Expand Up @@ -38,7 +38,7 @@
/// @section sycl_interop_buffer_cpp_headers Public headers
///
/// To start using oneDNN, we must first include the @ref dnnl.hpp
/// header file in the application. We also include CL/sycl.hpp from DPC++ for
/// header file in the application. We also include sycl/sycl.hpp from DPC++ for
/// using SYCL APIs and @ref dnnl_debug.h, which contains some debugging
/// facilities such as returning a string representation
/// for common oneDNN C types.
Expand All @@ -56,8 +56,6 @@

#if __has_include(<sycl/sycl.hpp>)
#include <sycl/sycl.hpp>
#elif __has_include(<CL/sycl.hpp>)
#include <CL/sycl.hpp>
#else
#error "Unsupported compiler"
#endif
Expand Down
4 changes: 1 addition & 3 deletions examples/sycl_interop_usm.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2019-2023 Intel Corporation
* Copyright 2019-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 @@ -21,8 +21,6 @@

#if __has_include(<sycl/sycl.hpp>)
#include <sycl/sycl.hpp>
#elif __has_include(<CL/sycl.hpp>)
#include <CL/sycl.hpp>
#else
#error "Unsupported compiler"
#endif
Expand Down
2 changes: 0 additions & 2 deletions include/oneapi/dnnl/dnnl_graph_sycl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

#if __has_include(<sycl/sycl.hpp>)
#include <sycl/sycl.hpp>
#elif __has_include(<CL/sycl.hpp>)
#include <CL/sycl.hpp>
#else
#error "Unsupported compiler"
#endif
Expand Down
2 changes: 0 additions & 2 deletions include/oneapi/dnnl/dnnl_sycl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@

#if __has_include(<sycl/sycl.hpp>)
#include <sycl/sycl.hpp>
#elif __has_include(<CL/sycl.hpp>)
#include <CL/sycl.hpp>
#else
#error "Unsupported compiler"
#endif
Expand Down
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
1 change: 0 additions & 1 deletion src/graph/backend/dnnl/kernels/kernel_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "oneapi/dnnl/dnnl.hpp"

#ifdef DNNL_WITH_SYCL
#include "graph/utils/sycl_check.hpp"
#include "oneapi/dnnl/dnnl_sycl.hpp"
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/graph/backend/dnnl/scratchpad.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "oneapi/dnnl/dnnl.hpp"

#ifdef DNNL_WITH_SYCL
#include "graph/utils/sycl_check.hpp"
#include "oneapi/dnnl/dnnl_sycl.hpp"
#endif

namespace dnnl {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/interface/allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "graph/utils/verbose.hpp"

#ifdef DNNL_WITH_SYCL
#include "graph/utils/sycl_check.hpp"
#include "oneapi/dnnl/dnnl_sycl.hpp"
#endif

#if DNNL_GPU_RUNTIME == DNNL_RUNTIME_OCL
Expand Down
2 changes: 1 addition & 1 deletion src/graph/interface/partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "graph/interface/partition_cache.hpp"

#ifdef DNNL_WITH_SYCL
#include "graph/utils/sycl_check.hpp"
#include "oneapi/dnnl/dnnl_sycl.hpp"
#endif

#if DNNL_GPU_RUNTIME == DNNL_RUNTIME_OCL
Expand Down
2 changes: 1 addition & 1 deletion src/graph/interface/partition_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "graph/utils/utils.hpp"

#ifdef DNNL_WITH_SYCL
#include "graph/utils/sycl_check.hpp"
#include "oneapi/dnnl/dnnl_sycl.hpp"
#endif

#if DNNL_GPU_RUNTIME == DNNL_RUNTIME_OCL
Expand Down
2 changes: 1 addition & 1 deletion src/graph/utils/alloc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "graph/utils/utils.hpp"

#ifdef DNNL_WITH_SYCL
#include "graph/utils/sycl_check.hpp"
#include "oneapi/dnnl/dnnl_sycl.hpp"
#endif

#if DNNL_GPU_RUNTIME == DNNL_RUNTIME_OCL
Expand Down
46 changes: 0 additions & 46 deletions src/graph/utils/sycl_check.hpp

This file was deleted.

19 changes: 0 additions & 19 deletions src/xpu/sycl/compat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,36 +58,17 @@ 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>
using local_accessor = ::sycl::accessor<T, dims,
::sycl::access::mode::read_write, ::sycl::access::target::local>;
#pragma clang diagnostic pop

using ext_intel_gpu_slices = ::sycl::ext::intel::info::device::gpu_slices;
using ext_intel_gpu_subslices_per_slice
= ::sycl::ext::intel::info::device::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
18 changes: 0 additions & 18 deletions src/xpu/sycl/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,6 @@

#if __has_include(<sycl/sycl.hpp>)
#include <sycl/sycl.hpp>
#elif __has_include(<CL/sycl.hpp>)
#include <CL/sycl.hpp>
#else
#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
#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
2 changes: 0 additions & 2 deletions tests/gtests/graph/api/test_api_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
#include "xpu/sycl/compat.hpp"
#if __has_include(<sycl/sycl.hpp>)
#include <sycl/sycl.hpp>
#elif __has_include(<CL/sycl.hpp>)
#include <CL/sycl.hpp>
#else
#error "Unsupported compiler"
#endif
Expand Down
2 changes: 0 additions & 2 deletions tests/gtests/graph/test_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#ifdef DNNL_WITH_SYCL
#if __has_include(<sycl/sycl.hpp>)
#include <sycl/sycl.hpp>
#elif __has_include(<CL/sycl.hpp>)
#include <CL/sycl.hpp>
#else
#error "Unsupported compiler"
#endif
Expand Down
2 changes: 0 additions & 2 deletions tests/gtests/graph/unit/unit_test_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
#include "gpu/intel/sycl/compat.hpp"
#if __has_include(<sycl/sycl.hpp>)
#include <sycl/sycl.hpp>
#elif __has_include(<CL/sycl.hpp>)
#include <CL/sycl.hpp>
#else
#error "Unsupported compiler"
#endif
Expand Down

0 comments on commit 09f34d3

Please sign in to comment.