From 042d9cf518c0b175308f9615f84f48d98c14381f Mon Sep 17 00:00:00 2001 From: Sergey V Maslov Date: Wed, 23 Nov 2022 18:25:10 -0800 Subject: [PATCH 01/14] [SYCL] Add support for sycl::ext::oneapi::property::queue::use_priority Signed-off-by: Sergey V Maslov --- sycl/include/sycl/detail/pi.h | 4 ++++ sycl/include/sycl/detail/properties_traits.def | 10 +++++++--- sycl/include/sycl/detail/property_helper.hpp | 3 ++- .../sycl/properties/queue_properties.hpp | 18 ++++++++++++++++++ sycl/plugins/level_zero/pi_level_zero.cpp | 17 ++++++++++++++++- sycl/plugins/level_zero/pi_level_zero.hpp | 16 ++++++++++------ sycl/source/detail/queue_impl.hpp | 9 +++++++++ 7 files changed, 66 insertions(+), 11 deletions(-) mode change 100755 => 100644 sycl/plugins/level_zero/pi_level_zero.cpp diff --git a/sycl/include/sycl/detail/pi.h b/sycl/include/sycl/detail/pi.h index 4c840b74d9197..e1818f5c50143 100644 --- a/sycl/include/sycl/detail/pi.h +++ b/sycl/include/sycl/detail/pi.h @@ -56,6 +56,8 @@ // 11.16 Add PI_EXT_INTEL_DEVICE_INFO_MEMORY_CLOCK_RATE and // PI_EXT_INTEL_DEVICE_INFO_MEMORY_BUS_WIDTH as an extension for // piDeviceGetInfo. +// 11.17 Added new PI_EXT_ONEAPI_QUEUE_PRIORITY_LOW and +// PI_EXT_ONEAPI_QUEUE_PRIORITY_HIGH queue properties. #define _PI_H_VERSION_MAJOR 11 #define _PI_H_VERSION_MINOR 16 @@ -580,6 +582,8 @@ constexpr pi_queue_properties PI_QUEUE_PROFILING_ENABLE = (1 << 1); constexpr pi_queue_properties PI_QUEUE_ON_DEVICE = (1 << 2); constexpr pi_queue_properties PI_QUEUE_ON_DEVICE_DEFAULT = (1 << 3); constexpr pi_queue_properties PI_EXT_ONEAPI_QUEUE_DISCARD_EVENTS = (1 << 4); +constexpr pi_queue_properties PI_EXT_ONEAPI_QUEUE_PRIORITY_LOW = (1 << 5); +constexpr pi_queue_properties PI_EXT_ONEAPI_QUEUE_PRIORITY_HIGH = (1 << 6); using pi_result = _pi_result; using pi_platform_info = _pi_platform_info; diff --git a/sycl/include/sycl/detail/properties_traits.def b/sycl/include/sycl/detail/properties_traits.def index ac490b1bc478d..dcb033d61e0cf 100644 --- a/sycl/include/sycl/detail/properties_traits.def +++ b/sycl/include/sycl/detail/properties_traits.def @@ -4,10 +4,14 @@ __SYCL_PARAM_TRAITS_SPEC(sycl::property::buffer::context_bound) __SYCL_PARAM_TRAITS_SPEC(sycl::property::image::use_host_ptr) __SYCL_PARAM_TRAITS_SPEC(sycl::property::image::use_mutex) __SYCL_PARAM_TRAITS_SPEC(sycl::property::image::context_bound) -__SYCL_PARAM_TRAITS_SPEC(sycl::ext::oneapi::property::buffer::use_pinned_host_memory) +__SYCL_PARAM_TRAITS_SPEC( + sycl::ext::oneapi::property::buffer::use_pinned_host_memory) __SYCL_PARAM_TRAITS_SPEC(sycl::property::noinit) __SYCL_PARAM_TRAITS_SPEC(sycl::property::no_init) -__SYCL_PARAM_TRAITS_SPEC(sycl::property::context::cuda::use_primary_context) // Deprecated -__SYCL_PARAM_TRAITS_SPEC(sycl::ext::oneapi::cuda::property::context::use_primary_context) +__SYCL_PARAM_TRAITS_SPEC( + sycl::property::context::cuda::use_primary_context) // Deprecated +__SYCL_PARAM_TRAITS_SPEC( + sycl::ext::oneapi::cuda::property::context::use_primary_context) __SYCL_PARAM_TRAITS_SPEC(sycl::property::queue::in_order) __SYCL_PARAM_TRAITS_SPEC(sycl::property::reduction::initialize_to_identity) +__SYCL_PARAM_TRAITS_SPEC(sycl::ext::oneapi::property::queue::use_priority) \ No newline at end of file diff --git a/sycl/include/sycl/detail/property_helper.hpp b/sycl/include/sycl/detail/property_helper.hpp index 2a802fd1e7181..7906ee640d007 100644 --- a/sycl/include/sycl/detail/property_helper.hpp +++ b/sycl/include/sycl/detail/property_helper.hpp @@ -54,7 +54,8 @@ enum PropWithDataKind { ImageContextBound = 3, BufferMemChannel = 4, AccPropBufferLocation = 5, - PropWithDataKindSize = 6, + QueuePriority = 6, + PropWithDataKindSize = 7, }; // Base class for dataless properties, needed to check that the type of an diff --git a/sycl/include/sycl/properties/queue_properties.hpp b/sycl/include/sycl/properties/queue_properties.hpp index 21a2c7fbdc086..f532dabdfc1ee 100644 --- a/sycl/include/sycl/properties/queue_properties.hpp +++ b/sycl/include/sycl/properties/queue_properties.hpp @@ -28,6 +28,21 @@ namespace property { namespace queue { class discard_events : public ::sycl::detail::DataLessProperty<::sycl::detail::DiscardEvents> {}; + +class use_priority : public sycl::detail::PropertyWithData< + sycl::detail::PropWithDataKind::QueuePriority> { +public: + using priority_type = enum { + normal = 0, // default + low = 1, + high = 2 + }; + use_priority(priority_type Priority) : MPriority(Priority) {} + priority_type get_priority() const { return MPriority; } + +private: + priority_type MPriority; +}; } // namespace queue } // namespace property @@ -67,6 +82,9 @@ template <> struct is_property_of : std::true_type {}; template <> +struct is_property_of + : std::true_type {}; +template <> struct is_property_of : std::true_type {}; template <> diff --git a/sycl/plugins/level_zero/pi_level_zero.cpp b/sycl/plugins/level_zero/pi_level_zero.cpp old mode 100755 new mode 100644 index 3aa1238eb963e..d8edb93a77788 --- a/sycl/plugins/level_zero/pi_level_zero.cpp +++ b/sycl/plugins/level_zero/pi_level_zero.cpp @@ -1002,6 +1002,14 @@ bool _pi_queue::isDiscardEvents() const { return ((this->Properties & PI_EXT_ONEAPI_QUEUE_DISCARD_EVENTS) != 0); } +bool _pi_queue::isPriorityLow() const { + return ((this->Properties & PI_EXT_ONEAPI_QUEUE_PRIORITY_LOW) != 0); +} + +bool _pi_queue::isPriorityHigh() const { + return ((this->Properties & PI_EXT_ONEAPI_QUEUE_PRIORITY_HIGH) != 0); +} + pi_result _pi_queue::resetCommandList(pi_command_list_ptr_t CommandList, bool MakeAvailable, @@ -1829,6 +1837,11 @@ _pi_queue::pi_queue_group_t::getZeQueue(uint32_t *QueueGroupOrdinal) { ZeCommandQueueDesc.ordinal = *QueueGroupOrdinal; ZeCommandQueueDesc.index = QueueIndex; ZeCommandQueueDesc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS; + if (Queue->isPriorityLow()) { + ZeCommandQueueDesc.priority = ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW; + } else if (Queue->isPriorityHigh()) { + ZeCommandQueueDesc.priority = ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH; + } // Evaluate performance of explicit usage for "0" index. if (QueueIndex != 0) { @@ -3532,7 +3545,9 @@ pi_result piQueueCreate(pi_context Context, pi_device Device, PI_ASSERT(!(Properties & ~(PI_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | PI_QUEUE_PROFILING_ENABLE | PI_QUEUE_ON_DEVICE | PI_QUEUE_ON_DEVICE_DEFAULT | - PI_EXT_ONEAPI_QUEUE_DISCARD_EVENTS)), + PI_EXT_ONEAPI_QUEUE_DISCARD_EVENTS | + PI_EXT_ONEAPI_QUEUE_PRIORITY_LOW | + PI_EXT_ONEAPI_QUEUE_PRIORITY_HIGH)), PI_ERROR_INVALID_VALUE); PI_ASSERT(Context, PI_ERROR_INVALID_CONTEXT); diff --git a/sycl/plugins/level_zero/pi_level_zero.hpp b/sycl/plugins/level_zero/pi_level_zero.hpp index 7a34d86c9e7ed..2712120e2f940 100644 --- a/sycl/plugins/level_zero/pi_level_zero.hpp +++ b/sycl/plugins/level_zero/pi_level_zero.hpp @@ -432,9 +432,9 @@ using pi_command_list_ptr_t = pi_command_list_map_t::iterator; struct _pi_context : _pi_object { _pi_context(ze_context_handle_t ZeContext, pi_uint32 NumDevices, const pi_device *Devs, bool OwnZeContext) - : ZeContext{ZeContext}, - OwnZeContext{OwnZeContext}, Devices{Devs, Devs + NumDevices}, - SingleRootDevice(getRootDevice()), ZeCommandListInit{nullptr} { + : ZeContext{ZeContext}, OwnZeContext{OwnZeContext}, + Devices{Devs, Devs + NumDevices}, SingleRootDevice(getRootDevice()), + ZeCommandListInit{nullptr} { // NOTE: one must additionally call initialize() to complete // PI context creation. } @@ -788,6 +788,10 @@ struct _pi_queue : _pi_object { // Returns true if the queue has discard events property. bool isDiscardEvents() const; + // Returns true if the queue has explicit priority set by user. + bool isPriorityLow() const; + bool isPriorityHigh() const; + // adjust the queue's batch size, knowing that the current command list // is being closed with a full batch. // For copy commands, IsCopy is set to 'true'. @@ -1366,9 +1370,9 @@ struct _pi_program : _pi_object { // Construct a program in IL or Native state. _pi_program(state St, pi_context Context, const void *Input, size_t Length) - : Context{Context}, - OwnZeModule{true}, State{St}, Code{new uint8_t[Length]}, - CodeLength{Length}, ZeModule{nullptr}, ZeBuildLog{nullptr} { + : Context{Context}, OwnZeModule{true}, State{St}, + Code{new uint8_t[Length]}, CodeLength{Length}, ZeModule{nullptr}, + ZeBuildLog{nullptr} { std::memcpy(Code.get(), Input, Length); } diff --git a/sycl/source/detail/queue_impl.hpp b/sycl/source/detail/queue_impl.hpp index 6017dc30e1b09..e743ff09287f8 100644 --- a/sycl/source/detail/queue_impl.hpp +++ b/sycl/source/detail/queue_impl.hpp @@ -312,6 +312,15 @@ class queue_impl { // queue property. CreationFlags |= PI_EXT_ONEAPI_QUEUE_DISCARD_EVENTS; } + if (MPropList.has_property()) { + auto Priority = + MPropList.get_property() + .get_priority(); + if (Priority == ext::oneapi::property::queue::use_priority::high) + CreationFlags |= PI_EXT_ONEAPI_QUEUE_PRIORITY_HIGH; + else if (Priority == ext::oneapi::property::queue::use_priority::low) + CreationFlags |= PI_EXT_ONEAPI_QUEUE_PRIORITY_LOW; + } RT::PiQueue Queue{}; RT::PiContext Context = MContext->getHandleRef(); RT::PiDevice Device = MDevice->getHandleRef(); From e023104c80c24e6d9aa09faf794abe41a893a4dd Mon Sep 17 00:00:00 2001 From: Sergey V Maslov Date: Sat, 26 Nov 2022 17:58:22 -0800 Subject: [PATCH 02/14] add symbols Signed-off-by: Sergey V Maslov --- sycl/test/abi/sycl_symbols_linux.dump | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sycl/test/abi/sycl_symbols_linux.dump b/sycl/test/abi/sycl_symbols_linux.dump index c8415dc69b4c7..05cc9bb5b587d 100644 --- a/sycl/test/abi/sycl_symbols_linux.dump +++ b/sycl/test/abi/sycl_symbols_linux.dump @@ -3890,9 +3890,11 @@ _ZN4sycl3_V16device11get_devicesENS0_4info11device_typeE _ZN4sycl3_V16deviceC1EP13_cl_device_id _ZN4sycl3_V16deviceC1ERKNS0_15device_selectorE _ZN4sycl3_V16deviceC1Ev +_ZN4sycl3_V16deviceC1IFiRKS1_EvEERKT_ _ZN4sycl3_V16deviceC2EP13_cl_device_id _ZN4sycl3_V16deviceC2ERKNS0_15device_selectorE _ZN4sycl3_V16deviceC2Ev +_ZN4sycl3_V16deviceC2IFiRKS1_EvEERKT_ _ZN4sycl3_V16kernelC1EP10_cl_kernelRKNS0_7contextE _ZN4sycl3_V16kernelC1ESt10shared_ptrINS0_6detail11kernel_implEE _ZN4sycl3_V16kernelC2EP10_cl_kernelRKNS0_7contextE @@ -3968,10 +3970,12 @@ _ZN4sycl3_V18platformC1EP15_cl_platform_id _ZN4sycl3_V18platformC1ERKNS0_15device_selectorE _ZN4sycl3_V18platformC1ERKNS0_6deviceE _ZN4sycl3_V18platformC1Ev +_ZN4sycl3_V18platformC1IFiRKNS0_6deviceEEvEERKT_ _ZN4sycl3_V18platformC2EP15_cl_platform_id _ZN4sycl3_V18platformC2ERKNS0_15device_selectorE _ZN4sycl3_V18platformC2ERKNS0_6deviceE _ZN4sycl3_V18platformC2Ev +_ZN4sycl3_V18platformC2IFiRKNS0_6deviceEEvEERKT_ _ZN4sycl3_V19exceptionC1ENS0_7contextESt10error_code _ZN4sycl3_V19exceptionC1ENS0_7contextESt10error_codePKc _ZN4sycl3_V19exceptionC1ENS0_7contextESt10error_codeRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE @@ -4057,6 +4061,7 @@ _ZNK4sycl3_V16detail11buffer_impl15getNativeVectorENS0_7backendE _ZNK4sycl3_V16detail11buffer_impl16addInteropObjectERSt6vectorImSaImEE _ZNK4sycl3_V16detail11image_plain11getRowPitchEv _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEET_v +_ZNK4sycl3_V16detail11image_plain12get_propertyINS0_3ext6oneapi8property5queue12use_priorityEEET_v _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEET_v _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_8property5image12use_host_ptrEEET_v _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_8property5image13context_boundEEET_v @@ -4070,6 +4075,7 @@ _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_8property7context4cuda19use_ _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_8property7no_initEEET_v _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_8property9reduction22initialize_to_identityEEET_v _ZNK4sycl3_V16detail11image_plain12has_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEEbv +_ZNK4sycl3_V16detail11image_plain12has_propertyINS0_3ext6oneapi8property5queue12use_priorityEEEbv _ZNK4sycl3_V16detail11image_plain12has_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEEbv _ZNK4sycl3_V16detail11image_plain12has_propertyINS0_8property5image12use_host_ptrEEEbv _ZNK4sycl3_V16detail11image_plain12has_propertyINS0_8property5image13context_boundEEEbv @@ -4094,6 +4100,7 @@ _ZNK4sycl3_V16detail11image_plain9get_rangeEv _ZNK4sycl3_V16detail11stream_impl22get_max_statement_sizeEv _ZNK4sycl3_V16detail11stream_impl8get_sizeEv _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEET_v +_ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_3ext6oneapi8property5queue12use_priorityEEET_v _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEET_v _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_8property5image12use_host_ptrEEET_v _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_8property5image13context_boundEEET_v @@ -4107,6 +4114,7 @@ _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_8property7context4cuda19use _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_8property7no_initEEET_v _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_8property9reduction22initialize_to_identityEEET_v _ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEEbv +_ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_3ext6oneapi8property5queue12use_priorityEEEbv _ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEEbv _ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_8property5image12use_host_ptrEEEbv _ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_8property5image13context_boundEEEbv @@ -4313,6 +4321,7 @@ _ZNK4sycl3_V16kernel8get_infoINS0_4info6kernel7contextEEENS0_6detail19is_kernel_ _ZNK4sycl3_V16kernel8get_infoINS0_4info6kernel8num_argsEEENS0_6detail19is_kernel_info_descIT_E11return_typeEv _ZNK4sycl3_V16kernel9getNativeEv _ZNK4sycl3_V16stream12get_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEET_v +_ZNK4sycl3_V16stream12get_propertyINS0_3ext6oneapi8property5queue12use_priorityEEET_v _ZNK4sycl3_V16stream12get_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEET_v _ZNK4sycl3_V16stream12get_propertyINS0_8property5image12use_host_ptrEEET_v _ZNK4sycl3_V16stream12get_propertyINS0_8property5image13context_boundEEET_v @@ -4326,6 +4335,7 @@ _ZNK4sycl3_V16stream12get_propertyINS0_8property7context4cuda19use_primary_conte _ZNK4sycl3_V16stream12get_propertyINS0_8property7no_initEEET_v _ZNK4sycl3_V16stream12get_propertyINS0_8property9reduction22initialize_to_identityEEET_v _ZNK4sycl3_V16stream12has_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEEbv +_ZNK4sycl3_V16stream12has_propertyINS0_3ext6oneapi8property5queue12use_priorityEEEbv _ZNK4sycl3_V16stream12has_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEEbv _ZNK4sycl3_V16stream12has_propertyINS0_8property5image12use_host_ptrEEEbv _ZNK4sycl3_V16stream12has_propertyINS0_8property5image13context_boundEEEbv @@ -4346,6 +4356,7 @@ _ZNK4sycl3_V17context11get_backendEv _ZNK4sycl3_V17context11get_devicesEv _ZNK4sycl3_V17context12get_platformEv _ZNK4sycl3_V17context12get_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEET_v +_ZNK4sycl3_V17context12get_propertyINS0_3ext6oneapi8property5queue12use_priorityEEET_v _ZNK4sycl3_V17context12get_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEET_v _ZNK4sycl3_V17context12get_propertyINS0_8property5image12use_host_ptrEEET_v _ZNK4sycl3_V17context12get_propertyINS0_8property5image13context_boundEEET_v @@ -4359,6 +4370,7 @@ _ZNK4sycl3_V17context12get_propertyINS0_8property7context4cuda19use_primary_cont _ZNK4sycl3_V17context12get_propertyINS0_8property7no_initEEET_v _ZNK4sycl3_V17context12get_propertyINS0_8property9reduction22initialize_to_identityEEET_v _ZNK4sycl3_V17context12has_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEEbv +_ZNK4sycl3_V17context12has_propertyINS0_3ext6oneapi8property5queue12use_priorityEEEbv _ZNK4sycl3_V17context12has_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEEbv _ZNK4sycl3_V17context12has_propertyINS0_8property5image12use_host_ptrEEEbv _ZNK4sycl3_V17context12has_propertyINS0_8property5image13context_boundEEEbv @@ -4382,6 +4394,7 @@ _ZNK4sycl3_V17context9getNativeEv _ZNK4sycl3_V17handler27isStateExplicitKernelBundleEv _ZNK4sycl3_V17handler30getOrInsertHandlerKernelBundleEb _ZNK4sycl3_V17sampler12get_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEET_v +_ZNK4sycl3_V17sampler12get_propertyINS0_3ext6oneapi8property5queue12use_priorityEEET_v _ZNK4sycl3_V17sampler12get_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEET_v _ZNK4sycl3_V17sampler12get_propertyINS0_8property5image12use_host_ptrEEET_v _ZNK4sycl3_V17sampler12get_propertyINS0_8property5image13context_boundEEET_v @@ -4395,6 +4408,7 @@ _ZNK4sycl3_V17sampler12get_propertyINS0_8property7context4cuda19use_primary_cont _ZNK4sycl3_V17sampler12get_propertyINS0_8property7no_initEEET_v _ZNK4sycl3_V17sampler12get_propertyINS0_8property9reduction22initialize_to_identityEEET_v _ZNK4sycl3_V17sampler12has_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEEbv +_ZNK4sycl3_V17sampler12has_propertyINS0_3ext6oneapi8property5queue12use_priorityEEEbv _ZNK4sycl3_V17sampler12has_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEEbv _ZNK4sycl3_V17sampler12has_propertyINS0_8property5image12use_host_ptrEEEbv _ZNK4sycl3_V17sampler12has_propertyINS0_8property5image13context_boundEEEbv From 5b5ba66e73bb3aed474d96d2771839aa6ddce0a6 Mon Sep 17 00:00:00 2001 From: Sergey V Maslov Date: Sat, 26 Nov 2022 18:34:22 -0800 Subject: [PATCH 03/14] print queue priority under ZE_DEBUG Signed-off-by: Sergey V Maslov --- sycl/plugins/level_zero/pi_level_zero.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/sycl/plugins/level_zero/pi_level_zero.cpp b/sycl/plugins/level_zero/pi_level_zero.cpp index d8edb93a77788..4fcbbdf73c974 100644 --- a/sycl/plugins/level_zero/pi_level_zero.cpp +++ b/sycl/plugins/level_zero/pi_level_zero.cpp @@ -1837,10 +1837,13 @@ _pi_queue::pi_queue_group_t::getZeQueue(uint32_t *QueueGroupOrdinal) { ZeCommandQueueDesc.ordinal = *QueueGroupOrdinal; ZeCommandQueueDesc.index = QueueIndex; ZeCommandQueueDesc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS; + const char *Priority = "Normal"; if (Queue->isPriorityLow()) { ZeCommandQueueDesc.priority = ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW; + Priority = "Low"; } else if (Queue->isPriorityHigh()) { ZeCommandQueueDesc.priority = ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH; + Priority = "High"; } // Evaluate performance of explicit usage for "0" index. @@ -1849,9 +1852,9 @@ _pi_queue::pi_queue_group_t::getZeQueue(uint32_t *QueueGroupOrdinal) { } zePrint("[getZeQueue]: create queue ordinal = %d, index = %d " - "(round robin in [%d, %d])\n", + "(round robin in [%d, %d]) priority = %s\n", ZeCommandQueueDesc.ordinal, ZeCommandQueueDesc.index, LowerIndex, - UpperIndex); + UpperIndex, Priority); auto ZeResult = ZE_CALL_NOCHECK( zeCommandQueueCreate, (Queue->Context->ZeContext, Queue->Device->ZeDevice, @@ -1877,6 +1880,14 @@ pi_command_list_ptr_t &_pi_queue::pi_queue_group_t::getImmCmdList() { ZeCommandQueueDesc.ordinal = QueueOrdinal; ZeCommandQueueDesc.index = QueueIndex; ZeCommandQueueDesc.mode = ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS; + const char *Priority = "Normal"; + if (Queue->isPriorityLow()) { + ZeCommandQueueDesc.priority = ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW; + Priority = "Low"; + } else if (Queue->isPriorityHigh()) { + ZeCommandQueueDesc.priority = ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH; + Priority = "High"; + } // Evaluate performance of explicit usage for "0" index. if (QueueIndex != 0) { @@ -1884,9 +1895,9 @@ pi_command_list_ptr_t &_pi_queue::pi_queue_group_t::getImmCmdList() { } zePrint("[getZeQueue]: create queue ordinal = %d, index = %d " - "(round robin in [%d, %d])\n", + "(round robin in [%d, %d]) priority = %s\n", ZeCommandQueueDesc.ordinal, ZeCommandQueueDesc.index, LowerIndex, - UpperIndex); + UpperIndex, Priority); ze_command_list_handle_t ZeCommandList; ZE_CALL_NOCHECK(zeCommandListCreateImmediate, From 3eeeca99c8167fe2a38574cf0179bf0e663aadb8 Mon Sep 17 00:00:00 2001 From: Sergey V Maslov Date: Sat, 26 Nov 2022 18:37:08 -0800 Subject: [PATCH 04/14] added feature test macro SYCL_EXT_ONEAPI_QUEUE_PRIORITY Signed-off-by: Sergey V Maslov --- sycl/include/sycl/feature_test.hpp.in | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 sycl/include/sycl/feature_test.hpp.in diff --git a/sycl/include/sycl/feature_test.hpp.in b/sycl/include/sycl/feature_test.hpp.in old mode 100644 new mode 100755 index 4ffc81e3eb730..ddec34b5bdb4e --- a/sycl/include/sycl/feature_test.hpp.in +++ b/sycl/include/sycl/feature_test.hpp.in @@ -37,6 +37,7 @@ __SYCL_INLINE_VER_NAMESPACE(_V1) { #define SYCL_EXT_ONEAPI_ASSERT 1 #define SYCL_EXT_ONEAPI_COMPLEX_ALGORITHMS 1 #define SYCL_EXT_ONEAPI_DISCARD_QUEUE_EVENTS 1 +#define SYCL_EXT_ONEAPI_QUEUE_PRIORITY 1 #define SYCL_EXT_ONEAPI_ENQUEUE_BARRIER 1 #define SYCL_EXT_ONEAPI_FREE_FUNCTION_QUERIES 1 #define SYCL_EXT_ONEAPI_GROUP_ALGORITHMS 1 From 50a9feb1f858fc3c92f3014e3c32cc333b1e4323 Mon Sep 17 00:00:00 2001 From: Sergey V Maslov Date: Sat, 26 Nov 2022 19:00:27 -0800 Subject: [PATCH 05/14] added extension doc Signed-off-by: Sergey V Maslov --- .../sycl_ext_oneapi_queue_priority.asciidoc | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc diff --git a/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc b/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc new file mode 100644 index 0000000000000..a3fb223a044bc --- /dev/null +++ b/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc @@ -0,0 +1,97 @@ += sycl_ext_oneapi_queue_priority + +:source-highlighter: coderay +:coderay-linenums-mode: table + +// This section needs to be after the document title. +:doctype: book +:toc2: +:toc: left +:encoding: utf-8 +:lang: en +:dpcpp: pass:[DPC++] + +// Set the default source code type in this document to C++, +// for syntax highlighting purposes. This is needed because +// docbook uses c++ and html5 uses cpp. +:language: {basebackend@docbook:c++:cpp} + + +== Notice + +[%hardbreaks] +Copyright (C) 2022-2022 Intel Corporation. All rights reserved. + +Khronos(R) is a registered trademark and SYCL(TM) and SPIR(TM) are trademarks +of The Khronos Group Inc. OpenCL(TM) is a trademark of Apple Inc. used by +permission by Khronos. + +== Contact + +To report problems with this extension, please open a new issue at: + +https://github.com/intel/llvm/issues + + +== Dependencies + +This extension is written against the SYCL 2020 revision 4 specification. All +references below to the "core SYCL specification" or to section numbers in the +SYCL specification refer to that revision. + +== Status + +This extension is implemented and fully supported by {dpcpp}. + +== Overview + +Introduce SYCL queue property specifying desired priority of the queue. +This priority is a hint and may be ignored if not supported by +underlying backends. + +== Specification + +=== Feature test macro + +This extension provides a feature-test macro as described in the core SYCL +specification. An implementation supporting this extension must predefine +the macro `SYCL_EXT_ONEAPI_QUEUE_PRIORITY` to one of the values defined +in the table below. Applications can test for the existence of this macro +to determine if the implementation supports this feature, or applications +can test the macro's value to determine which of the extension's features +the implementation supports. + +[%header,cols="1,5"] +|=== +|Value +|Description + +|1 +|Initial version of this extension. +|=== + +=== API of the extension + +This extension adds support for a new property for SYCL queue constructors +taking properties list: + +```c++ +namespace sycl::ext::oneapi::property::queue { + + class use_priority { + public: + using priority_type = enum { + normal = 0, // default + low = 1, + high = 2 + }; + use_priority(priority_type); + }; + +} // namespace +``` +The new property hints the SYCL runtime that the queue gets the specified +priority for execution if supported by underlying target runtimes. This +property is a hint and may safely be ignored by an implementation. In the +initial version (`SYCL_EXT_ONEAPI_QUEUE_PRIORITY` equals to `1`) it is +supported by Level Zero backend only. From 1c4d539d85b373d4c17102c00928a1ab57343dfb Mon Sep 17 00:00:00 2001 From: Sergey V Maslov Date: Sat, 26 Nov 2022 19:45:23 -0800 Subject: [PATCH 06/14] update sumbols from Release build Signed-off-by: Sergey V Maslov --- sycl/test/abi/sycl_symbols_linux.dump | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sycl/test/abi/sycl_symbols_linux.dump b/sycl/test/abi/sycl_symbols_linux.dump index 05cc9bb5b587d..ccef090d47e08 100644 --- a/sycl/test/abi/sycl_symbols_linux.dump +++ b/sycl/test/abi/sycl_symbols_linux.dump @@ -3890,11 +3890,9 @@ _ZN4sycl3_V16device11get_devicesENS0_4info11device_typeE _ZN4sycl3_V16deviceC1EP13_cl_device_id _ZN4sycl3_V16deviceC1ERKNS0_15device_selectorE _ZN4sycl3_V16deviceC1Ev -_ZN4sycl3_V16deviceC1IFiRKS1_EvEERKT_ _ZN4sycl3_V16deviceC2EP13_cl_device_id _ZN4sycl3_V16deviceC2ERKNS0_15device_selectorE _ZN4sycl3_V16deviceC2Ev -_ZN4sycl3_V16deviceC2IFiRKS1_EvEERKT_ _ZN4sycl3_V16kernelC1EP10_cl_kernelRKNS0_7contextE _ZN4sycl3_V16kernelC1ESt10shared_ptrINS0_6detail11kernel_implEE _ZN4sycl3_V16kernelC2EP10_cl_kernelRKNS0_7contextE @@ -3970,12 +3968,10 @@ _ZN4sycl3_V18platformC1EP15_cl_platform_id _ZN4sycl3_V18platformC1ERKNS0_15device_selectorE _ZN4sycl3_V18platformC1ERKNS0_6deviceE _ZN4sycl3_V18platformC1Ev -_ZN4sycl3_V18platformC1IFiRKNS0_6deviceEEvEERKT_ _ZN4sycl3_V18platformC2EP15_cl_platform_id _ZN4sycl3_V18platformC2ERKNS0_15device_selectorE _ZN4sycl3_V18platformC2ERKNS0_6deviceE _ZN4sycl3_V18platformC2Ev -_ZN4sycl3_V18platformC2IFiRKNS0_6deviceEEvEERKT_ _ZN4sycl3_V19exceptionC1ENS0_7contextESt10error_code _ZN4sycl3_V19exceptionC1ENS0_7contextESt10error_codePKc _ZN4sycl3_V19exceptionC1ENS0_7contextESt10error_codeRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE From 02803cd6c751adc2db05bd0668fd2aac862b7574 Mon Sep 17 00:00:00 2001 From: Sergey V Maslov Date: Mon, 28 Nov 2022 13:44:06 -0800 Subject: [PATCH 07/14] address comments on doc Signed-off-by: Sergey V Maslov --- .../supported/sycl_ext_oneapi_queue_priority.asciidoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc diff --git a/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc b/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc old mode 100644 new mode 100755 index a3fb223a044bc..8793393c7f91c --- a/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc +++ b/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc @@ -42,6 +42,8 @@ SYCL specification refer to that revision. == Status This extension is implemented and fully supported by {dpcpp}. +Although {dpcpp} supports this extension on all backends, it is currently used +only on Level Zero. Other backends ignore this new property. == Overview @@ -92,6 +94,4 @@ namespace sycl::ext::oneapi::property::queue { ``` The new property hints the SYCL runtime that the queue gets the specified priority for execution if supported by underlying target runtimes. This -property is a hint and may safely be ignored by an implementation. In the -initial version (`SYCL_EXT_ONEAPI_QUEUE_PRIORITY` equals to `1`) it is -supported by Level Zero backend only. +property is a hint and may safely be ignored by an implementation. From 00d167821b349e542a0c4ec78aa0da1aa4d42d00 Mon Sep 17 00:00:00 2001 From: Sergey V Maslov Date: Mon, 28 Nov 2022 13:44:23 -0800 Subject: [PATCH 08/14] chmod Signed-off-by: Sergey V Maslov --- .../extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc diff --git a/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc b/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc old mode 100755 new mode 100644 From 8a25c4664409b0b3dcbd2e8f8a083b8fdc1d7bdc Mon Sep 17 00:00:00 2001 From: Sergey V Maslov Date: Mon, 28 Nov 2022 14:42:40 -0800 Subject: [PATCH 09/14] change use_priority to priority_low and priority_high Signed-off-by: Sergey V Maslov --- .../sycl_ext_oneapi_queue_priority.asciidoc | 25 +++++++++------- .../include/sycl/detail/properties_traits.def | 3 +- sycl/include/sycl/detail/property_helper.hpp | 7 +++-- .../sycl/properties/queue_properties.hpp | 24 ++++++--------- sycl/source/detail/queue_impl.hpp | 18 ++++++----- sycl/test/abi/sycl_symbols_linux.dump | 30 ++++++++++++------- 6 files changed, 59 insertions(+), 48 deletions(-) mode change 100644 => 100755 sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc mode change 100644 => 100755 sycl/include/sycl/detail/properties_traits.def mode change 100644 => 100755 sycl/include/sycl/detail/property_helper.hpp mode change 100644 => 100755 sycl/include/sycl/properties/queue_properties.hpp mode change 100644 => 100755 sycl/source/detail/queue_impl.hpp diff --git a/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc b/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc old mode 100644 new mode 100755 index 8793393c7f91c..40e589208b983 --- a/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc +++ b/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc @@ -74,24 +74,27 @@ the implementation supports. === API of the extension -This extension adds support for a new property for SYCL queue constructors +This extension adds support for new properties for SYCL queue constructors taking properties list: ```c++ namespace sycl::ext::oneapi::property::queue { - class use_priority { + class priority_low { public: - using priority_type = enum { - normal = 0, // default - low = 1, - high = 2 - }; - use_priority(priority_type); + priority_low() = default; + }; + class priority_high { + public: + priority_high() = default; }; } // namespace ``` -The new property hints the SYCL runtime that the queue gets the specified -priority for execution if supported by underlying target runtimes. This -property is a hint and may safely be ignored by an implementation. +The new properties hint the SYCL runtime that the queue gets the specified +priority for execution if supported by underlying target runtimes. These +properties are hints and may safely be ignored by an implementation. + +It is illegal to specify both `priority_low` ans `priority_high` hints +for the same queue, and would result in `invalid` exception thrown by +SYCL runtime. diff --git a/sycl/include/sycl/detail/properties_traits.def b/sycl/include/sycl/detail/properties_traits.def old mode 100644 new mode 100755 index dcb033d61e0cf..91a878a511597 --- a/sycl/include/sycl/detail/properties_traits.def +++ b/sycl/include/sycl/detail/properties_traits.def @@ -14,4 +14,5 @@ __SYCL_PARAM_TRAITS_SPEC( sycl::ext::oneapi::cuda::property::context::use_primary_context) __SYCL_PARAM_TRAITS_SPEC(sycl::property::queue::in_order) __SYCL_PARAM_TRAITS_SPEC(sycl::property::reduction::initialize_to_identity) -__SYCL_PARAM_TRAITS_SPEC(sycl::ext::oneapi::property::queue::use_priority) \ No newline at end of file +__SYCL_PARAM_TRAITS_SPEC(sycl::ext::oneapi::property::queue::priority_low) +__SYCL_PARAM_TRAITS_SPEC(sycl::ext::oneapi::property::queue::priority_high) \ No newline at end of file diff --git a/sycl/include/sycl/detail/property_helper.hpp b/sycl/include/sycl/detail/property_helper.hpp old mode 100644 new mode 100755 index 7906ee640d007..080dddd926771 --- a/sycl/include/sycl/detail/property_helper.hpp +++ b/sycl/include/sycl/detail/property_helper.hpp @@ -40,8 +40,10 @@ enum DataLessPropKind { FusionNoBarrier = 13, FusionEnable = 14, FusionForce = 15, + QueuePriorityLow = 16, + QueuePriorityHigh = 17, // Indicates the last known dataless property. - LastKnownDataLessPropKind = 15, + LastKnownDataLessPropKind = 17, // Exceeding 32 may cause ABI breaking change on some of OSes. DataLessPropKindSize = 32 }; @@ -54,8 +56,7 @@ enum PropWithDataKind { ImageContextBound = 3, BufferMemChannel = 4, AccPropBufferLocation = 5, - QueuePriority = 6, - PropWithDataKindSize = 7, + PropWithDataKindSize = 6, }; // Base class for dataless properties, needed to check that the type of an diff --git a/sycl/include/sycl/properties/queue_properties.hpp b/sycl/include/sycl/properties/queue_properties.hpp old mode 100644 new mode 100755 index f532dabdfc1ee..144dc5c65edd4 --- a/sycl/include/sycl/properties/queue_properties.hpp +++ b/sycl/include/sycl/properties/queue_properties.hpp @@ -29,20 +29,11 @@ namespace queue { class discard_events : public ::sycl::detail::DataLessProperty<::sycl::detail::DiscardEvents> {}; -class use_priority : public sycl::detail::PropertyWithData< - sycl::detail::PropWithDataKind::QueuePriority> { -public: - using priority_type = enum { - normal = 0, // default - low = 1, - high = 2 - }; - use_priority(priority_type Priority) : MPriority(Priority) {} - priority_type get_priority() const { return MPriority; } - -private: - priority_type MPriority; -}; +class priority_low : public sycl::detail::DataLessProperty< + sycl::detail::QueuePriorityLow> {}; +class priority_high : public sycl::detail::DataLessProperty< + sycl::detail::QueuePriorityHigh> {}; + } // namespace queue } // namespace property @@ -82,7 +73,10 @@ template <> struct is_property_of : std::true_type {}; template <> -struct is_property_of +struct is_property_of + : std::true_type {}; +template <> +struct is_property_of : std::true_type {}; template <> struct is_property_of diff --git a/sycl/source/detail/queue_impl.hpp b/sycl/source/detail/queue_impl.hpp old mode 100644 new mode 100755 index e743ff09287f8..525d49d77c14c --- a/sycl/source/detail/queue_impl.hpp +++ b/sycl/source/detail/queue_impl.hpp @@ -312,14 +312,16 @@ class queue_impl { // queue property. CreationFlags |= PI_EXT_ONEAPI_QUEUE_DISCARD_EVENTS; } - if (MPropList.has_property()) { - auto Priority = - MPropList.get_property() - .get_priority(); - if (Priority == ext::oneapi::property::queue::use_priority::high) - CreationFlags |= PI_EXT_ONEAPI_QUEUE_PRIORITY_HIGH; - else if (Priority == ext::oneapi::property::queue::use_priority::low) - CreationFlags |= PI_EXT_ONEAPI_QUEUE_PRIORITY_LOW; + if (MPropList.has_property()) { + CreationFlags |= PI_EXT_ONEAPI_QUEUE_PRIORITY_LOW; + } + if (MPropList.has_property()) { + if (MPropList.has_property()) { + throw sycl::exception(make_error_code(errc::invalid), + "Queue cannot be constructed with both of " + "priority_low and priority_high."); + } + CreationFlags |= PI_EXT_ONEAPI_QUEUE_PRIORITY_HIGH; } RT::PiQueue Queue{}; RT::PiContext Context = MContext->getHandleRef(); diff --git a/sycl/test/abi/sycl_symbols_linux.dump b/sycl/test/abi/sycl_symbols_linux.dump index ccef090d47e08..db467a9dc119d 100644 --- a/sycl/test/abi/sycl_symbols_linux.dump +++ b/sycl/test/abi/sycl_symbols_linux.dump @@ -4057,7 +4057,8 @@ _ZNK4sycl3_V16detail11buffer_impl15getNativeVectorENS0_7backendE _ZNK4sycl3_V16detail11buffer_impl16addInteropObjectERSt6vectorImSaImEE _ZNK4sycl3_V16detail11image_plain11getRowPitchEv _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEET_v -_ZNK4sycl3_V16detail11image_plain12get_propertyINS0_3ext6oneapi8property5queue12use_priorityEEET_v +_ZNK4sycl3_V16detail11image_plain12get_propertyINS0_3ext6oneapi8property5queue12priority_lowEEET_v +_ZNK4sycl3_V16detail11image_plain12get_propertyINS0_3ext6oneapi8property5queue13priority_highEEET_v _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEET_v _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_8property5image12use_host_ptrEEET_v _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_8property5image13context_boundEEET_v @@ -4071,7 +4072,8 @@ _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_8property7context4cuda19use_ _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_8property7no_initEEET_v _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_8property9reduction22initialize_to_identityEEET_v _ZNK4sycl3_V16detail11image_plain12has_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEEbv -_ZNK4sycl3_V16detail11image_plain12has_propertyINS0_3ext6oneapi8property5queue12use_priorityEEEbv +_ZNK4sycl3_V16detail11image_plain12has_propertyINS0_3ext6oneapi8property5queue12priority_lowEEEbv +_ZNK4sycl3_V16detail11image_plain12has_propertyINS0_3ext6oneapi8property5queue13priority_highEEEbv _ZNK4sycl3_V16detail11image_plain12has_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEEbv _ZNK4sycl3_V16detail11image_plain12has_propertyINS0_8property5image12use_host_ptrEEEbv _ZNK4sycl3_V16detail11image_plain12has_propertyINS0_8property5image13context_boundEEEbv @@ -4096,7 +4098,8 @@ _ZNK4sycl3_V16detail11image_plain9get_rangeEv _ZNK4sycl3_V16detail11stream_impl22get_max_statement_sizeEv _ZNK4sycl3_V16detail11stream_impl8get_sizeEv _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEET_v -_ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_3ext6oneapi8property5queue12use_priorityEEET_v +_ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_3ext6oneapi8property5queue12priority_lowEEET_v +_ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_3ext6oneapi8property5queue13priority_highEEET_v _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEET_v _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_8property5image12use_host_ptrEEET_v _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_8property5image13context_boundEEET_v @@ -4110,7 +4113,8 @@ _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_8property7context4cuda19use _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_8property7no_initEEET_v _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_8property9reduction22initialize_to_identityEEET_v _ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEEbv -_ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_3ext6oneapi8property5queue12use_priorityEEEbv +_ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_3ext6oneapi8property5queue12priority_lowEEEbv +_ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_3ext6oneapi8property5queue13priority_highEEEbv _ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEEbv _ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_8property5image12use_host_ptrEEEbv _ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_8property5image13context_boundEEEbv @@ -4317,7 +4321,8 @@ _ZNK4sycl3_V16kernel8get_infoINS0_4info6kernel7contextEEENS0_6detail19is_kernel_ _ZNK4sycl3_V16kernel8get_infoINS0_4info6kernel8num_argsEEENS0_6detail19is_kernel_info_descIT_E11return_typeEv _ZNK4sycl3_V16kernel9getNativeEv _ZNK4sycl3_V16stream12get_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEET_v -_ZNK4sycl3_V16stream12get_propertyINS0_3ext6oneapi8property5queue12use_priorityEEET_v +_ZNK4sycl3_V16stream12get_propertyINS0_3ext6oneapi8property5queue12priority_lowEEET_v +_ZNK4sycl3_V16stream12get_propertyINS0_3ext6oneapi8property5queue13priority_highEEET_v _ZNK4sycl3_V16stream12get_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEET_v _ZNK4sycl3_V16stream12get_propertyINS0_8property5image12use_host_ptrEEET_v _ZNK4sycl3_V16stream12get_propertyINS0_8property5image13context_boundEEET_v @@ -4331,7 +4336,8 @@ _ZNK4sycl3_V16stream12get_propertyINS0_8property7context4cuda19use_primary_conte _ZNK4sycl3_V16stream12get_propertyINS0_8property7no_initEEET_v _ZNK4sycl3_V16stream12get_propertyINS0_8property9reduction22initialize_to_identityEEET_v _ZNK4sycl3_V16stream12has_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEEbv -_ZNK4sycl3_V16stream12has_propertyINS0_3ext6oneapi8property5queue12use_priorityEEEbv +_ZNK4sycl3_V16stream12has_propertyINS0_3ext6oneapi8property5queue12priority_lowEEEbv +_ZNK4sycl3_V16stream12has_propertyINS0_3ext6oneapi8property5queue13priority_highEEEbv _ZNK4sycl3_V16stream12has_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEEbv _ZNK4sycl3_V16stream12has_propertyINS0_8property5image12use_host_ptrEEEbv _ZNK4sycl3_V16stream12has_propertyINS0_8property5image13context_boundEEEbv @@ -4352,7 +4358,8 @@ _ZNK4sycl3_V17context11get_backendEv _ZNK4sycl3_V17context11get_devicesEv _ZNK4sycl3_V17context12get_platformEv _ZNK4sycl3_V17context12get_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEET_v -_ZNK4sycl3_V17context12get_propertyINS0_3ext6oneapi8property5queue12use_priorityEEET_v +_ZNK4sycl3_V17context12get_propertyINS0_3ext6oneapi8property5queue12priority_lowEEET_v +_ZNK4sycl3_V17context12get_propertyINS0_3ext6oneapi8property5queue13priority_highEEET_v _ZNK4sycl3_V17context12get_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEET_v _ZNK4sycl3_V17context12get_propertyINS0_8property5image12use_host_ptrEEET_v _ZNK4sycl3_V17context12get_propertyINS0_8property5image13context_boundEEET_v @@ -4366,7 +4373,8 @@ _ZNK4sycl3_V17context12get_propertyINS0_8property7context4cuda19use_primary_cont _ZNK4sycl3_V17context12get_propertyINS0_8property7no_initEEET_v _ZNK4sycl3_V17context12get_propertyINS0_8property9reduction22initialize_to_identityEEET_v _ZNK4sycl3_V17context12has_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEEbv -_ZNK4sycl3_V17context12has_propertyINS0_3ext6oneapi8property5queue12use_priorityEEEbv +_ZNK4sycl3_V17context12has_propertyINS0_3ext6oneapi8property5queue12priority_lowEEEbv +_ZNK4sycl3_V17context12has_propertyINS0_3ext6oneapi8property5queue13priority_highEEEbv _ZNK4sycl3_V17context12has_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEEbv _ZNK4sycl3_V17context12has_propertyINS0_8property5image12use_host_ptrEEEbv _ZNK4sycl3_V17context12has_propertyINS0_8property5image13context_boundEEEbv @@ -4390,7 +4398,8 @@ _ZNK4sycl3_V17context9getNativeEv _ZNK4sycl3_V17handler27isStateExplicitKernelBundleEv _ZNK4sycl3_V17handler30getOrInsertHandlerKernelBundleEb _ZNK4sycl3_V17sampler12get_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEET_v -_ZNK4sycl3_V17sampler12get_propertyINS0_3ext6oneapi8property5queue12use_priorityEEET_v +_ZNK4sycl3_V17sampler12get_propertyINS0_3ext6oneapi8property5queue12priority_lowEEET_v +_ZNK4sycl3_V17sampler12get_propertyINS0_3ext6oneapi8property5queue13priority_highEEET_v _ZNK4sycl3_V17sampler12get_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEET_v _ZNK4sycl3_V17sampler12get_propertyINS0_8property5image12use_host_ptrEEET_v _ZNK4sycl3_V17sampler12get_propertyINS0_8property5image13context_boundEEET_v @@ -4404,7 +4413,8 @@ _ZNK4sycl3_V17sampler12get_propertyINS0_8property7context4cuda19use_primary_cont _ZNK4sycl3_V17sampler12get_propertyINS0_8property7no_initEEET_v _ZNK4sycl3_V17sampler12get_propertyINS0_8property9reduction22initialize_to_identityEEET_v _ZNK4sycl3_V17sampler12has_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEEbv -_ZNK4sycl3_V17sampler12has_propertyINS0_3ext6oneapi8property5queue12use_priorityEEEbv +_ZNK4sycl3_V17sampler12has_propertyINS0_3ext6oneapi8property5queue12priority_lowEEEbv +_ZNK4sycl3_V17sampler12has_propertyINS0_3ext6oneapi8property5queue13priority_highEEEbv _ZNK4sycl3_V17sampler12has_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEEbv _ZNK4sycl3_V17sampler12has_propertyINS0_8property5image12use_host_ptrEEEbv _ZNK4sycl3_V17sampler12has_propertyINS0_8property5image13context_boundEEEbv From 9750e53ca3b87074b0fb52ae57231fc5b64b0a25 Mon Sep 17 00:00:00 2001 From: Sergey V Maslov Date: Mon, 28 Nov 2022 14:47:37 -0800 Subject: [PATCH 10/14] chmod Signed-off-by: Sergey V Maslov --- .../extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc | 0 sycl/include/sycl/detail/properties_traits.def | 0 sycl/include/sycl/detail/property_helper.hpp | 0 sycl/include/sycl/properties/queue_properties.hpp | 0 sycl/source/detail/queue_impl.hpp | 0 5 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc mode change 100755 => 100644 sycl/include/sycl/detail/properties_traits.def mode change 100755 => 100644 sycl/include/sycl/detail/property_helper.hpp mode change 100755 => 100644 sycl/include/sycl/properties/queue_properties.hpp mode change 100755 => 100644 sycl/source/detail/queue_impl.hpp diff --git a/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc b/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc old mode 100755 new mode 100644 diff --git a/sycl/include/sycl/detail/properties_traits.def b/sycl/include/sycl/detail/properties_traits.def old mode 100755 new mode 100644 diff --git a/sycl/include/sycl/detail/property_helper.hpp b/sycl/include/sycl/detail/property_helper.hpp old mode 100755 new mode 100644 diff --git a/sycl/include/sycl/properties/queue_properties.hpp b/sycl/include/sycl/properties/queue_properties.hpp old mode 100755 new mode 100644 diff --git a/sycl/source/detail/queue_impl.hpp b/sycl/source/detail/queue_impl.hpp old mode 100755 new mode 100644 From a42dd407ac6f24d1a2d537adc667a0c5de83bf8a Mon Sep 17 00:00:00 2001 From: Sergey V Maslov Date: Mon, 28 Nov 2022 14:51:54 -0800 Subject: [PATCH 11/14] clang-format Signed-off-by: Sergey V Maslov --- sycl/include/sycl/properties/queue_properties.hpp | 10 +++++----- sycl/source/detail/queue_impl.hpp | 7 ++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/sycl/include/sycl/properties/queue_properties.hpp b/sycl/include/sycl/properties/queue_properties.hpp index 144dc5c65edd4..a990627f740d2 100644 --- a/sycl/include/sycl/properties/queue_properties.hpp +++ b/sycl/include/sycl/properties/queue_properties.hpp @@ -29,11 +29,11 @@ namespace queue { class discard_events : public ::sycl::detail::DataLessProperty<::sycl::detail::DiscardEvents> {}; -class priority_low : public sycl::detail::DataLessProperty< - sycl::detail::QueuePriorityLow> {}; -class priority_high : public sycl::detail::DataLessProperty< - sycl::detail::QueuePriorityHigh> {}; - +class priority_low + : public sycl::detail::DataLessProperty {}; +class priority_high + : public sycl::detail::DataLessProperty {}; + } // namespace queue } // namespace property diff --git a/sycl/source/detail/queue_impl.hpp b/sycl/source/detail/queue_impl.hpp index 525d49d77c14c..1ac31ad0d5e1a 100644 --- a/sycl/source/detail/queue_impl.hpp +++ b/sycl/source/detail/queue_impl.hpp @@ -316,10 +316,11 @@ class queue_impl { CreationFlags |= PI_EXT_ONEAPI_QUEUE_PRIORITY_LOW; } if (MPropList.has_property()) { - if (MPropList.has_property()) { + if (MPropList + .has_property()) { throw sycl::exception(make_error_code(errc::invalid), - "Queue cannot be constructed with both of " - "priority_low and priority_high."); + "Queue cannot be constructed with both of " + "priority_low and priority_high."); } CreationFlags |= PI_EXT_ONEAPI_QUEUE_PRIORITY_HIGH; } From ae196c6de3facf990945cdd643cecd6eaf1d198b Mon Sep 17 00:00:00 2001 From: Sergey V Maslov Date: Mon, 28 Nov 2022 15:28:48 -0800 Subject: [PATCH 12/14] add priority_normal Signed-off-by: Sergey V Maslov --- .../sycl_ext_oneapi_queue_priority.asciidoc | 9 +++++--- .../include/sycl/detail/properties_traits.def | 3 ++- sycl/include/sycl/detail/property_helper.hpp | 7 +++--- .../sycl/properties/queue_properties.hpp | 6 +++++ sycl/source/detail/queue_impl.hpp | 23 +++++++++++++++---- 5 files changed, 36 insertions(+), 12 deletions(-) diff --git a/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc b/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc index 40e589208b983..0b40702a84fbd 100644 --- a/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc +++ b/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc @@ -80,6 +80,10 @@ taking properties list: ```c++ namespace sycl::ext::oneapi::property::queue { + class priority_normal { + public: + priority_normal() = default; + }; class priority_low { public: priority_low() = default; @@ -95,6 +99,5 @@ The new properties hint the SYCL runtime that the queue gets the specified priority for execution if supported by underlying target runtimes. These properties are hints and may safely be ignored by an implementation. -It is illegal to specify both `priority_low` ans `priority_high` hints -for the same queue, and would result in `invalid` exception thrown by -SYCL runtime. +It is illegal to specify multiple differrent priority hints for the same queue, +and would result in `invalid` exception thrown by SYCL runtime. diff --git a/sycl/include/sycl/detail/properties_traits.def b/sycl/include/sycl/detail/properties_traits.def index 91a878a511597..61101b9985d04 100644 --- a/sycl/include/sycl/detail/properties_traits.def +++ b/sycl/include/sycl/detail/properties_traits.def @@ -15,4 +15,5 @@ __SYCL_PARAM_TRAITS_SPEC( __SYCL_PARAM_TRAITS_SPEC(sycl::property::queue::in_order) __SYCL_PARAM_TRAITS_SPEC(sycl::property::reduction::initialize_to_identity) __SYCL_PARAM_TRAITS_SPEC(sycl::ext::oneapi::property::queue::priority_low) -__SYCL_PARAM_TRAITS_SPEC(sycl::ext::oneapi::property::queue::priority_high) \ No newline at end of file +__SYCL_PARAM_TRAITS_SPEC(sycl::ext::oneapi::property::queue::priority_high) +__SYCL_PARAM_TRAITS_SPEC(sycl::ext::oneapi::property::queue::priority_normal) \ No newline at end of file diff --git a/sycl/include/sycl/detail/property_helper.hpp b/sycl/include/sycl/detail/property_helper.hpp index 080dddd926771..a7897d182d8f6 100644 --- a/sycl/include/sycl/detail/property_helper.hpp +++ b/sycl/include/sycl/detail/property_helper.hpp @@ -40,10 +40,11 @@ enum DataLessPropKind { FusionNoBarrier = 13, FusionEnable = 14, FusionForce = 15, - QueuePriorityLow = 16, - QueuePriorityHigh = 17, + QueuePriorityNormal = 16, + QueuePriorityLow = 17, + QueuePriorityHigh = 18, // Indicates the last known dataless property. - LastKnownDataLessPropKind = 17, + LastKnownDataLessPropKind = 18, // Exceeding 32 may cause ABI breaking change on some of OSes. DataLessPropKindSize = 32 }; diff --git a/sycl/include/sycl/properties/queue_properties.hpp b/sycl/include/sycl/properties/queue_properties.hpp index a990627f740d2..d44bc85bda85c 100644 --- a/sycl/include/sycl/properties/queue_properties.hpp +++ b/sycl/include/sycl/properties/queue_properties.hpp @@ -29,6 +29,9 @@ namespace queue { class discard_events : public ::sycl::detail::DataLessProperty<::sycl::detail::DiscardEvents> {}; +class priority_normal + : public sycl::detail::DataLessProperty { +}; class priority_low : public sycl::detail::DataLessProperty {}; class priority_high @@ -73,6 +76,9 @@ template <> struct is_property_of : std::true_type {}; template <> +struct is_property_of + : std::true_type {}; +template <> struct is_property_of : std::true_type {}; template <> diff --git a/sycl/source/detail/queue_impl.hpp b/sycl/source/detail/queue_impl.hpp index 1ac31ad0d5e1a..828e1880490a8 100644 --- a/sycl/source/detail/queue_impl.hpp +++ b/sycl/source/detail/queue_impl.hpp @@ -312,17 +312,30 @@ class queue_impl { // queue property. CreationFlags |= PI_EXT_ONEAPI_QUEUE_DISCARD_EVENTS; } + // Track that priority settings are not ambiguous. + bool PrioritySeen = false; + if (MPropList + .has_property()) { + // Normal is the default priority, don't pass anything. + PrioritySeen = true; + } if (MPropList.has_property()) { + if (PrioritySeen) { + throw sycl::exception( + make_error_code(errc::invalid), + "Queue cannot be constructed with different priorities."); + } CreationFlags |= PI_EXT_ONEAPI_QUEUE_PRIORITY_LOW; + PrioritySeen = true; } if (MPropList.has_property()) { - if (MPropList - .has_property()) { - throw sycl::exception(make_error_code(errc::invalid), - "Queue cannot be constructed with both of " - "priority_low and priority_high."); + if (PrioritySeen) { + throw sycl::exception( + make_error_code(errc::invalid), + "Queue cannot be constructed with different priorities."); } CreationFlags |= PI_EXT_ONEAPI_QUEUE_PRIORITY_HIGH; + PrioritySeen = true; } RT::PiQueue Queue{}; RT::PiContext Context = MContext->getHandleRef(); From b1e320c2e523779364a706a0344fb6b44a4a892a Mon Sep 17 00:00:00 2001 From: Sergey V Maslov Date: Mon, 28 Nov 2022 15:45:24 -0800 Subject: [PATCH 13/14] add abi symbols Signed-off-by: Sergey V Maslov --- sycl/test/abi/sycl_symbols_linux.dump | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sycl/test/abi/sycl_symbols_linux.dump b/sycl/test/abi/sycl_symbols_linux.dump index db467a9dc119d..d8304a7f85068 100644 --- a/sycl/test/abi/sycl_symbols_linux.dump +++ b/sycl/test/abi/sycl_symbols_linux.dump @@ -4059,6 +4059,7 @@ _ZNK4sycl3_V16detail11image_plain11getRowPitchEv _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEET_v _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_3ext6oneapi8property5queue12priority_lowEEET_v _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_3ext6oneapi8property5queue13priority_highEEET_v +_ZNK4sycl3_V16detail11image_plain12get_propertyINS0_3ext6oneapi8property5queue15priority_normalEEET_v _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEET_v _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_8property5image12use_host_ptrEEET_v _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_8property5image13context_boundEEET_v @@ -4074,6 +4075,7 @@ _ZNK4sycl3_V16detail11image_plain12get_propertyINS0_8property9reduction22initial _ZNK4sycl3_V16detail11image_plain12has_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEEbv _ZNK4sycl3_V16detail11image_plain12has_propertyINS0_3ext6oneapi8property5queue12priority_lowEEEbv _ZNK4sycl3_V16detail11image_plain12has_propertyINS0_3ext6oneapi8property5queue13priority_highEEEbv +_ZNK4sycl3_V16detail11image_plain12has_propertyINS0_3ext6oneapi8property5queue15priority_normalEEEbv _ZNK4sycl3_V16detail11image_plain12has_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEEbv _ZNK4sycl3_V16detail11image_plain12has_propertyINS0_8property5image12use_host_ptrEEEbv _ZNK4sycl3_V16detail11image_plain12has_propertyINS0_8property5image13context_boundEEEbv @@ -4100,6 +4102,7 @@ _ZNK4sycl3_V16detail11stream_impl8get_sizeEv _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEET_v _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_3ext6oneapi8property5queue12priority_lowEEET_v _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_3ext6oneapi8property5queue13priority_highEEET_v +_ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_3ext6oneapi8property5queue15priority_normalEEET_v _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEET_v _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_8property5image12use_host_ptrEEET_v _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_8property5image13context_boundEEET_v @@ -4115,6 +4118,7 @@ _ZNK4sycl3_V16detail12buffer_plain12get_propertyINS0_8property9reduction22initia _ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEEbv _ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_3ext6oneapi8property5queue12priority_lowEEEbv _ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_3ext6oneapi8property5queue13priority_highEEEbv +_ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_3ext6oneapi8property5queue15priority_normalEEEbv _ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEEbv _ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_8property5image12use_host_ptrEEEbv _ZNK4sycl3_V16detail12buffer_plain12has_propertyINS0_8property5image13context_boundEEEbv @@ -4323,6 +4327,7 @@ _ZNK4sycl3_V16kernel9getNativeEv _ZNK4sycl3_V16stream12get_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEET_v _ZNK4sycl3_V16stream12get_propertyINS0_3ext6oneapi8property5queue12priority_lowEEET_v _ZNK4sycl3_V16stream12get_propertyINS0_3ext6oneapi8property5queue13priority_highEEET_v +_ZNK4sycl3_V16stream12get_propertyINS0_3ext6oneapi8property5queue15priority_normalEEET_v _ZNK4sycl3_V16stream12get_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEET_v _ZNK4sycl3_V16stream12get_propertyINS0_8property5image12use_host_ptrEEET_v _ZNK4sycl3_V16stream12get_propertyINS0_8property5image13context_boundEEET_v @@ -4338,6 +4343,7 @@ _ZNK4sycl3_V16stream12get_propertyINS0_8property9reduction22initialize_to_identi _ZNK4sycl3_V16stream12has_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEEbv _ZNK4sycl3_V16stream12has_propertyINS0_3ext6oneapi8property5queue12priority_lowEEEbv _ZNK4sycl3_V16stream12has_propertyINS0_3ext6oneapi8property5queue13priority_highEEEbv +_ZNK4sycl3_V16stream12has_propertyINS0_3ext6oneapi8property5queue15priority_normalEEEbv _ZNK4sycl3_V16stream12has_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEEbv _ZNK4sycl3_V16stream12has_propertyINS0_8property5image12use_host_ptrEEEbv _ZNK4sycl3_V16stream12has_propertyINS0_8property5image13context_boundEEEbv @@ -4360,6 +4366,7 @@ _ZNK4sycl3_V17context12get_platformEv _ZNK4sycl3_V17context12get_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEET_v _ZNK4sycl3_V17context12get_propertyINS0_3ext6oneapi8property5queue12priority_lowEEET_v _ZNK4sycl3_V17context12get_propertyINS0_3ext6oneapi8property5queue13priority_highEEET_v +_ZNK4sycl3_V17context12get_propertyINS0_3ext6oneapi8property5queue15priority_normalEEET_v _ZNK4sycl3_V17context12get_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEET_v _ZNK4sycl3_V17context12get_propertyINS0_8property5image12use_host_ptrEEET_v _ZNK4sycl3_V17context12get_propertyINS0_8property5image13context_boundEEET_v @@ -4375,6 +4382,7 @@ _ZNK4sycl3_V17context12get_propertyINS0_8property9reduction22initialize_to_ident _ZNK4sycl3_V17context12has_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEEbv _ZNK4sycl3_V17context12has_propertyINS0_3ext6oneapi8property5queue12priority_lowEEEbv _ZNK4sycl3_V17context12has_propertyINS0_3ext6oneapi8property5queue13priority_highEEEbv +_ZNK4sycl3_V17context12has_propertyINS0_3ext6oneapi8property5queue15priority_normalEEEbv _ZNK4sycl3_V17context12has_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEEbv _ZNK4sycl3_V17context12has_propertyINS0_8property5image12use_host_ptrEEEbv _ZNK4sycl3_V17context12has_propertyINS0_8property5image13context_boundEEEbv @@ -4400,6 +4408,7 @@ _ZNK4sycl3_V17handler30getOrInsertHandlerKernelBundleEb _ZNK4sycl3_V17sampler12get_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEET_v _ZNK4sycl3_V17sampler12get_propertyINS0_3ext6oneapi8property5queue12priority_lowEEET_v _ZNK4sycl3_V17sampler12get_propertyINS0_3ext6oneapi8property5queue13priority_highEEET_v +_ZNK4sycl3_V17sampler12get_propertyINS0_3ext6oneapi8property5queue15priority_normalEEET_v _ZNK4sycl3_V17sampler12get_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEET_v _ZNK4sycl3_V17sampler12get_propertyINS0_8property5image12use_host_ptrEEET_v _ZNK4sycl3_V17sampler12get_propertyINS0_8property5image13context_boundEEET_v @@ -4415,6 +4424,7 @@ _ZNK4sycl3_V17sampler12get_propertyINS0_8property9reduction22initialize_to_ident _ZNK4sycl3_V17sampler12has_propertyINS0_3ext6oneapi4cuda8property7context19use_primary_contextEEEbv _ZNK4sycl3_V17sampler12has_propertyINS0_3ext6oneapi8property5queue12priority_lowEEEbv _ZNK4sycl3_V17sampler12has_propertyINS0_3ext6oneapi8property5queue13priority_highEEEbv +_ZNK4sycl3_V17sampler12has_propertyINS0_3ext6oneapi8property5queue15priority_normalEEEbv _ZNK4sycl3_V17sampler12has_propertyINS0_3ext6oneapi8property6buffer22use_pinned_host_memoryEEEbv _ZNK4sycl3_V17sampler12has_propertyINS0_8property5image12use_host_ptrEEEbv _ZNK4sycl3_V17sampler12has_propertyINS0_8property5image13context_boundEEEbv From 721526b56facb2c5b240bebe6343782f5cde1ac9 Mon Sep 17 00:00:00 2001 From: Sergey V Maslov Date: Tue, 29 Nov 2022 08:36:27 -0800 Subject: [PATCH 14/14] [NFC] update doc with suggestions Signed-off-by: Sergey V Maslov --- .../sycl_ext_oneapi_queue_priority.asciidoc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc b/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc index 0b40702a84fbd..34d6319844061 100644 --- a/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc +++ b/sycl/doc/extensions/supported/sycl_ext_oneapi_queue_priority.asciidoc @@ -35,20 +35,23 @@ https://github.com/intel/llvm/issues == Dependencies -This extension is written against the SYCL 2020 revision 4 specification. All +This extension is written against the SYCL 2020 revision 6 specification. All references below to the "core SYCL specification" or to section numbers in the SYCL specification refer to that revision. == Status This extension is implemented and fully supported by {dpcpp}. +[NOTE] +==== Although {dpcpp} supports this extension on all backends, it is currently used -only on Level Zero. Other backends ignore this new property. +only on Level Zero. Other backends ignore the properties defined in this specification. +==== == Overview -Introduce SYCL queue property specifying desired priority of the queue. -This priority is a hint and may be ignored if not supported by +Introduce SYCL queue properties specifying the desired priority of a queue. +These priorities are a hint and may be ignored if not supported by underlying backends. == Specification @@ -99,5 +102,6 @@ The new properties hint the SYCL runtime that the queue gets the specified priority for execution if supported by underlying target runtimes. These properties are hints and may safely be ignored by an implementation. -It is illegal to specify multiple differrent priority hints for the same queue, -and would result in `invalid` exception thrown by SYCL runtime. +It is illegal to specify multiple differrent priority hints for the same queue. +Doing so causes the `queue` constructor to throw a synchronous `exception` with +the `errc::invalid` error code. \ No newline at end of file