From 16a925e89bb2c2a195a28e2b94b00698712465cc Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Sun, 4 Sep 2022 14:11:45 -0500 Subject: [PATCH 1/3] Replaced deprecated cl::sycl namespace with sycl --- .../sycl_direct_linkage/sycl_function.cpp | 2 +- .../cython/usm_memory/sycl_blackscholes.cpp | 14 +++--- .../helper/source/dpctl_error_handlers.cpp | 3 +- .../helper/source/dpctl_utils_helper.cpp | 6 +-- .../source/dpctl_sycl_context_interface.cpp | 2 +- .../source/dpctl_sycl_device_interface.cpp | 2 +- .../source/dpctl_sycl_device_manager.cpp | 2 +- .../dpctl_sycl_device_selector_interface.cpp | 2 +- .../source/dpctl_sycl_event_interface.cpp | 2 +- .../dpctl_sycl_kernel_bundle_interface.cpp | 2 +- .../source/dpctl_sycl_kernel_interface.cpp | 2 +- .../source/dpctl_sycl_platform_interface.cpp | 2 +- .../source/dpctl_sycl_platform_manager.cpp | 2 +- .../source/dpctl_sycl_queue_interface.cpp | 2 +- .../source/dpctl_sycl_queue_manager.cpp | 2 +- .../source/dpctl_sycl_usm_interface.cpp | 2 +- .../tests/test_sycl_context_interface.cpp | 2 +- .../tests/test_sycl_device_aspects.cpp | 48 +++++++++---------- .../tests/test_sycl_device_interface.cpp | 2 +- .../test_sycl_device_invalid_filters.cpp | 3 +- .../tests/test_sycl_device_manager.cpp | 2 +- .../test_sycl_device_selector_interface.cpp | 2 +- .../tests/test_sycl_device_subdevices.cpp | 2 +- .../tests/test_sycl_event_interface.cpp | 2 +- .../test_sycl_kernel_bundle_interface.cpp | 2 +- .../tests/test_sycl_kernel_interface.cpp | 2 +- .../tests/test_sycl_platform_interface.cpp | 2 +- .../test_sycl_platform_invalid_filters.cpp | 3 +- .../tests/test_sycl_queue_interface.cpp | 2 +- .../tests/test_sycl_queue_manager.cpp | 2 +- .../tests/test_sycl_usm_interface.cpp | 2 +- 31 files changed, 62 insertions(+), 65 deletions(-) diff --git a/examples/cython/sycl_direct_linkage/sycl_function.cpp b/examples/cython/sycl_direct_linkage/sycl_function.cpp index c7e92b9085..3927be82e5 100644 --- a/examples/cython/sycl_direct_linkage/sycl_function.cpp +++ b/examples/cython/sycl_direct_linkage/sycl_function.cpp @@ -31,7 +31,7 @@ #include #include -int c_columnwise_total(cl::sycl::queue &q, +int c_columnwise_total(sycl::queue &q, size_t n, size_t m, double *mat, diff --git a/examples/cython/usm_memory/sycl_blackscholes.cpp b/examples/cython/usm_memory/sycl_blackscholes.cpp index 8d6d0d6f85..38392a620c 100644 --- a/examples/cython/usm_memory/sycl_blackscholes.cpp +++ b/examples/cython/usm_memory/sycl_blackscholes.cpp @@ -89,32 +89,32 @@ cpp_blackscholes(DPCTLSyclQueueRef q_ptr, size_t n_opts, T *params, T *callput) data_t mr = -opt_rate, sig_sig_two = two * opt_volatility * opt_volatility; - a = cl::sycl::log(opt_price / opt_strike); + a = sycl::log(opt_price / opt_strike); b = opt_maturity * mr; z = opt_maturity * sig_sig_two; c = quarter * z; - e = cl::sycl::exp(b); - y = cl::sycl::rsqrt(z); + e = sycl::exp(b); + y = sycl::rsqrt(z); a = b - a; w1 = (a - c) * y; w2 = (a + c) * y; if (w1 < zero) { - d1 = cl::sycl::erfc(w1) * half; + d1 = sycl::erfc(w1) * half; d1c = one - d1; } else { - d1c = cl::sycl::erfc(-w1) * half; + d1c = sycl::erfc(-w1) * half; d1 = one - d1c; } if (w2 < zero) { - d2 = cl::sycl::erfc(w2) * half; + d2 = sycl::erfc(w2) * half; d2c = one - d2; } else { - d2c = cl::sycl::erfc(-w2) * half; + d2c = sycl::erfc(-w2) * half; d2 = one - d2c; } diff --git a/libsyclinterface/helper/source/dpctl_error_handlers.cpp b/libsyclinterface/helper/source/dpctl_error_handlers.cpp index e6b8adeabf..74dd829676 100644 --- a/libsyclinterface/helper/source/dpctl_error_handlers.cpp +++ b/libsyclinterface/helper/source/dpctl_error_handlers.cpp @@ -31,8 +31,7 @@ #include #endif -void DPCTL_AsyncErrorHandler::operator()( - const cl::sycl::exception_list &exceptions) +void DPCTL_AsyncErrorHandler::operator()(const sycl::exception_list &exceptions) { for (std::exception_ptr const &e : exceptions) { try { diff --git a/libsyclinterface/helper/source/dpctl_utils_helper.cpp b/libsyclinterface/helper/source/dpctl_utils_helper.cpp index 905170f61a..63db006080 100644 --- a/libsyclinterface/helper/source/dpctl_utils_helper.cpp +++ b/libsyclinterface/helper/source/dpctl_utils_helper.cpp @@ -27,7 +27,7 @@ #include #include -using namespace cl::sycl; +using namespace sycl; /*! * Transforms enum info::device_type to string. @@ -164,7 +164,7 @@ DPCTLSyclDeviceType DPCTL_SyclDeviceTypeToDPCTLDeviceType(info::device_type D) } /*! - * Transforms cl::sycl::aspect to string. + * Transforms sycl::aspect to string. */ std::string DPCTL_AspectToStr(aspect aspectTy) { @@ -237,7 +237,7 @@ std::string DPCTL_AspectToStr(aspect aspectTy) } /*! - * Transforms string to cl::sycl::aspect. + * Transforms string to sycl::aspect. */ aspect DPCTL_StrToAspectType(const std::string &aspectTyStr) { diff --git a/libsyclinterface/source/dpctl_sycl_context_interface.cpp b/libsyclinterface/source/dpctl_sycl_context_interface.cpp index 9709e7574e..582bb8cd7e 100644 --- a/libsyclinterface/source/dpctl_sycl_context_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_context_interface.cpp @@ -30,7 +30,7 @@ #include #include -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/source/dpctl_sycl_device_interface.cpp b/libsyclinterface/source/dpctl_sycl_device_interface.cpp index 7494367924..2b2480cea5 100644 --- a/libsyclinterface/source/dpctl_sycl_device_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_device_interface.cpp @@ -35,7 +35,7 @@ #include #include -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/source/dpctl_sycl_device_manager.cpp b/libsyclinterface/source/dpctl_sycl_device_manager.cpp index 40bf50ebad..2875d0371d 100644 --- a/libsyclinterface/source/dpctl_sycl_device_manager.cpp +++ b/libsyclinterface/source/dpctl_sycl_device_manager.cpp @@ -35,7 +35,7 @@ #include #include -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/source/dpctl_sycl_device_selector_interface.cpp b/libsyclinterface/source/dpctl_sycl_device_selector_interface.cpp index fb87980aaa..db2f0744fc 100644 --- a/libsyclinterface/source/dpctl_sycl_device_selector_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_device_selector_interface.cpp @@ -28,7 +28,7 @@ #include "dpctl_error_handlers.h" #include /* SYCL headers */ -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/source/dpctl_sycl_event_interface.cpp b/libsyclinterface/source/dpctl_sycl_event_interface.cpp index 70bf037371..80a5a3c69e 100644 --- a/libsyclinterface/source/dpctl_sycl_event_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_event_interface.cpp @@ -31,7 +31,7 @@ #include /* SYCL headers */ #include -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/source/dpctl_sycl_kernel_bundle_interface.cpp b/libsyclinterface/source/dpctl_sycl_kernel_bundle_interface.cpp index a91325b4f3..ce01d4077b 100644 --- a/libsyclinterface/source/dpctl_sycl_kernel_bundle_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_kernel_bundle_interface.cpp @@ -52,7 +52,7 @@ // clang-format on #endif -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/source/dpctl_sycl_kernel_interface.cpp b/libsyclinterface/source/dpctl_sycl_kernel_interface.cpp index 236546fb8d..39da9e4fcd 100644 --- a/libsyclinterface/source/dpctl_sycl_kernel_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_kernel_interface.cpp @@ -31,7 +31,7 @@ #include /* Sycl headers */ #include -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/source/dpctl_sycl_platform_interface.cpp b/libsyclinterface/source/dpctl_sycl_platform_interface.cpp index 4ab9771b99..b038fbf216 100644 --- a/libsyclinterface/source/dpctl_sycl_platform_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_platform_interface.cpp @@ -36,7 +36,7 @@ #include #include -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/source/dpctl_sycl_platform_manager.cpp b/libsyclinterface/source/dpctl_sycl_platform_manager.cpp index ba78fcfa97..856f7b5f01 100644 --- a/libsyclinterface/source/dpctl_sycl_platform_manager.cpp +++ b/libsyclinterface/source/dpctl_sycl_platform_manager.cpp @@ -36,7 +36,7 @@ #include #include -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/source/dpctl_sycl_queue_interface.cpp b/libsyclinterface/source/dpctl_sycl_queue_interface.cpp index 1ce507644e..941db06f6a 100644 --- a/libsyclinterface/source/dpctl_sycl_queue_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_queue_interface.cpp @@ -34,7 +34,7 @@ #include #include -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/source/dpctl_sycl_queue_manager.cpp b/libsyclinterface/source/dpctl_sycl_queue_manager.cpp index 15379e07b3..b6beab1350 100644 --- a/libsyclinterface/source/dpctl_sycl_queue_manager.cpp +++ b/libsyclinterface/source/dpctl_sycl_queue_manager.cpp @@ -30,7 +30,7 @@ #include /* SYCL headers */ #include -using namespace cl::sycl; +using namespace sycl; /*------------------------------- Private helpers ----------------------------*/ diff --git a/libsyclinterface/source/dpctl_sycl_usm_interface.cpp b/libsyclinterface/source/dpctl_sycl_usm_interface.cpp index e6e7b2fcf0..38dd94ebaf 100644 --- a/libsyclinterface/source/dpctl_sycl_usm_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_usm_interface.cpp @@ -30,7 +30,7 @@ #include "dpctl_sycl_device_interface.h" #include /* SYCL headers */ -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/tests/test_sycl_context_interface.cpp b/libsyclinterface/tests/test_sycl_context_interface.cpp index 1d609671a0..217c207c91 100644 --- a/libsyclinterface/tests/test_sycl_context_interface.cpp +++ b/libsyclinterface/tests/test_sycl_context_interface.cpp @@ -33,7 +33,7 @@ #include #include -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/tests/test_sycl_device_aspects.cpp b/libsyclinterface/tests/test_sycl_device_aspects.cpp index 638e86747f..7d830ab729 100644 --- a/libsyclinterface/tests/test_sycl_device_aspects.cpp +++ b/libsyclinterface/tests/test_sycl_device_aspects.cpp @@ -74,40 +74,36 @@ auto build_params() "opencl:gpu", "opencl:cpu", "level_zero:gpu", "host"); constexpr auto param_2 = - get_param_list>( - std::make_pair("host", cl::sycl::aspect::host), - std::make_pair("cpu", cl::sycl::aspect::cpu), - std::make_pair("gpu", cl::sycl::aspect::gpu), - std::make_pair("accelerator", cl::sycl::aspect::accelerator), - std::make_pair("custom", cl::sycl::aspect::custom), - std::make_pair("fp16", cl::sycl::aspect::fp16), - std::make_pair("fp64", cl::sycl::aspect::fp64), - std::make_pair("atomic64", cl::sycl::aspect::atomic64), - std::make_pair("online_compiler", - cl::sycl::aspect::online_compiler), - std::make_pair("online_linker", cl::sycl::aspect::online_linker), - std::make_pair("queue_profiling", - cl::sycl::aspect::queue_profiling), + get_param_list>( + std::make_pair("host", sycl::aspect::host), + std::make_pair("cpu", sycl::aspect::cpu), + std::make_pair("gpu", sycl::aspect::gpu), + std::make_pair("accelerator", sycl::aspect::accelerator), + std::make_pair("custom", sycl::aspect::custom), + std::make_pair("fp16", sycl::aspect::fp16), + std::make_pair("fp64", sycl::aspect::fp64), + std::make_pair("atomic64", sycl::aspect::atomic64), + std::make_pair("online_compiler", sycl::aspect::online_compiler), + std::make_pair("online_linker", sycl::aspect::online_linker), + std::make_pair("queue_profiling", sycl::aspect::queue_profiling), std::make_pair("usm_device_allocations", - cl::sycl::aspect::usm_device_allocations), + sycl::aspect::usm_device_allocations), std::make_pair("usm_host_allocations", - cl::sycl::aspect::usm_host_allocations), + sycl::aspect::usm_host_allocations), std::make_pair("usm_shared_allocations", - cl::sycl::aspect::usm_shared_allocations), + sycl::aspect::usm_shared_allocations), std::make_pair("usm_restricted_shared_allocations", - cl::sycl::aspect::usm_restricted_shared_allocations), + sycl::aspect::usm_restricted_shared_allocations), std::make_pair("usm_system_allocations", - cl::sycl::aspect::usm_system_allocations), + sycl::aspect::usm_system_allocations), std::make_pair("usm_atomic_host_allocations", - cl::sycl::aspect::usm_atomic_host_allocations), + sycl::aspect::usm_atomic_host_allocations), std::make_pair("usm_atomic_shared_allocations", - cl::sycl::aspect::usm_atomic_shared_allocations), - std::make_pair("host_debuggable", - cl::sycl::aspect::host_debuggable)); + sycl::aspect::usm_atomic_shared_allocations), + std::make_pair("host_debuggable", sycl::aspect::host_debuggable)); auto pairs = - build_param_pairs, + build_param_pairs, param_1.size(), param_2.size()>(param_1, param_2); return build_gtest_values(pairs); @@ -117,7 +113,7 @@ auto build_params() struct TestDPCTLSyclDeviceInterfaceAspects : public ::testing::TestWithParam< - std::pair>> + std::pair>> { DPCTLSyclDeviceSelectorRef DSRef = nullptr; DPCTLSyclDeviceRef DRef = nullptr; diff --git a/libsyclinterface/tests/test_sycl_device_interface.cpp b/libsyclinterface/tests/test_sycl_device_interface.cpp index ba3f7fb245..f1c75ed8ec 100644 --- a/libsyclinterface/tests/test_sycl_device_interface.cpp +++ b/libsyclinterface/tests/test_sycl_device_interface.cpp @@ -32,7 +32,7 @@ #include #include -using namespace cl::sycl; +using namespace sycl; struct TestDPCTLSyclDeviceInterface : public ::testing::TestWithParam diff --git a/libsyclinterface/tests/test_sycl_device_invalid_filters.cpp b/libsyclinterface/tests/test_sycl_device_invalid_filters.cpp index f5a258ab15..2ecdcb5cb0 100644 --- a/libsyclinterface/tests/test_sycl_device_invalid_filters.cpp +++ b/libsyclinterface/tests/test_sycl_device_invalid_filters.cpp @@ -28,7 +28,8 @@ #include #include -using namespace cl::sycl; +using namespace sycl; + struct TestUnsupportedFilters : public ::testing::TestWithParam { DPCTLSyclDeviceSelectorRef DSRef = nullptr; diff --git a/libsyclinterface/tests/test_sycl_device_manager.cpp b/libsyclinterface/tests/test_sycl_device_manager.cpp index 77b7a21b07..237d115e0b 100644 --- a/libsyclinterface/tests/test_sycl_device_manager.cpp +++ b/libsyclinterface/tests/test_sycl_device_manager.cpp @@ -186,7 +186,7 @@ struct TestGetNumDevicesForBTy : public ::testing::TestWithParam TEST_P(TestGetNumDevicesForBTy, ChkGetNumDevices) { - auto platforms = cl::sycl::platform::get_platforms(); + auto platforms = sycl::platform::get_platforms(); size_t nDevices = 0; sycl::default_selector mRanker; for (const auto &P : platforms) { diff --git a/libsyclinterface/tests/test_sycl_device_selector_interface.cpp b/libsyclinterface/tests/test_sycl_device_selector_interface.cpp index 592575b53a..e3a036d272 100644 --- a/libsyclinterface/tests/test_sycl_device_selector_interface.cpp +++ b/libsyclinterface/tests/test_sycl_device_selector_interface.cpp @@ -31,7 +31,7 @@ #include #include -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/tests/test_sycl_device_subdevices.cpp b/libsyclinterface/tests/test_sycl_device_subdevices.cpp index ebf76fe076..f20dfbfa70 100644 --- a/libsyclinterface/tests/test_sycl_device_subdevices.cpp +++ b/libsyclinterface/tests/test_sycl_device_subdevices.cpp @@ -35,7 +35,7 @@ #include #include -using namespace cl::sycl; +using namespace sycl; DEFINE_SIMPLE_CONVERSION_FUNCTIONS(device, DPCTLSyclDeviceRef); diff --git a/libsyclinterface/tests/test_sycl_event_interface.cpp b/libsyclinterface/tests/test_sycl_event_interface.cpp index 1954744fff..78d1b1cf48 100644 --- a/libsyclinterface/tests/test_sycl_event_interface.cpp +++ b/libsyclinterface/tests/test_sycl_event_interface.cpp @@ -31,7 +31,7 @@ #include #include -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/tests/test_sycl_kernel_bundle_interface.cpp b/libsyclinterface/tests/test_sycl_kernel_bundle_interface.cpp index 9bbd55f009..d86642f70c 100644 --- a/libsyclinterface/tests/test_sycl_kernel_bundle_interface.cpp +++ b/libsyclinterface/tests/test_sycl_kernel_bundle_interface.cpp @@ -40,7 +40,7 @@ #include #include -using namespace cl::sycl; +using namespace sycl; struct TestDPCTLSyclKernelBundleInterface : public ::testing::TestWithParam diff --git a/libsyclinterface/tests/test_sycl_kernel_interface.cpp b/libsyclinterface/tests/test_sycl_kernel_interface.cpp index 016a3ccd3e..ae01e3d658 100644 --- a/libsyclinterface/tests/test_sycl_kernel_interface.cpp +++ b/libsyclinterface/tests/test_sycl_kernel_interface.cpp @@ -36,7 +36,7 @@ #include #include -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/tests/test_sycl_platform_interface.cpp b/libsyclinterface/tests/test_sycl_platform_interface.cpp index 1fe9c80117..b722d74484 100644 --- a/libsyclinterface/tests/test_sycl_platform_interface.cpp +++ b/libsyclinterface/tests/test_sycl_platform_interface.cpp @@ -34,7 +34,7 @@ #include #include -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/tests/test_sycl_platform_invalid_filters.cpp b/libsyclinterface/tests/test_sycl_platform_invalid_filters.cpp index 35f31d7196..1418ef7f39 100644 --- a/libsyclinterface/tests/test_sycl_platform_invalid_filters.cpp +++ b/libsyclinterface/tests/test_sycl_platform_invalid_filters.cpp @@ -29,7 +29,8 @@ #include #include -using namespace cl::sycl; +using namespace sycl; + struct TestUnsupportedFilters : public ::testing::TestWithParam { DPCTLSyclDeviceSelectorRef DSRef = nullptr; diff --git a/libsyclinterface/tests/test_sycl_queue_interface.cpp b/libsyclinterface/tests/test_sycl_queue_interface.cpp index 25cb4e5481..ec829990be 100644 --- a/libsyclinterface/tests/test_sycl_queue_interface.cpp +++ b/libsyclinterface/tests/test_sycl_queue_interface.cpp @@ -36,7 +36,7 @@ #include #include -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/tests/test_sycl_queue_manager.cpp b/libsyclinterface/tests/test_sycl_queue_manager.cpp index 69c339e0a8..6cebf147f3 100644 --- a/libsyclinterface/tests/test_sycl_queue_manager.cpp +++ b/libsyclinterface/tests/test_sycl_queue_manager.cpp @@ -35,7 +35,7 @@ #include using namespace std; -using namespace cl::sycl; +using namespace sycl; namespace { diff --git a/libsyclinterface/tests/test_sycl_usm_interface.cpp b/libsyclinterface/tests/test_sycl_usm_interface.cpp index c7c137c143..23ffbec1f3 100644 --- a/libsyclinterface/tests/test_sycl_usm_interface.cpp +++ b/libsyclinterface/tests/test_sycl_usm_interface.cpp @@ -36,7 +36,7 @@ #include #include -using namespace cl::sycl; +using namespace sycl; namespace { From 1fc7563fc97f50fa9950558f4ae2f80e57f27451 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Sun, 4 Sep 2022 15:39:47 -0500 Subject: [PATCH 2/3] Removed uses of cl::sycl in comments and in header files Removed use of deprecated `sycl::info::device::profiling` from `print_device_info` function. Removed `DPCTLDevice_IsUnifiedHostMemory` which was DPCTL interface to deprecated `info::device::host_unified_memory` descriptor now that aspects are implemented. --- dpctl/_backend.pxd | 1 - dpctl/_sycl_device.pxd | 2 +- dpctl/_sycl_device.pyx | 2 +- dpctl/_sycl_event.pxd | 2 +- dpctl/_sycl_event.pyx | 16 ++++++++-------- dpctl/_sycl_platform.pxd | 2 +- dpctl/_sycl_platform.pyx | 2 +- dpctl/_sycl_queue.pyx | 4 ++-- .../sycl_direct_linkage/_buffer_example.pyx | 2 +- .../cython/sycl_direct_linkage/sycl_function.hpp | 2 +- examples/python/device_selection.py | 2 +- .../helper/include/dpctl_error_handlers.h | 2 +- .../include/dpctl_sycl_device_interface.h | 13 ------------- .../source/dpctl_sycl_device_interface.cpp | 14 -------------- .../source/dpctl_sycl_device_manager.cpp | 2 -- .../tests/test_sycl_device_interface.cpp | 8 -------- 16 files changed, 19 insertions(+), 57 deletions(-) diff --git a/dpctl/_backend.pxd b/dpctl/_backend.pxd index dba49a36e0..c9ed6ce024 100644 --- a/dpctl/_backend.pxd +++ b/dpctl/_backend.pxd @@ -175,7 +175,6 @@ cdef extern from "syclinterface/dpctl_sycl_device_interface.h": cdef bool DPCTLDevice_IsCPU(const DPCTLSyclDeviceRef DRef) cdef bool DPCTLDevice_IsGPU(const DPCTLSyclDeviceRef DRef) cdef bool DPCTLDevice_IsHost(const DPCTLSyclDeviceRef DRef) - cdef bool DPCTLDevice_IsHostUnifiedMemory(const DPCTLSyclDeviceRef DRef) cdef bool DPCTLDevice_GetSubGroupIndependentForwardProgress(const DPCTLSyclDeviceRef DRef) cdef uint32_t DPCTLDevice_GetPreferredVectorWidthChar(const DPCTLSyclDeviceRef DRef) cdef uint32_t DPCTLDevice_GetPreferredVectorWidthShort(const DPCTLSyclDeviceRef DRef) diff --git a/dpctl/_sycl_device.pxd b/dpctl/_sycl_device.pxd index a083ba4993..31c4d3775e 100644 --- a/dpctl/_sycl_device.pxd +++ b/dpctl/_sycl_device.pxd @@ -33,7 +33,7 @@ cdef public api class _SyclDevice [ object Py_SyclDeviceObject, type Py_SyclDeviceType ]: - """ A helper data-owner class to abstract a `cl::sycl::device` instance. + """ A helper data-owner class to abstract a `sycl::device` instance. """ cdef DPCTLSyclDeviceRef _device_ref cdef const char *_vendor diff --git a/dpctl/_sycl_device.pyx b/dpctl/_sycl_device.pyx index 155e4f2ca8..66dbf528bd 100644 --- a/dpctl/_sycl_device.pyx +++ b/dpctl/_sycl_device.pyx @@ -129,7 +129,7 @@ cdef class SyclSubDeviceCreationError(Exception): cdef class _SyclDevice: """ - A helper data-owner class to abstract a cl::sycl::device instance. + A helper data-owner class to abstract a `sycl::device` instance. """ def __dealloc__(self): diff --git a/dpctl/_sycl_event.pxd b/dpctl/_sycl_event.pxd index 714502007a..0c24d4bb2f 100644 --- a/dpctl/_sycl_event.pxd +++ b/dpctl/_sycl_event.pxd @@ -36,7 +36,7 @@ cdef public api class SyclEvent(_SyclEvent) [ object PySyclEventObject, type PySyclEventType ]: - """ Python wrapper class for a ``cl::sycl::event`` + """ Python wrapper class for a ``sycl::event`` """ @staticmethod cdef SyclEvent _create (DPCTLSyclEventRef event) diff --git a/dpctl/_sycl_event.pyx b/dpctl/_sycl_event.pyx index 90b942d12f..3d2ca0ea70 100644 --- a/dpctl/_sycl_event.pyx +++ b/dpctl/_sycl_event.pyx @@ -105,11 +105,11 @@ cdef class _SyclEvent: cdef class SyclEvent(_SyclEvent): """ SyclEvent(arg=None) - Python class representing ``cl::sycl::event``. There are multiple + Python class representing ``sycl::event``. There are multiple ways to create a :class:`dpctl.SyclEvent` object: - Invoking the constructor with no arguments creates a ready event - using the default constructor of the ``cl::sycl::event``. + using the default constructor of the ``sycl::event``. :Example: .. code-block:: python @@ -248,7 +248,7 @@ cdef class SyclEvent(_SyclEvent): def _get_capsule(self): """ - Returns a copy of the underlying ``cl::sycl::event`` pointer as a void + Returns a copy of the underlying ``sycl::event`` pointer as a void pointer inside a named ``PyCapsule`` that has the name **SyclEventRef**. The ownership of the pointer inside the capsule is passed to the caller, and pointer is deleted when the capsule goes out @@ -256,11 +256,11 @@ cdef class SyclEvent(_SyclEvent): Returns: :class:`pycapsule`: A capsule object storing a copy of the - ``cl::sycl::event`` pointer belonging to a + ``sycl::event`` pointer belonging to a :class:`dpctl.SyclEvent` instance. Raises: ValueError: If the ``DPCTLEvent_Copy`` fails to copy the - ``cl::sycl::event`` pointer. + ``sycl::event`` pointer. """ cdef DPCTLSyclEventRef ERef = NULL @@ -334,7 +334,7 @@ cdef class SyclEvent(_SyclEvent): def profiling_info_submit(self): """ Returns the 64-bit time value in nanoseconds - when ``cl::sycl::command_group`` was submitted to the queue. + when ``sycl::command_group`` was submitted to the queue. """ cdef uint64_t profiling_info_submit = 0 profiling_info_submit = DPCTLEvent_GetProfilingInfoSubmit( @@ -346,7 +346,7 @@ cdef class SyclEvent(_SyclEvent): def profiling_info_start(self): """ Returns the 64-bit time value in nanoseconds - when ``cl::sycl::command_group`` started execution on the device. + when ``sycl::command_group`` started execution on the device. """ cdef uint64_t profiling_info_start = 0 profiling_info_start = DPCTLEvent_GetProfilingInfoStart(self._event_ref) @@ -356,7 +356,7 @@ cdef class SyclEvent(_SyclEvent): def profiling_info_end(self): """ Returns the 64-bit time value in nanoseconds - when ``cl::sycl::command_group`` finished execution on the device. + when ``sycl::command_group`` finished execution on the device. """ cdef uint64_t profiling_info_end = 0 profiling_info_end = DPCTLEvent_GetProfilingInfoEnd(self._event_ref) diff --git a/dpctl/_sycl_platform.pxd b/dpctl/_sycl_platform.pxd index 8bb3a9a36a..3192398b24 100644 --- a/dpctl/_sycl_platform.pxd +++ b/dpctl/_sycl_platform.pxd @@ -25,7 +25,7 @@ from ._backend cimport DPCTLSyclDeviceSelectorRef, DPCTLSyclPlatformRef cdef class _SyclPlatform: - ''' A helper metaclass to abstract a cl::sycl::platform instance. + ''' A helper metaclass to abstract a ``sycl::platform`` instance. ''' cdef DPCTLSyclPlatformRef _platform_ref cdef const char *_vendor diff --git a/dpctl/_sycl_platform.pyx b/dpctl/_sycl_platform.pyx index 85752a22fb..d02385fbd9 100644 --- a/dpctl/_sycl_platform.pyx +++ b/dpctl/_sycl_platform.pyx @@ -81,7 +81,7 @@ cdef void _init_helper(_SyclPlatform platform, DPCTLSyclPlatformRef PRef): cdef class SyclPlatform(_SyclPlatform): """ SyclPlatform(self, arg=None) - Python class representing ``cl::sycl::platform`` class. + Python class representing ``sycl::platform`` class. SyclPlatform() - create platform selected by sycl::default_selector SyclPlatform(filter_selector) - create platform selected by filter diff --git a/dpctl/_sycl_queue.pyx b/dpctl/_sycl_queue.pyx index f6b433db60..57edb1506d 100644 --- a/dpctl/_sycl_queue.pyx +++ b/dpctl/_sycl_queue.pyx @@ -186,7 +186,7 @@ cdef class _SyclQueue: cdef class SyclQueue(_SyclQueue): """ SyclQueue(*args, **kwargs) - Python class representing ``cl::sycl::queue``. There are multiple + Python class representing ``sycl::queue``. There are multiple ways to create a :class:`dpctl.SyclQueue` object: - Invoking the constructor with no arguments creates a context using @@ -258,7 +258,7 @@ cdef class SyclQueue(_SyclQueue): context will be created from the specified device. dev (str, :class:`dpctl.SyclDevice`, capsule, optional): Sycl device to create :class:`dpctl.SyclQueue` from. If not specified, sycl - device selected by ``cl::sycl::default_selector`` is used. + device selected by ``sycl::default_selector`` is used. The argument must be explicitly specified if `ctxt` argument is provided. diff --git a/examples/cython/sycl_direct_linkage/_buffer_example.pyx b/examples/cython/sycl_direct_linkage/_buffer_example.pyx index effff5117c..b052e65ce4 100644 --- a/examples/cython/sycl_direct_linkage/_buffer_example.pyx +++ b/examples/cython/sycl_direct_linkage/_buffer_example.pyx @@ -24,7 +24,7 @@ import numpy as np from cython.operator cimport dereference as deref -cdef extern from "CL/sycl.hpp" namespace "cl::sycl": +cdef extern from "CL/sycl.hpp" namespace "sycl": cdef cppclass queue nogil: pass diff --git a/examples/cython/sycl_direct_linkage/sycl_function.hpp b/examples/cython/sycl_direct_linkage/sycl_function.hpp index 88ca1e2712..2bfd411156 100644 --- a/examples/cython/sycl_direct_linkage/sycl_function.hpp +++ b/examples/cython/sycl_direct_linkage/sycl_function.hpp @@ -1,6 +1,6 @@ #include -int c_columnwise_total(cl::sycl::queue &, +int c_columnwise_total(sycl::queue &, size_t n, size_t m, double *mat, diff --git a/examples/python/device_selection.py b/examples/python/device_selection.py index 5fa0e4c91b..49703720a6 100644 --- a/examples/python/device_selection.py +++ b/examples/python/device_selection.py @@ -22,7 +22,7 @@ def create_default_device(): """ - Create default SyclDevice using `cl::sycl::default_selector`. + Create default SyclDevice using `sycl::default_selector`. Device created can be influenced by environment variable SYCL_DEVICE_FILTER, which determines SYCL devices seen by the diff --git a/libsyclinterface/helper/include/dpctl_error_handlers.h b/libsyclinterface/helper/include/dpctl_error_handlers.h index 9bd93eec66..2470215338 100644 --- a/libsyclinterface/helper/include/dpctl_error_handlers.h +++ b/libsyclinterface/helper/include/dpctl_error_handlers.h @@ -42,7 +42,7 @@ class DPCTL_API DPCTL_AsyncErrorHandler { } - void operator()(const cl::sycl::exception_list &exceptions); + void operator()(const sycl::exception_list &exceptions); }; enum error_level : int diff --git a/libsyclinterface/include/dpctl_sycl_device_interface.h b/libsyclinterface/include/dpctl_sycl_device_interface.h index d11a4c6bb5..113ae6d045 100644 --- a/libsyclinterface/include/dpctl_sycl_device_interface.h +++ b/libsyclinterface/include/dpctl_sycl_device_interface.h @@ -312,19 +312,6 @@ DPCTL_API __dpctl_give const char * DPCTLDevice_GetVendor(__dpctl_keep const DPCTLSyclDeviceRef DRef); -/*! - * @brief Returns True if the device and the host share a unified memory - * subsystem, else returns False. - * - * @param DRef Opaque pointer to a ``sycl::device`` - * @return Boolean indicating if the device shares a unified memory subsystem - * with the host. - * @ingroup DeviceInterface - */ -DPCTL_API -bool DPCTLDevice_IsHostUnifiedMemory( - __dpctl_keep const DPCTLSyclDeviceRef DRef); - /*! * @brief Checks if two DPCTLSyclDeviceRef objects point to the same * sycl::device. diff --git a/libsyclinterface/source/dpctl_sycl_device_interface.cpp b/libsyclinterface/source/dpctl_sycl_device_interface.cpp index 2b2480cea5..20ae9f37cb 100644 --- a/libsyclinterface/source/dpctl_sycl_device_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_device_interface.cpp @@ -367,20 +367,6 @@ DPCTLDevice_GetDriverVersion(__dpctl_keep const DPCTLSyclDeviceRef DRef) return cstr_driver; } -bool DPCTLDevice_IsHostUnifiedMemory(__dpctl_keep const DPCTLSyclDeviceRef DRef) -{ - bool ret = false; - auto D = unwrap(DRef); - if (D) { - try { - ret = D->get_info(); - } catch (std::exception const &e) { - error_handler(e, __FILE__, __func__, __LINE__); - } - } - return ret; -} - bool DPCTLDevice_AreEq(__dpctl_keep const DPCTLSyclDeviceRef DRef1, __dpctl_keep const DPCTLSyclDeviceRef DRef2) { diff --git a/libsyclinterface/source/dpctl_sycl_device_manager.cpp b/libsyclinterface/source/dpctl_sycl_device_manager.cpp index 2875d0371d..82385ecf43 100644 --- a/libsyclinterface/source/dpctl_sycl_device_manager.cpp +++ b/libsyclinterface/source/dpctl_sycl_device_manager.cpp @@ -58,8 +58,6 @@ std::string get_device_info_str(const device &Device) << Device.get_info() << _endl << std::setw(4) << " " << std::left << std::setw(16) << "Vendor" << Device.get_info() << _endl << std::setw(4) - << " " << std::left << std::setw(16) << "Profile" - << Device.get_info() << _endl << std::setw(4) << " " << std::left << std::setw(16) << "Filter string" << DPCTL_GetDeviceFilterString(Device) << _endl; diff --git a/libsyclinterface/tests/test_sycl_device_interface.cpp b/libsyclinterface/tests/test_sycl_device_interface.cpp index f1c75ed8ec..3728530020 100644 --- a/libsyclinterface/tests/test_sycl_device_interface.cpp +++ b/libsyclinterface/tests/test_sycl_device_interface.cpp @@ -586,14 +586,6 @@ TEST_F(TestDPCTLSyclDeviceNullArgs, ChkDriverVersion) ASSERT_TRUE(driver_version == nullptr); } -TEST_F(TestDPCTLSyclDeviceNullArgs, ChkIsHostUnifiedMemory) -{ - bool is_hum = true; - EXPECT_NO_FATAL_FAILURE(is_hum = - DPCTLDevice_IsHostUnifiedMemory(Null_DRef)); - ASSERT_FALSE(is_hum); -} - TEST_F(TestDPCTLSyclDeviceNullArgs, ChkAreEq) { bool are_eq = true; From 5dfa07c0458a822c5cc5090ba61a220971d653b0 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Wed, 7 Sep 2022 15:38:22 -0500 Subject: [PATCH 3/3] Change C++ function signature called by sycl_direct_linkage example The function now gets execution queue by value rather than by reference. This is the recommended usage since ``sycl::queue`` is implemented as a shared pointer. --- examples/cython/sycl_direct_linkage/_buffer_example.pyx | 2 +- examples/cython/sycl_direct_linkage/sycl_function.cpp | 2 +- examples/cython/sycl_direct_linkage/sycl_function.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/cython/sycl_direct_linkage/_buffer_example.pyx b/examples/cython/sycl_direct_linkage/_buffer_example.pyx index b052e65ce4..d0dd87aa06 100644 --- a/examples/cython/sycl_direct_linkage/_buffer_example.pyx +++ b/examples/cython/sycl_direct_linkage/_buffer_example.pyx @@ -31,7 +31,7 @@ cdef extern from "CL/sycl.hpp" namespace "sycl": cdef extern from "sycl_function.hpp": int c_columnwise_total( - queue& q, size_t n, size_t m, double *m, double *ct + queue q, size_t n, size_t m, double *m, double *ct ) nogil diff --git a/examples/cython/sycl_direct_linkage/sycl_function.cpp b/examples/cython/sycl_direct_linkage/sycl_function.cpp index 3927be82e5..15a09b30a0 100644 --- a/examples/cython/sycl_direct_linkage/sycl_function.cpp +++ b/examples/cython/sycl_direct_linkage/sycl_function.cpp @@ -31,7 +31,7 @@ #include #include -int c_columnwise_total(sycl::queue &q, +int c_columnwise_total(sycl::queue q, size_t n, size_t m, double *mat, diff --git a/examples/cython/sycl_direct_linkage/sycl_function.hpp b/examples/cython/sycl_direct_linkage/sycl_function.hpp index 2bfd411156..c977810f15 100644 --- a/examples/cython/sycl_direct_linkage/sycl_function.hpp +++ b/examples/cython/sycl_direct_linkage/sycl_function.hpp @@ -1,6 +1,6 @@ #include -int c_columnwise_total(sycl::queue &, +int c_columnwise_total(sycl::queue, size_t n, size_t m, double *mat,