diff --git a/llvm/test/CMakeLists.txt b/llvm/test/CMakeLists.txt index a40db5061a1d..ec38d76ce27f 100644 --- a/llvm/test/CMakeLists.txt +++ b/llvm/test/CMakeLists.txt @@ -50,6 +50,7 @@ set(LLVM_TEST_DEPENDS UnitTests bugpoint count + file-table-tform llc lli lli-child-target diff --git a/llvm/tools/file-table-tform/LLVMBuild.txt b/llvm/tools/file-table-tform/LLVMBuild.txt index 72f4156cc47a..7b434b74ad3e 100644 --- a/llvm/tools/file-table-tform/LLVMBuild.txt +++ b/llvm/tools/file-table-tform/LLVMBuild.txt @@ -18,4 +18,4 @@ type = Tool name = file-table-tform parent = Tools -required_libraries = +required_libraries = Support diff --git a/sycl/doc/extensions/DeviceSpecificKernelQueries/SYCL_INTEL_device_specific_kernel_queries.asciidoc b/sycl/doc/extensions/DeviceSpecificKernelQueries/SYCL_INTEL_device_specific_kernel_queries.asciidoc new file mode 100644 index 000000000000..54a361c8e2dc --- /dev/null +++ b/sycl/doc/extensions/DeviceSpecificKernelQueries/SYCL_INTEL_device_specific_kernel_queries.asciidoc @@ -0,0 +1,160 @@ += SYCL_INTEL_device_specific_kernel_queries + +: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 + +:blank: pass:[ +] + +// 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} + +// This is necessary for asciidoc, but not for asciidoctor +:cpp: C++ + +== Introduction +IMPORTANT: This specification is a draft. + +NOTE: 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. + +NOTE: This document is better viewed when rendered as html with asciidoctor. +GitHub does not render image icons. + +This document describes an extension to rename device-specific kernel queries +to better describe the operations performed. + +== Name Strings + ++SYCL_INTEL_device_specific_kernel_queries+ + +== Notice + +Copyright (c) 2020 Intel Corporation. All rights reserved. + +== Status + +Working Draft + +This is a preview extension specification, intended to provide early access to +a feature for review and community feedback. When the feature matures, this +specification may be released as a formal extension. + +Because the interfaces defined by this specification are not final and are +subject to change they are not intended to be used by shipping software +products. + +== Version + +Built On: {docdate} + +Revision: 1 + +== Contact +Felipe de Azevedo Piovezan, Intel (felipe 'dot' de 'dot' azevedo 'dot' piovezan 'at' intel 'dot' com) + +== Dependencies + +This extension is written against the SYCL 1.2.1 specification, Revision 6. + +== Overview + +OpenCL provides two functions for querying properties of a kernel: +`clGetKernelInfo` is used for kernel properties that are device agnostic, +whereas `clGetKernelWorkGroupInfo` is used for kernel and work-group properties +that depend on a specific device. The name `clGetKernelWorkGroupInfo` doesn't +convey the API's intended use explicitly, that is, queries for +*device-specific* properties. In this sense, `clGetKernelWorkGroupInfo` is a +misnomer for some uses of the API. + +SYCL inherited these names in the form of the queries `kernel::get_info` and +`kernel::get_work_group_info`. This extension renames the latter (and its +template arguments as appropriate) in order to align the query name with its +functionality. + +== Modifications of SYCL 1.2.1 Specification + +=== Change Section 4.8.7 Kernel class + +==== Change `kernel` class interface + +Remove lines 29-31 (inclusive) from the `kernel` class interface: + +[source,c++,`sycl::kernel`,linenums] +---- +template +typename info::param_traits::return_type +get_work_group_info(const device &dev) const; +---- + +Add function overload `get_info` to the `kernel` class interface: + +[source,c++,`sycl::kernel`,linenums] +---- +template +typename info::param_traits::return_type +get_info(const device &dev) const; +---- + +==== Change table 4.83 Member functions of the Kernel class + +Remove row `get_work_group_info(const device &dev)`: + +[width="40%",frame="topbot",options="header,footer"] +|====================== +|Member functions |Description +|`template typename info::param_traits::return_type get_work_group_info(const device &dev)const` | +Query information from the work-group from a kernel using the info::kernel_work_group descriptor for a specific device +|====================== + +Add row `get_info(const device &dev)`: + +[width="40%",frame="topbot",options="header,footer"] +|====================== +|Member functions |Description +|`template typename info::param_traits::return_type get_info(const device &dev)const` | +Query information from a kernel using the info::kernel_device_specific descriptor for a specific device. +|====================== + +==== Change table 4.85 Kernel work-group information descriptors + +Rename table to: +Kernel device-specific information descriptors+. + +Replace all references to `info::kernel_work_group` with +`info::kernel_device_specific`. + +==== Change A.5 Kernel Information Descriptors + +Rename `enum class kernel_work_group: int` to `enum class +kernel_device_specific: int`. + +== Issues + +None. + +== Revision History + +[cols="5,15,15,70"] +[grid="rows"] +[options="header"] +|======================================== +|Rev|Date|Author|Changes +|1|2020-04-15|Felipe de Azevedo Piovezan|*Initial public working draft* +|======================================== + +//************************************************************************ +//Other formatting suggestions: +// +//* Use *bold* text for host APIs, or [source] syntax highlighting. +//* Use +mono+ text for device APIs, or [source] syntax highlighting. +//* Use +mono+ text for extension names, types, or enum values. +//* Use _italics_ for parameters. +//************************************************************************ diff --git a/sycl/include/CL/sycl/detail/clusm.hpp b/sycl/include/CL/sycl/detail/clusm.hpp deleted file mode 100644 index 263b87185276..000000000000 --- a/sycl/include/CL/sycl/detail/clusm.hpp +++ /dev/null @@ -1,100 +0,0 @@ -//==---------------- clusm.hpp - SYCL USM for CL Utils ---------*- C++ -*---==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// ===--------------------------------------------------------------------=== // - -#pragma once - -#include -#include -#include -#include - -#include -#include -#include - -__SYCL_INLINE_NAMESPACE(cl) { -namespace sycl { -namespace detail { -namespace usm { - -class CLUSM { -public: - CLUSM() = default; - ~CLUSM() = default; - - void *hostMemAlloc(cl_context context, cl_mem_properties_intel *properties, - size_t size, cl_uint alignment, cl_int *errcode_ret); - void *deviceMemAlloc(cl_context context, cl_device_id device, - cl_mem_properties_intel *properties, size_t size, - cl_uint alignment, cl_int *errcode_ret); - void *sharedMemAlloc(cl_context context, cl_device_id device, - cl_mem_properties_intel *properties, size_t size, - cl_uint alignment, cl_int *errcode_ret); - - cl_int memFree(cl_context context, const void *ptr); - - cl_int getMemAllocInfoINTEL(cl_context context, const void *ptr, - cl_mem_info_intel param_name, - size_t param_value_size, void *param_value, - size_t *param_value_size_ret); - - cl_int setKernelExecInfo(cl_kernel kernel, cl_kernel_exec_info param_name, - size_t param_value_size, const void *param_value); - - cl_int setKernelIndirectUSMExecInfo(cl_command_queue queue, cl_kernel kernel); - - template - cl_int writeParamToMemory(size_t param_value_size, T param, - size_t *param_value_size_ret, T *pointer) const; - -private: - std::mutex mLock; - - struct SUSMAllocInfo { - SUSMAllocInfo() = default; - - cl_unified_shared_memory_type_intel Type = CL_MEM_TYPE_UNKNOWN_INTEL; - const void *BaseAddress = nullptr; - size_t Size = 0; - size_t Alignment = 0; - }; - - using CUSMAllocMap = std::map; - using CUSMAllocVector = std::vector; - - struct SUSMContextInfo { - CUSMAllocMap AllocMap; - - CUSMAllocVector HostAllocVector; - // TODO: Support multiple devices by mapping device-> vector? - CUSMAllocVector DeviceAllocVector; - CUSMAllocVector SharedAllocVector; - }; - - // TODO: Support multiple contexts by mapping context -> USMContextInfo? - SUSMContextInfo mUSMContextInfo; - - struct SUSMKernelInfo { - SUSMKernelInfo() = default; - - bool IndirectHostAccess = false; - bool IndirectDeviceAccess = false; - bool IndirectSharedAccess = false; - - std::vector SVMPtrs; - }; - - typedef std::map CUSMKernelInfoMap; - - CUSMKernelInfoMap mUSMKernelInfoMap; -}; - -} // namespace usm -} // namespace detail -} // namespace sycl -} // __SYCL_INLINE_NAMESPACE(cl) diff --git a/sycl/include/CL/sycl/detail/pi.hpp b/sycl/include/CL/sycl/detail/pi.hpp index 7be744c635f5..de77c7671f2b 100644 --- a/sycl/include/CL/sycl/detail/pi.hpp +++ b/sycl/include/CL/sycl/detail/pi.hpp @@ -99,9 +99,9 @@ using PiMemObjectType = ::pi_mem_type; using PiMemImageChannelOrder = ::pi_image_channel_order; using PiMemImageChannelType = ::pi_image_channel_type; -void contextSetExtendedDeleter(const cl::sycl::context &constext, - pi_context_extended_deleter func, - void *user_data); +__SYCL_EXPORT void contextSetExtendedDeleter(const cl::sycl::context &constext, + pi_context_extended_deleter func, + void *user_data); // Function to load the shared library // Implementation is OS dependent. diff --git a/sycl/source/detail/context_impl.cpp b/sycl/source/detail/context_impl.cpp index 669d047aae73..8353396e7792 100644 --- a/sycl/source/detail/context_impl.cpp +++ b/sycl/source/detail/context_impl.cpp @@ -6,7 +6,6 @@ // // ===--------------------------------------------------------------------=== // -#include #include #include #include diff --git a/sycl/source/detail/queue_impl.cpp b/sycl/source/detail/queue_impl.cpp index 0758519720ff..ccaab363c64b 100644 --- a/sycl/source/detail/queue_impl.cpp +++ b/sycl/source/detail/queue_impl.cpp @@ -7,7 +7,6 @@ //===----------------------------------------------------------------------===// #include -#include #include #include #include diff --git a/sycl/source/detail/scheduler/commands.cpp b/sycl/source/detail/scheduler/commands.cpp index 0ba4d01462b7..5664ca1ad25e 100644 --- a/sycl/source/detail/scheduler/commands.cpp +++ b/sycl/source/detail/scheduler/commands.cpp @@ -10,7 +10,6 @@ #include "CL/sycl/access/access.hpp" #include -#include #include #include #include