diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt
index cdc84bc122b57..243868f2bc4cf 100644
--- a/sycl/CMakeLists.txt
+++ b/sycl/CMakeLists.txt
@@ -31,6 +31,7 @@ endif()
# materialization possible.
option(SYCL_ENABLE_EXTENSION_JIT "Enable extension to JIT kernels" ON)
+# TODO-UPSTREAM temp workaround to fix cuda adapter build
if (NOT XPTI_INCLUDES)
set(XPTI_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/../xpti/include)
endif()
@@ -122,10 +123,6 @@ if(SYCL_ENABLE_WERROR)
endif()
endif()
-# Create a soft option for enabling or disabling the instrumentation
-# of the SYCL runtime and expect enabling
-option(SYCL_ENABLE_XPTI_TRACING "Enable tracing of SYCL constructs" OFF)
-
# Get clang's version
include(VersionFromVCS)
set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
@@ -354,14 +351,6 @@ if (NOT WIN32)
COMPONENT sycl-headers-extras)
endif()
-if (SYCL_ENABLE_XPTI_TRACING)
- if (MSVC)
- set(XPTIFW_LIBS xpti xptid xptifw xptifwd)
- else()
- set(XPTIFW_LIBS xpti xptifw)
- endif()
-endif()
-
# SYCL toolchain builds all components: compiler, libraries, headers, etc.
add_custom_target(sycl-compiler
DEPENDS append-file
@@ -392,7 +381,6 @@ add_custom_target( sycl-toolchain ALL
DEPENDS sycl-runtime-libraries
sycl-compiler
sycl-ls
- ${XPTIFW_LIBS}
COMMENT "Building SYCL compiler toolchain..."
)
@@ -470,7 +458,6 @@ set( SYCL_TOOLCHAIN_DEPLOY_COMPONENTS
libsycldevice
unified-memory-framework
unified-runtime-loader
- ${XPTIFW_LIBS}
${SYCL_TOOLCHAIN_DEPS}
)
@@ -478,16 +465,6 @@ if (WIN32)
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS ur_win_proxy_loader)
endif()
-if (TARGET sycl-prof)
- list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS sycl-prof)
-endif()
-if (TARGET sycl-sanitize)
- list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS sycl-sanitize)
-endif()
-if (TARGET sycl-trace)
- list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS sycl-trace)
-endif()
-
if(OpenCL_INSTALL_KHRONOS_ICD_LOADER AND TARGET OpenCL-ICD)
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS OpenCL-ICD)
endif()
diff --git a/sycl/doc/EnvironmentVariables.md b/sycl/doc/EnvironmentVariables.md
index df624323bf453..7893e07c3145f 100644
--- a/sycl/doc/EnvironmentVariables.md
+++ b/sycl/doc/EnvironmentVariables.md
@@ -180,12 +180,8 @@ For a description of parallel for range rounding in DPC++ see
| Environment variable | Values | Description |
| -------------------- | ------ | ----------- |
| `INTEL_ENABLE_OFFLOAD_ANNOTATIONS` | Any(\*) | Enables ITT Annotations support for SYCL runtime. This variable should only be used by tools, that support ITT Annotations. |
-| `XPTI_FRAMEWORK_DISPATCHER`(\*\*) | Path to dispatcher library | Loads XPTI instrumentation dispatcher framework library. See [XPTI Framework documentation][xpti] for more info |
-| `XPTI_TRACE_ENABLE`(\*\*) | `1`, `true`, `0`, `false` | Enables XPTI instrumentation. See [XPTI Framework documentation][xpti] for more info |
-| `XPTI_SUBSCRIBERS`(\*\*) | Comma separated list of subscriber libraries | Loads XPTI subscribers. See [XPTI Framework documentation][xpti] for more info |
`(*) Note: Any means this environment variable is effective when set to any non-null value.`
-`(**) Note: These variables come from XPTI framework`
## Debugging variables for DPC++ Runtime
@@ -298,5 +294,4 @@ variables in production code.
`(*) Note: Any means this environment variable is effective when set to any non-null value.`
-[xpti]: https://github.com/intel/llvm/blob/sycl/xptifw/doc/XPTI_Framework.md
[range-rounding]: https://github.com/intel/llvm/blob/sycl/sycl/doc/design/ParallelForRangeRounding.md
diff --git a/sycl/doc/design/SYCLInstrumentationUsingXPTI.md b/sycl/doc/design/SYCLInstrumentationUsingXPTI.md
deleted file mode 100644
index a019ba515fc4d..0000000000000
--- a/sycl/doc/design/SYCLInstrumentationUsingXPTI.md
+++ /dev/null
@@ -1,353 +0,0 @@
-# SYCL Instrumentation
-
-Any language or programming paradigm must provide mechanisms to correlate a
-developer's use of the language to the debug and performance traces for that
-use. A lightweight tracing framework (XPTI) was developed to enable this for
-SYCL and is the primary mechanism that is employed to enable debug and
-performance traces.
-
-> **NOTE:** For additional information on the XPTI framework, please refer to
->the [Framework Documentation](https://github.com/intel/llvm/tree/sycl/xptifw/doc/XPTI_Framework.md) for API use
->and framework performance data.
-
-This document outlines the use of this framework API in the SYCL runtime
-library. The primary concept enable by this framework is the generation of a
-unique 64-bit ID, referred to as the Universal ID (UID), for every public
-language entry point into the library. This allows tools and other helps in the
-software stack to correlate debug and performance data by tagging it with the
-64-bit UID. The framework also provides the ability to propagate this UID all
-the way to the driver layers for the target device so data from lower layers and
-hardware can be correlated easily.
-
-The XPTI concepts in use here are:
-
-1. Tracepoints - define all the points in a software layer we want to
-instrument or trace. The trace point is used to generate the UID.
-2. Notification - allows the software layer to communicate the trace
-information to listeners/subscribers
-3. Callback - implemented by subscribers to specific events to capture the
-trace information
-
-The SYCL runtime layer defines the tracepoints and notifies the information
-about any given tracepoint to a registered subscriber. These tracepoints are
-enabled in meaningful locations of the runtime to provide semantic information
-about the developer's use of the language. This would include information such
-as relationships that form asynchronous task graphs or other constructs such
-as barriers that are introduced while waiting on events.
-
-## Instrumentation Trace Points
-
-This section will document all the places in the SYCL runtime that have been
-instrumented to capture the asynchronous task graphs created by the runtime.
-The task graphs are captured as graph, nodes and edges:
-
-> - The graph encapsulates all of the disjoint task graphs generated by the application.
-> - The nodes capture operations that are performed, such as kernel
-executions or memory transfers
-> - The edges represent dependence relationships, the representation of
-which mimics control flow as opposed to a dependence graph. The source node
-in an edge must complete before the target node can begin execution.
-
- All code changes to enable this have been guarded by
- `XPTI_ENABLE_INSTRUMENTATION` macro and the CMake files have been updated to
- have this as an option which is enabled by default and this change is under
- `llvm/sycl/CMakeLists.txt`.
-
-```cmake
-...
-# Create a soft option for enabling or disabling the instrumentation
-# of the SYCL runtime
-option(SYCL_ENABLE_XPTI_TRACING "Enable tracing of SYCL constructs" ON)
-```
-
-### The Graph
-
-Any SYCL application can submit command groups to any active queue
-during the lifetime of the application. Each submission is handled by the
-runtime and the asynchronous task graphs are updated to reflect the new
-submission. This may be as simple as adding a new node to the task-graph or
-adding multiple nodes to the graph, where one of the nodes represents the
-computation and the others dependent memory transfers.
-
-To model this, we create a global graph for every application instantiation
-and all kernel executions in the applications are added as nodes in this
-global graph. In the SYCL runtime, there is no obvious location where the
-creation of the global graph can be inserted as many objects are
-instantiated statically. Currently, graph creation happens alongside UR
-initialization in `initializePlugins` ([here](https://github.com/intel/llvm/blob/2137ff0e2ae0b478d341c12466bed0ac4402f516/sycl/source/detail/ur.cpp#L96)).
-In this call, we will perform two operations:
-
-1. Initialize all listeners and create a trace event to represent the graph.
-2. Send a `graph_create` event to all subscribers. This notification
-will only be sent once.
-
-### The Nodes
-
-The command group lambdas are captured and encapsulated in a `Command`
-object. This object is evaluated for dependencies on data/memory or external
-OpenCL events and an asynchronous task graph is built by mapping all these
-dependencies, before it is enqueued on the device. In order to capture the
-command groups (nodes) and the dependencies (edges), the base class
-`Command` and any derived classes that are of interest are instrumented.
-
-In this section, we discuss the instrumentation of the Command object in two
-parts: (1) The changes made to capture end-user source code details for
-language constructs (2) The instrumentation that handles capturing the
-relevant metadata.
-
-1. In order to capture end-user source code information, we have implemented
-`sycl::detail::code_location` class that uses the builtin functions
-in the compiler. However, equivalent implementations are unavailable on
-Windows and separate cross-platform implementation might be used in the
-future. To mitigate this, the Windows implementation will always report
-`unknown_file`, `unknown_func` and a line number of 0 for source
-file, function name and line number. We handle this case while processing
-this information.
-
- The source information of a language construct, such as source file,
- function name, line number and column number allow us to determine if a
- Command that was previously created for a construct is being created
- again. In such cases, we will not emit a `node_create` event, but we
- will bump up the instance count recording the number of instances
- created. Secondly, the source information allows us to associate a unique
- ID with the source location and propagate it all the way to the driver,
- if possible. This will allow us to associate a Kernel event with a source
- location at all times. All instrumentation that identifies a command
- object of a given type and emits the `node_create` event is located
- in the `emitInstrumentationData()` and must be implemented by all
- derived classes.
-
- To enable this source location information, we start with enabling the
- public methods in the queue class, such as `queue.submit()`,
- `queue.parallel_for()`, `queue.wait()`, etc to include a default
- argument that captures the source location information. The location of
- the line in the caller that makes the call to `queue.submit()`,
- `queue.parallel_for()`, etc is represented in this default argument.
- These changes are present in `queue.hpp` and `ordered_queue.hpp`.
- The default arguments for all public functions are guarded by
- `#ifdef SYCL_INSTRUMENTATION_METADATA` that is currently enabled by
- default.
-
- The location information, when captured, is propagated all the way to the
- `CommandGroup` object. So, for every `CommandGroup` object, we
- will have the corresponding source location in end-user code where the
- command group is submitted to the queue. This metadata is propagated by
- the instrumentation to the subscribers of the stream.
-
-2. The base `Command class` and all derived classes are instrumented to capture
- the relevant information for each command object and a `node_create` event is
- generated.
-
-### The Node instance
-
-Once a command object is created, it is enqueued on the device for
-execution. To capture the execution of this node instance, we instrument the
-`enqueue()` method to determine the cost of this computation or memory
-related kernel. As the commands are enqueued, the enqueue method emits a
-pair of events indicating the `task_begin` and `task_end`events that
-capture the duration of the enqueued command. For commands that are
-asynchronous, the pair of events capture just the kernel submission and the
-actual execution of the command on the device is tracked through the
-`cl_event` returned by the enqueue operation. In the case of host kernel
-execution or commands that are synchronous, the cost is measured directly.
-
-In the case of the command being submitted to an OpenCL device, we capture
-the event of the submitted kernel and propagate it to the subscriber tool.
-It is up to the tool to register a callback for this event completion and
-close the task opened for the command object.
-
-### The Edges
-
-As discussed in the previous section, the command groups submitted to the
-device queues form nodes in the asynchronous tasks graphs created by
-the SYCL runtime. In addition to these nodes, based on the memory references
-(through accessors or USM pointers), additional nodes to `allocate`,
-`copy` and `release` are created and they are necessary for the
-computation kernels to run. The computation kernel has dependencies on the
-memory objects and these dependencies are recorded as `event`s and in
-our model we represent them as edges between the dependent nodes.
-
-Tools monitoring the event stream then can start capturing the asynchronous
-task graph as it is being built. As dependencies are added to a command
-object, the instrumentation emits these dependencies as `edge_create`
-events. Each of these `edge_create`events encapsulate the two command
-objects that have a dependency through this edge. The source object of this
-edge event must complete execution first before the target object of the
-edge can begin execution.
-
-To instrument this part of the code, the `Command::addDep` methods of
-the Command object are instrumented to create the trace points and notify
-all subscribers.
-
-The `Release` command, as implemented in the SYCL runtime, has a
-reference to the memory object, but no explicit dependencies are created. To
-model the edges correctly, we instrument the `waitForRecordToFinish` method in
-the `Scheduler` where the release operation waits on all the
-dependent operations to complete to capture the edges.
-
-This concludes all the changes that were made to the SYCL runtime to support
-tracing. The next section talks about the XPTI framework that allows
-applications and runtimes to efficiently capture, record and emit trace
-notifications for important events during the run.
-
-## Documentation of SYCL tracepoints
-### XPTI Stream Domain
-
-Traces belong to a named stream and this constitutes a domain of data. The XPTI
-framework allows the instrumentation logic to define a stream and associate the
-traces to the stream. A stream also defines the protocol to be observed to
-decipher the data at the receiving end. The XPTI API defines the notion of a
-trace point that includes an event, a trace point type and a notification.
-
-- The **event** consists a payload that describes the event (`source file`,
- `function name`, `line number` and/or a `code pointer`), a `unique_id` that
- is used to identify the event, a `global user data field` and a mechanism to
- record `metadata` associated with the event. The `unique_id` is generated
- from the payload, so if the trace point is visited multiple times, it
- represents the same `unique_id` and this allows us to determine the number of
- instances of a trace point.
-
-- The **trace point type** defines the type of notification that is being
- emitted for the trace point. There are many commonly occurring trace point
- types that are predefined by the framework, but a stream can extend this
- set by the extension APIs provided. A subscriber must explicitly register a
- callback for each trace point type that is of interest to the subscriber. If
- no subscribers are registered for a stream or a trace point type, then
- traces will not be emitted. A given trace point event may be used to emit
- multiple traces to different trace point types.
-
-- The **notification** emits the trace to all subscribers of the stream domain
- that have a callback registered to the given trace point type. The stream
- can attached a per-instance user data during this notification call that
- *must* be guaranteed to be valid for the duration of the notification call.
-
-This document will outline the protocol for the streams of data being generated
-by the SYCL runtime.
-
-## SYCL Stream `"ur.call"` Notification Signatures
-
-| Trace Point Type | Parameter Description | Metadata |
-| :--------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- |
-| `function_begin` |
**trace_type**: `xpti::trace_point_type_t::function_begin` that marks the beginning of a function **parent**: Event ID created for all functions in the `ur.call` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: Unique ID to allow the correlation of the `function_begin` event with the `function_end` event. **user_data**: Name of the function being called sent in as `const char *` | None |
-| `function_end` | **trace_type**: `xpti::trace_point_type_t::function_end` that marks the beginning of a function **parent**: Event ID created for all functions in the `ur.call` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: Unique ID to allow the correlation of the `function_begin` event with the `function_end` event. This value is guaranteed to be the same value received by the trace event for the corresponding `function_begin` **user_data**: Name of the function being called sent in as `const char *` | None |
-
-## SYCL Stream `"ur.call.debug"` Notification Signatures
-
-| Trace Point Type | Parameter Description | Metadata |
-| :------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- |
-| `function_with_args_begin` | **trace_type**: `xpti::trace_point_type_t::function_with_args_begin` that marks the beginning of a function **parent**: Event ID created for all functions in the `ur.call.debug` layer. **event**: `nullptr` if code location is not available or event ID with code location data. **instance**: Unique ID to allow the correlation of the `function_with_args_begin` event with the `function_with_args_end` event. **user_data**: A pointer to `function_with_args_t` object, that includes function ID, name, and arguments. | None |
-| `function_with_args_end` | **trace_type**: `xpti::trace_point_type_t::function_with_args_end` that marks the beginning of a function **parent**: Event ID created for all functions in the `ur.call.debug` layer. **event**: `nullptr` if code location is not available or event ID with code location data. **instance**: Unique ID to allow the correlation of the `function_with_args_begin` event with the `function_with_args_end` event. This value is guaranteed to be the same value received by the trace event for the corresponding `function_with_args_begin` **user_data**: A pointer to `function_with_args_t` object, that includes function ID, name, arguments, and return value. | None |
-
-## SYCL Stream `"sycl"` Notification Signatures
-
-All trace point types in bold provide semantic information about the graph, nodes and edges and the topology of the asynchronous task graphs created by the runtime.
-| Trace Point Type | Parameter Description | Metadata |
-| :----------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| **`graph_create`** | **trace_type**: `xpti::trace_point_type_t::graph_create` that marks the creation of an asynchronous graph. **parent**: `nullptr` **event**: The global asynchronous graph object ID. All other graph related events such as node and edge creation will always this ID as the parent ID. **instance**: Unique ID related to the event, but not a correlation ID as there are other events to correlate to. **user_data**: `nullptr` SYCL runtime will always have one instance of a graph object with many disjoint subgraphs that get created during the execution of an application.
| None |
-| **`node_create`** | **trace_type**: `xpti::trace_point_type_t::node_create` that marks the creation of a node in the graph, which could be a computational kernel or memory operation. **parent**: The global graph event that is created during the `graph_create` event. **event**: The unique ID that identifies the data parallel compute operation or memory operation. **instance**: Unique ID related to the event, but not a correlation ID as there are other events to correlate to. **user_data**: Command type that has been submitted through the command group handler, which could be one of: `command_group_node`, `memory_transfer_node`, `memory_allocation_node`, `sub_buffer_creation_node`, `memory_deallocation_node`, `host_acc_create_buffer_lock_node`, `host_acc_destroy_buffer_release_node` combined with the address of the command group object and represented as a string [`const char *`] SYCL runtime will always have one instance of a graph object with many disjoint subgraphs that get created during the execution of an application.
| Computational Kernels `sycl_device`, `sycl_device_type`, `sycl_device_name`, `kernel_name`, `from_source`, `sym_function_name`, `sym_source_file_name`, `sym_line_no`. The per-queue unique ID can be obtained by using `xptiGetStashedTuple` API call. See `queue_create` documentation for usage information. Memory operations `memory_object`, `offset`, `access_range`, `allocation_type`, `copy_from`, `copy_to`,`device_id`, `device_name`, `memory_size`, `src_memory_ptr`, `dest_memory_ptr`, `memory_ptr`, `value_set`. The per-queue unique ID can be obtained by using `xptiGetSTashedTuple` API call. See `queue_create` documentation for usage information. |
-| **`edge_create`** | **trace_type**: `xpti::trace_point_type_t::graph_create` that marks the creation of an asynchronous graph. **parent**: The global graph event that is created during the `graph_create` event. **event**: The unique ID that identifies the dependence relationship between two operations. **instance**: Unique ID related to the event, but not a correlation ID as there are other events to correlate to. **user_data**: `nullptr` Edges capture dependence relationships between computations or computations and memory operations.
| `access_mode`, `memory_object`, `event` |
-| `task_begin` | **trace_type**: `xpti::trace_point_type_t::task_begin` that marks the beginning of a task belonging to one of the nodes in the graph. When the trace event is for a kernel executing on a device other than the the CPU, this `task_begin` and corresponding `task_end` mark the submit call. To track the execution of the kernel on the device, the `trace_signal` event must be monitored to get the kernel event handle from which the execution statistics can be gathered. **parent**: The global graph event that is created during the `graph_create` event. **event**: The event ID will reflect the ID of the computation or memory operation kernel, which would be one of the nodes in the graph. **instance**: Instance ID for the task that can be used to correlate it with the corresponding `task_end` trace event. **user_data**: `nullptr` | Same metadata defined for the node the trace task belongs to. |
-| `task_end` | **trace_type**: `xpti::trace_point_type_t::task_end` that marks the end of a task belonging to one of the nodes in the graph. The specific task instance can be tacked through the instance ID parameter which helps correlate the `task_end` with the corresponding `task_begin`. **parent**: The global graph event that is created during the `graph_create` event. **event**: The event ID will reflect the ID of the computation or memory operation kernel, which would be one of the nodes in the graph. **instance**: Instance ID for the task that can be used to correlate it with the corresponding `task_begin` trace event. **user_data**: `nullptr` | Same metadata defined for the node the trace task belongs to. |
-| `signal` | **trace_type**: `xpti::trace_point_type_t::signal` that marks the an event that contains the `event` handle of an executing kernel on a device. **parent**: The global graph event that is created during the `graph_create` event. **event**: The event ID will reflect the ID of the computation or memory operation kernel, which would be one of the nodes in the graph. **instance**: Instance ID for the task for which the signal has been generated. **user_data**: Address of the kernel event that is returned by the device so the progress of the execution can be tracked. | Same metadata defined for the node the trace task belongs to. |
-| `wait_begin` | **trace_type**: `xpti::trace_point_type_t::wait_begin` that marks the beginning of the wait on an `event` **parent**: `nullptr` **event**: The event ID will reflect the ID of the command group object submission that created this event, the queue or a new event based on the combination of the string "queue.wait" and the address of the event. **instance**: Unique ID to allow the correlation of the `wait_begin` event with the `wait_end` event. **user_data**: String indicating `queue.wait` and the address of the event sent in as `const char *` Tracing the `queue.wait()` or `queue.wait_and_throw()` will capture the waiting on the action represented by the event object, which could be the execution of a kernel, completion of a memory operation, etc that is embedded in the command group handler. All wait events contain metadata that indicates the SYCL device on which the corresponding operation has been submitted. If the event is from a command group handler, then the source location information is available as well.
| `sycl_device`, `sycl_device_type`, `sycl_device_name`, `sym_function_name`, `sym_source_file_name`, `sym_line_no`, `sym_column_no` |
-| `wait_end` | **trace_type**: `xpti::trace_point_type_t::wait_end` that marks the beginning of the wait on an `event` **parent**: `nullptr` **event**: The event ID will reflect the ID of the command group object submission that created this event, the queue or a new event based on the combination of the string "queue.wait" and the address of the event. **instance**: Unique ID to allow the correlation of the `wait_begin` event with the `wait_end` event. **user_data**: String indicating `queue.wait` and the address of the event as `const char *` | `sycl_device`, `sycl_device_type`, `sycl_device_name`, `sym_function_name`, `sym_source_file_name`, `sym_line_no`, `sym_column_no` |
-| `barrier_begin` | **trace_type**: `xpti::trace_point_type_t::barrier_begin` that marks the beginning of a barrier while enqueuing a command group object **parent**: The global graph event that is created during the `graph_create` event. **event**: The event ID will reflect the ID of the command group object that has encountered a barrier during the enqueue operation. **instance**: Unique ID to allow the correlation of the `barrier_begin` event with the `barrier_end` event. **user_data**: String indicating `enqueue.barrier` and the reason for the barrier as a `const char *` The reason for the barrier could be one of `Buffer locked by host accessor`, `Blocked by host task` or `Unknown reason`.
| Computational Kernels `sycl_device`, `sycl_device_type`, `sycl_device_name`, `kernel_name`, `from_source`, `sym_function_name`, `sym_source_file_name`, `sym_line_no`, `sym_column_no` Memory operations `memory_object`, `offset`, `access_range_start`, `access_range_end`, `allocation_type`, `copy_from`, `copy_to` |
-| `barrier_end` | **trace_type**: `xpti::trace_point_type_t::barrier_end` that marks the end of the barrier that is encountered during enqueue. **parent**: The global graph event that is created during the `graph_create` event. **event**: The event ID will reflect the ID of the command group object that has encountered a barrier during the enqueue operation. **instance**: Unique ID to allow the correlation of the `barrier_begin` event with the `barrier_end` event. **user_data**: String indicating `enqueue.barrier` and the reason for the barrier as a `const char *` The reason for the barrier could be one of `Buffer locked by host accessor`, `Blocked by host task` or `Unknown reason`.
| Computational Kernels `sycl_device`, `sycl_device_type`, `sycl_device_name`, `kernel_name`, `from_source`, `sym_function_name`, `sym_source_file_name`, `sym_line_no`, `sym_column_no` Memory operations `memory_object`, `offset`, `access_range_start`, `access_range_end`, `allocation_type`, `copy_from`, `copy_to` |
-| `diagnostics` | **trace_type**: `xpti::trace_point_type_t::diagnostics` that represents general purpose notifications. For example, it is emitted when an exception is thrown in SYCL runtime. **parent**: Set to NULL. **event**: The event ID will reflect the code location of notification origin, if available. **instance**: An instance ID that records the number of times this code location has been seen. **user_data**: String with diagnostic message as a `const char *` | `sym_function_name`, `sym_source_file_name`, `sym_line_no`, `sym_column_no` |
-| `queue_create` | **trace_type**: `xpti::trace_point_type_t::queue_create` that marks the creation of a queue, which could be a device or host queue. **parent**: Set to NULL. **event**: The event ID will reflect the code location of notification origin, if available. **instance**: Will contain the instance ID of the queue, which is a per-queue unique identifier. For example, if the queue is created in a loop, the **event** will be the same as it happens at the same code location, but the **instance** will help differentiate between the different queues being created and used. **user_data**: Not meaningful for this trace type. Could contain string with 'queue_create' or nullptr. This signal is emitted only once for every queue object, notifies about successful queue creation (the signal is not emitted if any exception happens during queue creation).
| `sycl_context`, `sycl_device_name`, `sycl_device`, `is_inorder`, `queue_handle` `queue_id` field has been deprecated and replaced with the **instance** information and supporting XPTI API calls (`xptiGetStashedTuple`). Using the **instance** information is the recommended approach. `char *key = 0;` `uint64_t value;``if (xptiGetStashedTuple(&key, value) ==xpti::result_t::XPTI_RESULT_SUCCESS) {` `// key will contain "queue_id"` `// value will contain the per-queue unique ID``}` `queue_handle` is absent for host queue since no backend object is used.
|
-| `queue_destroy` | **trace_type**: `xpti::trace_point_type_t::queue_destroy` that marks the destruction of a queue, which could be a device or host queue. **parent**: Set to NULL. **event**: The event ID will reflect the code location of notification origin, if available. **instance**: Will contain the instance ID of the queue, which is a per-queue unique identifier. **user_data**: Not meaningful for this trace type. Could contain string with 'queue_destroy' or nullptr. This signal is emitted only once for every queue object, notifies about queue destruction. Contains the same metadata set for corresponding 'queue_create' signal. **event** and corresponding metadata will be destroyed right after notification.
| `sycl_context`, `sycl_device_name`, `sycl_device`, `is_inorder`, `queue_id`, `queue_handle` `queue_id` field has been deprecated and replaced with the **instance** information and supporting XPTI API calls (`xptiGetStashedTuple`). Using the **instance** information is the recommended approach. `queue_handle` is absent for host queue since no backend object is used. |
-
-### Metadata description
-
-| Metadata | Type | Description |
-| :--------------------: | :-------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `access_mode` | `int` | Value of `sycl::access::mode` enum |
-| `access_range_start` | `size_t` | Start of accessor range |
-| `access_range_end` | `size_t` | End of accessor range |
-| `allocation_type` | C-style string | Allocation type |
-| `copy_from` | `size_t` | ID of source device |
-| `copy_to` | `size_t` | ID of target device |
-| `event` | `size_t` | Unique identifier of event |
-| `from_source` | `bool` | `true` if kernel comes from user source |
-| `kernel_name` | C-style string | Kernel name |
-| `memory_object` | `size_t` | Unique identifier of memory object |
-| `offset` | `size_t` | Accessor offset size in bytes |
-| `sycl_device` | `size_t` | Unique identifier of SYCL device |
-| `sycl_device_type` | C-style string | `CPU`, `GPU`, `ACC`, or `HOST` |
-| `sycl_device_name` | C-style string | Result of `sycl::device::get_info()` |
-| `sym_function_name` | C-style string | Function name |
-| `sym_source_file_name` | C-style string | Source file name |
-| `sym_line_no` | `int32_t` | File line number |
-| `sym_column_no` | `int32_t` | File column number |
-| `enqueue_kernel_data` | `xpti::offload_kernel_arg_data_t` | Includes kernel execution parameters (global size, local size, offset) and number of kernel arguments |
-| `argN` | `xpti::offload_kernel_arg_data_t` | Description for the Nth kernel argument. It includes argument kind (sycl::detail::kernel_param_kind_t), pointer to the value, size and index in the argument list. |
-
-## Buffer management stream `"sycl.experimental.buffer"` Notification Signatures
-
-| Trace Point Type | Parameter Description | Metadata |
-| :-------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- |
-| `offload_alloc_memory_object_construct` | **trace_type**: `xpti::trace_point_type_t::offload_memory_object_data_t` that marks offload buffer creation point **parent**: Event ID created for all functions in the `oneapi.experimental.buffer` layer. **event**: `xpti::trace_event_data_t` - contains information about source location. **instance**: `nullptr` since no begin-end event alignment is needed. **user_data**: A pointer to `offload_memory_object_data_t` object, that includes buffer object ID, host pointer used to create/initialize buffer, buffer element information (type name, size), number of buffer dimensions and buffer size for each dimension. | None |
-| `offload_alloc_memory_object_associate` | **trace_type**: `xpti::trace_point_type_t::offload_association_data_t` that provides association between user level buffer object and platform specific memory object **parent**: Event ID created for all functions in the `oneapi.experimental.buffer` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: `nullptr` since no begin-end event alignment is needed. **user_data**: A pointer to `offload_association_data_t` object, that includes user object ID and platform-specific representation for offload buffer. | None |
-| `offload_alloc_memory_object_destruct` | **trace_type**: `xpti::trace_point_type_t::offload_memory_object_data_t` that marks offload buffer destruction point **parent**: Event ID created for all functions in the `oneapi.experimental.buffer` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: `nullptr` since no begin-end event alignment is needed. **user_data**: A pointer to `offload_memory_object_data_t` object, that includes buffer object ID. | None |
-| `offload_alloc_memory_object_release` | **trace_type**: `xpti::trace_point_type_t::offload_memory_object_release_data_t` that provides information about release of platform specific memory object **parent**: `nullptr` - since the stream of data just captures functions being called. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: `nullptr` since no begin-end event alignment is needed. **user_data**: A pointer to `offload_association_data_t` object, that includes user object ID and platform-specific representation for offload buffer. | None |
-| `offload_alloc_accessor` | **trace_type**: `xpti::trace_point_type_t::offload_accessor_data_t` that marks offload accessor creation point **parent**: Event ID created for all functions in the `oneapi.experimental.buffer` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: `nullptr` since no begin-end event alignment is needed. **user_data**: A pointer to `offload_accessor_data_t` object, that includes buffer object ID, accessor handle created from specific buffer, accessor information (access target and mode). | None |
-
-## Image management stream `"sycl.experimental.image"` Notification Signatures
-
-| Trace Point Type | Parameter Description | Metadata |
-| :-------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- |
-| `offload_alloc_memory_object_construct` | **trace_type**: `xpti::trace_point_type_t::offload_image_data_t` that marks offload image creation point **parent**: Event ID created for all functions in the `oneapi.experimental.image` layer. **event**: `xpti::trace_event_data_t` - contains information about source location. **instance**: `nullptr` since no begin-end event alignment is needed. **user_data**: A pointer to `offload_image_data_t` object, that includes image object ID, host pointer used to create/initialize image, number of image dimensions, the image format and sampler information (addressing mode, coordinate normalization mode, filtering mode). | None |
-| `offload_alloc_memory_object_associate` | **trace_type**: `xpti::trace_point_type_t::offload_association_data_t` that provides association between user level image object and platform specific memory object **parent**: Event ID created for all functions in the `oneapi.experimental.image` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: `nullptr` since no begin-end event alignment is needed. **user_data**: A pointer to `offload_association_data_t` object, that includes user object ID and platform-specific representation for offload image. | None |
-| `offload_alloc_memory_object_destruct` | **trace_type**: `xpti::trace_point_type_t::offload_image_data_t` that marks offload image destruction point **parent**: Event ID created for all functions in the `oneapi.experimental.image` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: `nullptr` since no begin-end event alignment is needed. **user_data**: A pointer to `offload_image_data_t` object, that includes image object ID. | None |
-| `offload_alloc_memory_object_release` | **trace_type**: `xpti::trace_point_type_t::offload_association_data_t` that provides information about release of platform specific memory object **parent**: `nullptr` - since the stream of data just captures functions being called. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: `nullptr` since no begin-end event alignment is needed. **user_data**: A pointer to `offload_association_data_t` object, that includes user object ID and platform-specific representation for offload image. | None |
-| `offload_alloc_accessor` | **trace_type**: `xpti::trace_point_type_t::offload_image_accessor_data_t` that marks offload image accessor creation point **parent**: Event ID created for all functions in the `oneapi.experimental.image` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: `nullptr` since no begin-end event alignment is needed. **user_data**: A pointer to `offload_image_accessor_data_t` object, that includes image object ID, accessor handle created from specific image, access target (if the accessor is not a host accessor), access mode (if the accessor is to an unsampled image) and element information (type name, size). | None |
-
-## SYCL Memory Allocations Stream `"sycl.experimental.mem_alloc"` Notification Signatures
-
-| Trace Point Type | Parameter Description | Metadata |
-| :-----------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- |
-| `mem_alloc_begin` | **trace_type**: `xpti::trace_point_type_t::mem_alloc_begin` that marks the beginning of memory allocation process **parent**: Event ID created for all functions in the `oneapi.level_zero.experimental.mem_alloc` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: Unique ID to allow the correlation of the `mem_alloc_begin` event with the `mem_alloc_end` event. **user_data**: A pointer to `mem_alloc_data_t` object, that includes memory object ID (if any), allocation size, and guard zone size (if any). | None |
-| `mem_alloc_end` | **trace_type**: `xpti::trace_point_type_t::mem_alloc_end` that marks the end of memory allocation process **parent**: Event ID created for all functions in the `oneapi.level_zero.experimental.mem_alloc` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: Unique ID to allow the correlation of the `mem_alloc_begin` event with the `mem_alloc_end` event. This value is guaranteed to be the same value received by the trace event for the corresponding `mem_alloc_begin`. **user_data**: A pointer to `mem_alloc_data_t` object, that includes memory object ID (if any), allocated pointer, allocation size, and guard zone size (if any). | None |
-| `mem_release_begin` | **trace_type**: `xpti::trace_point_type_t::mem_release_begin` that marks the beginning of memory allocation process **parent**: Event ID created for all functions in the `oneapi.level_zero.experimental.mem_alloc` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: Unique ID to allow the correlation of the `mem_release_begin` event with the `mem_release_end` event. **user_data**: A pointer to `mem_alloc_data_t` object, that includes memory object ID (if any) and released pointer. | None |
-| `mem_release_end` | **trace_type**: `xpti::trace_point_type_t::mem_release_end` that marks the end of memory allocation process **parent**: Event ID created for all functions in the `oneapi.level_zero.experimental.mem_alloc` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: Unique ID to allow the correlation of the `mem_release_begin` event with the `mem_release_end` event. This value is guaranteed to be the same value received by the trace event for the corresponding `mem_release_begin`. **user_data**: A pointer to `mem_alloc_data_t` object, that includes memory object ID (if any) and released pointer. | None |
-
-## SYCL Stream `"sycl.experimental.level_zero.call"` Notification Signatures
-
-This stream transfers events about Level Zero API calls made by SYCL
-application.
-
-| Trace Point Type | Parameter Description | Metadata |
-| :--------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- |
-| `function_begin` | **trace_type**: `xpti::trace_point_type_t::function_begin` that marks the beginning of a function **parent**: Event ID created for all functions in the `ur.call` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: Unique ID to allow the correlation of the `function_begin` event with the `function_end` event. **user_data**: Name of the function being called sent in as `const char *` | None |
-| `function_end` | **trace_type**: `xpti::trace_point_type_t::function_end` that marks the beginning of a function **parent**: Event ID created for all functions in the `ur.call` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: Unique ID to allow the correlation of the `function_begin` event with the `function_end` event. This value is guaranteed to be the same value received by the trace event for the corresponding `function_begin` **user_data**: Name of the function being called sent in as `const char *` | None |
-
-## SYCL Stream `"sycl.experimental.level_zero.debug"` Notification Signatures
-
-This stream transfers events about Level Zero API calls and their function
-arguments made by SYCL application.
-
-| Trace Point Type | Parameter Description | Metadata |
-| :------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- |
-| `function_with_args_begin` | **trace_type**: `xpti::trace_point_type_t::function_with_args_begin` that marks the beginning of a function **parent**: Event ID created for all functions in the `ur.call.debug` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: Unique ID to allow the correlation of the `function_with_args_begin` event with the `function_with_args_end` event. **user_data**: A pointer to `function_with_args_t` object, that includes function ID, name, and arguments. | None |
-| `function_with_args_end` | **trace_type**: `xpti::trace_point_type_t::function_with_args_end` that marks the beginning of a function **parent**: Event ID created for all functions in the `ur.call.debug` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: Unique ID to allow the correlation of the `function_with_args_begin` event with the `function_with_args_end` event. This value is guaranteed to be the same value received by the trace event for the corresponding `function_with_args_begin` **user_data**: A pointer to `function_with_args_t` object, that includes function ID, name, arguments, and return value. | None |
-
-## SYCL Stream `"sycl.experimental.cuda.call"` Notification Signatures
-
-This stream transfers events about CUDA Driver API calls made by SYCL
-application.
-
-| Trace Point Type | Parameter Description | Metadata |
-| :--------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- |
-| `function_begin` | **trace_type**: `xpti::trace_point_type_t::function_begin` that marks the beginning of a function **parent**: Event ID created for all functions in the `ur.call` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: Unique ID to allow the correlation of the `function_begin` event with the `function_end` event. **user_data**: Name of the function being called sent in as `const char *` | None |
-| `function_end` | **trace_type**: `xpti::trace_point_type_t::function_end` that marks the beginning of a function **parent**: Event ID created for all functions in the `ur.call` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: Unique ID to allow the correlation of the `function_begin` event with the `function_end` event. This value is guaranteed to be the same value received by the trace event for the corresponding `function_begin` **user_data**: Name of the function being called sent in as `const char *` | None |
-
-## SYCL Stream `"sycl.experimental.cuda.debug"` Notification Signatures
-
-This stream transfers events about CUDA Driver API calls and their function
-arguments made by SYCL application.
-
-| Trace Point Type | Parameter Description | Metadata |
-| :------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- |
-| `function_with_args_begin` | **trace_type**: `xpti::trace_point_type_t::function_with_args_begin` that marks the beginning of a function **parent**: Event ID created for all functions in the `ur.call.debug` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: Unique ID to allow the correlation of the `function_with_args_begin` event with the `function_with_args_end` event. **user_data**: A pointer to `function_with_args_t` object, that includes function ID, name, and arguments. | None |
-| `function_with_args_end` | **trace_type**: `xpti::trace_point_type_t::function_with_args_end` that marks the beginning of a function **parent**: Event ID created for all functions in the `ur.call.debug` layer. **event**: `nullptr` - since the stream of data just captures functions being called. **instance**: Unique ID to allow the correlation of the `function_with_args_begin` event with the `function_with_args_end` event. This value is guaranteed to be the same value received by the trace event for the corresponding `function_with_args_begin` **user_data**: A pointer to `function_with_args_t` object, that includes function ID, name, arguments, and return value. | None |
-
diff --git a/sycl/doc/index.rst b/sycl/doc/index.rst
index cc4961dd7f438..f8aa11a864175 100644
--- a/sycl/doc/index.rst
+++ b/sycl/doc/index.rst
@@ -37,7 +37,6 @@ Design Documents for the oneAPI DPC++ Compiler
design/SharedLibraries
design/OptionalDeviceFeatures
design/ParallelForRangeRounding
- design/SYCLInstrumentationUsingXPTI
design/ITTAnnotations
design/DeviceGlobal
design/CompileTimeProperties
diff --git a/sycl/include/sycl/accessor.hpp b/sycl/include/sycl/accessor.hpp
index e8034f77c5e9a..3d9945520c5a5 100644
--- a/sycl/include/sycl/accessor.hpp
+++ b/sycl/include/sycl/accessor.hpp
@@ -244,11 +244,6 @@ struct AccHostDataT {
void *Reserved = nullptr;
};
-void __SYCL_EXPORT constructorNotification(void *BufferObj, void *AccessorObj,
- access::target Target,
- access::mode Mode,
- const code_location &CodeLoc);
-
template
using IsPropertyListT = typename std::is_base_of;
@@ -956,14 +951,12 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
detail::getSyclObjImpl(BufferRef).get(), AdjustedDim, sizeof(DataT),
IsPlaceH, BufferRef.OffsetInBytes, BufferRef.IsSubBuffer,
PropertyList) {
+ std::ignore = CodeLoc;
throwIfUsedByGraph();
preScreenAccessor(PropertyList);
if (!AccessorBaseHost::isPlaceholder())
addHostAccessorAndWait(AccessorBaseHost::impl.get());
initHostAcc();
- detail::constructorNotification(detail::getSyclObjImpl(BufferRef).get(),
- detail::AccessorBaseHost::impl.get(),
- AccessTarget, AccessMode, CodeLoc);
GDBMethodsAnchor();
#endif
}
@@ -997,14 +990,12 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
detail::getSyclObjImpl(BufferRef).get(), AdjustedDim, sizeof(DataT),
IsPlaceH, BufferRef.OffsetInBytes, BufferRef.IsSubBuffer,
PropertyList) {
+ std::ignore = CodeLoc;
throwIfUsedByGraph();
preScreenAccessor(PropertyList);
if (!AccessorBaseHost::isPlaceholder())
addHostAccessorAndWait(AccessorBaseHost::impl.get());
initHostAcc();
- detail::constructorNotification(detail::getSyclObjImpl(BufferRef).get(),
- detail::AccessorBaseHost::impl.get(),
- AccessTarget, AccessMode, CodeLoc);
GDBMethodsAnchor();
#endif
}
@@ -1034,13 +1025,11 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
getAdjustedMode(PropertyList),
detail::getSyclObjImpl(BufferRef).get(), Dimensions, sizeof(DataT),
BufferRef.OffsetInBytes, BufferRef.IsSubBuffer, PropertyList) {
+ std::ignore = CodeLoc;
throwIfUsedByGraph();
preScreenAccessor(PropertyList);
detail::associateWithHandler(CommandGroupHandler, this, AccessTarget);
initHostAcc();
- detail::constructorNotification(detail::getSyclObjImpl(BufferRef).get(),
- detail::AccessorBaseHost::impl.get(),
- AccessTarget, AccessMode, CodeLoc);
GDBMethodsAnchor();
}
#endif
@@ -1072,13 +1061,11 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
getAdjustedMode(PropertyList),
detail::getSyclObjImpl(BufferRef).get(), Dimensions, sizeof(DataT),
BufferRef.OffsetInBytes, BufferRef.IsSubBuffer, PropertyList) {
+ std::ignore = CodeLoc;
throwIfUsedByGraph();
preScreenAccessor(PropertyList);
detail::associateWithHandler(CommandGroupHandler, this, AccessTarget);
initHostAcc();
- detail::constructorNotification(detail::getSyclObjImpl(BufferRef).get(),
- detail::AccessorBaseHost::impl.get(),
- AccessTarget, AccessMode, CodeLoc);
GDBMethodsAnchor();
}
#endif
@@ -1106,14 +1093,12 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
detail::getSyclObjImpl(BufferRef).get(), Dimensions, sizeof(DataT),
IsPlaceH, BufferRef.OffsetInBytes, BufferRef.IsSubBuffer,
PropertyList) {
+ std::ignore = CodeLoc;
throwIfUsedByGraph();
preScreenAccessor(PropertyList);
if (!AccessorBaseHost::isPlaceholder())
addHostAccessorAndWait(AccessorBaseHost::impl.get());
initHostAcc();
- detail::constructorNotification(detail::getSyclObjImpl(BufferRef).get(),
- detail::AccessorBaseHost::impl.get(),
- AccessTarget, AccessMode, CodeLoc);
GDBMethodsAnchor();
}
#endif
@@ -1143,14 +1128,12 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
detail::getSyclObjImpl(BufferRef).get(), Dimensions, sizeof(DataT),
IsPlaceH, BufferRef.OffsetInBytes, BufferRef.IsSubBuffer,
PropertyList) {
+ std::ignore = CodeLoc;
throwIfUsedByGraph();
preScreenAccessor(PropertyList);
if (!AccessorBaseHost::isPlaceholder())
addHostAccessorAndWait(AccessorBaseHost::impl.get());
initHostAcc();
- detail::constructorNotification(detail::getSyclObjImpl(BufferRef).get(),
- detail::AccessorBaseHost::impl.get(),
- AccessTarget, AccessMode, CodeLoc);
GDBMethodsAnchor();
}
#endif
@@ -1207,13 +1190,11 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
getAdjustedMode(PropertyList),
detail::getSyclObjImpl(BufferRef).get(), Dimensions, sizeof(DataT),
BufferRef.OffsetInBytes, BufferRef.IsSubBuffer, PropertyList) {
+ std::ignore = CodeLoc;
throwIfUsedByGraph();
preScreenAccessor(PropertyList);
detail::associateWithHandler(CommandGroupHandler, this, AccessTarget);
initHostAcc();
- detail::constructorNotification(detail::getSyclObjImpl(BufferRef).get(),
- detail::AccessorBaseHost::impl.get(),
- AccessTarget, AccessMode, CodeLoc);
GDBMethodsAnchor();
}
#endif
@@ -1243,13 +1224,11 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
getAdjustedMode(PropertyList),
detail::getSyclObjImpl(BufferRef).get(), Dimensions, sizeof(DataT),
BufferRef.OffsetInBytes, BufferRef.IsSubBuffer, PropertyList) {
+ std::ignore = CodeLoc;
throwIfUsedByGraph();
preScreenAccessor(PropertyList);
initHostAcc();
detail::associateWithHandler(CommandGroupHandler, this, AccessTarget);
- detail::constructorNotification(detail::getSyclObjImpl(BufferRef).get(),
- detail::AccessorBaseHost::impl.get(),
- AccessTarget, AccessMode, CodeLoc);
GDBMethodsAnchor();
}
#endif
@@ -1420,6 +1399,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
detail::getSyclObjImpl(BufferRef).get(), Dimensions,
sizeof(DataT), IsPlaceH, BufferRef.OffsetInBytes,
BufferRef.IsSubBuffer, PropertyList) {
+ std::ignore = CodeLoc;
throwIfUsedByGraph();
preScreenAccessor(PropertyList);
if (!AccessorBaseHost::isPlaceholder())
@@ -1431,9 +1411,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
"exceed the bounds of the buffer");
initHostAcc();
- detail::constructorNotification(detail::getSyclObjImpl(BufferRef).get(),
- detail::AccessorBaseHost::impl.get(),
- AccessTarget, AccessMode, CodeLoc);
GDBMethodsAnchor();
}
#endif
@@ -1463,6 +1440,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
detail::getSyclObjImpl(BufferRef).get(), Dimensions,
sizeof(DataT), IsPlaceH, BufferRef.OffsetInBytes,
BufferRef.IsSubBuffer, PropertyList) {
+ std::ignore = CodeLoc;
throwIfUsedByGraph();
preScreenAccessor(PropertyList);
if (!AccessorBaseHost::isPlaceholder())
@@ -1474,9 +1452,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
"exceed the bounds of the buffer");
initHostAcc();
- detail::constructorNotification(detail::getSyclObjImpl(BufferRef).get(),
- detail::AccessorBaseHost::impl.get(),
- AccessTarget, AccessMode, CodeLoc);
GDBMethodsAnchor();
}
#endif
@@ -1535,6 +1510,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
detail::getSyclObjImpl(BufferRef).get(), Dimensions,
sizeof(DataT), BufferRef.OffsetInBytes,
BufferRef.IsSubBuffer, PropertyList) {
+ std::ignore = CodeLoc;
throwIfUsedByGraph();
preScreenAccessor(PropertyList);
if (BufferRef.isOutOfBounds(AccessOffset, AccessRange,
@@ -1545,9 +1521,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
initHostAcc();
detail::associateWithHandler(CommandGroupHandler, this, AccessTarget);
- detail::constructorNotification(detail::getSyclObjImpl(BufferRef).get(),
- detail::AccessorBaseHost::impl.get(),
- AccessTarget, AccessMode, CodeLoc);
GDBMethodsAnchor();
}
#endif
@@ -1578,6 +1551,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
detail::getSyclObjImpl(BufferRef).get(), Dimensions,
sizeof(DataT), BufferRef.OffsetInBytes,
BufferRef.IsSubBuffer, PropertyList) {
+ std::ignore = CodeLoc;
throwIfUsedByGraph();
preScreenAccessor(PropertyList);
if (BufferRef.isOutOfBounds(AccessOffset, AccessRange,
@@ -1588,9 +1562,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
initHostAcc();
detail::associateWithHandler(CommandGroupHandler, this, AccessTarget);
- detail::constructorNotification(detail::getSyclObjImpl(BufferRef).get(),
- detail::AccessorBaseHost::impl.get(),
- AccessTarget, AccessMode, CodeLoc);
GDBMethodsAnchor();
}
#endif
@@ -1645,10 +1616,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
PropertyListT::template areSameCompileTimeProperties(),
"Compile-time-constant properties must be the same");
(void)CodeLoc;
-#ifndef __SYCL_DEVICE_ONLY__
- detail::constructorNotification(getMemoryObject(), impl.get(), AccessTarget,
- AccessMode, CodeLoc);
-#endif
}
void swap(accessor &other) {
@@ -2250,8 +2217,7 @@ class __SYCL_SPECIAL_CLASS local_accessor_base :
}
#else
: LocalAccessorBaseHost(range<3>{1, 1, 1}, AdjustedDim, sizeof(DataT)) {
- detail::constructorNotification(nullptr, LocalAccessorBaseHost::impl.get(),
- access::target::local, AccessMode, CodeLoc);
+ std::ignore = CodeLoc;
GDBMethodsAnchor();
}
#endif
@@ -2268,9 +2234,8 @@ class __SYCL_SPECIAL_CLASS local_accessor_base :
#else
: LocalAccessorBaseHost(range<3>{1, 1, 1}, AdjustedDim, sizeof(DataT),
propList) {
- detail::constructorNotification(nullptr, LocalAccessorBaseHost::impl.get(),
- access::target::local, AccessMode, CodeLoc);
- GDBMethodsAnchor();
+ std::ignore = CodeLoc;
+ GDBMethodsAnchor();
}
#endif
@@ -2285,8 +2250,7 @@ class __SYCL_SPECIAL_CLASS local_accessor_base :
#else
: LocalAccessorBaseHost(detail::convertToArrayOfN<3, 1>(AllocationSize),
AdjustedDim, sizeof(DataT)) {
- detail::constructorNotification(nullptr, LocalAccessorBaseHost::impl.get(),
- access::target::local, AccessMode, CodeLoc);
+ std::ignore = CodeLoc;
GDBMethodsAnchor();
}
#endif
@@ -2305,9 +2269,8 @@ class __SYCL_SPECIAL_CLASS local_accessor_base :
#else
: LocalAccessorBaseHost(detail::convertToArrayOfN<3, 1>(AllocationSize),
AdjustedDim, sizeof(DataT), propList) {
- detail::constructorNotification(nullptr, LocalAccessorBaseHost::impl.get(),
- access::target::local, AccessMode, CodeLoc);
- GDBMethodsAnchor();
+ std::ignore = CodeLoc;
+ GDBMethodsAnchor();
}
#endif
diff --git a/sycl/include/sycl/accessor_image.hpp b/sycl/include/sycl/accessor_image.hpp
index f784561bafd95..c0fa764407c0f 100644
--- a/sycl/include/sycl/accessor_image.hpp
+++ b/sycl/include/sycl/accessor_image.hpp
@@ -51,16 +51,6 @@ template struct IsValidSampledCoord2020DataT<3, T> {
constexpr static bool value = std::is_same_v;
};
-void __SYCL_EXPORT unsampledImageConstructorNotification(
- void *ImageObj, void *AccessorObj,
- const std::optional &Target, access::mode Mode,
- const void *Type, uint32_t ElemSize, const code_location &CodeLoc);
-
-void __SYCL_EXPORT sampledImageConstructorNotification(
- void *ImageObj, void *AccessorObj,
- const std::optional &Target, const void *Type,
- uint32_t ElemSize, const code_location &CodeLoc);
-
class UnsampledImageAccessorImplHost;
class SampledImageAccessorImplHost;
using UnsampledImageAccessorImplPtr =
@@ -819,6 +809,7 @@ class __SYCL_EBO unsampled_image_accessor :
{ImageRef.getRowPitch(), ImageRef.getSlicePitch(), 0},
ImageRef.getChannelType(), ImageRef.getChannelOrder(),
PropList) {
+ std::ignore = CodeLoc;
device Device = detail::getDeviceFromHandler(CommandGroupHandlerRef);
// Avoid aspect::image warning.
aspect ImageAspect = aspect::image;
@@ -828,9 +819,6 @@ class __SYCL_EBO unsampled_image_accessor :
"Device associated with command group handler does not have "
"aspect::image.");
- detail::unsampledImageConstructorNotification(
- detail::getSyclObjImpl(ImageRef).get(), this->impl.get(), AccessTarget,
- AccessMode, (const void *)typeid(DataT).name(), sizeof(DataT), CodeLoc);
detail::associateWithHandler(CommandGroupHandlerRef, this, AccessTarget);
GDBMethodsAnchor();
}
@@ -972,11 +960,8 @@ class __SYCL_EBO host_unsampled_image_accessor
{ImageRef.getRowPitch(), ImageRef.getSlicePitch(), 0},
ImageRef.getChannelType(), ImageRef.getChannelOrder(),
PropList) {
+ std::ignore = CodeLoc;
addHostUnsampledImageAccessorAndWait(base_class::impl.get());
-
- detail::unsampledImageConstructorNotification(
- detail::getSyclObjImpl(ImageRef).get(), this->impl.get(), std::nullopt,
- AccessMode, (const void *)typeid(DataT).name(), sizeof(DataT), CodeLoc);
}
/* -- common interface members -- */
@@ -1120,6 +1105,7 @@ class __SYCL_EBO sampled_image_accessor :
{ImageRef.getRowPitch(), ImageRef.getSlicePitch(), 0},
ImageRef.getChannelType(), ImageRef.getChannelOrder(),
ImageRef.getSampler(), PropList) {
+ std::ignore = CodeLoc;
device Device = detail::getDeviceFromHandler(CommandGroupHandlerRef);
// Avoid aspect::image warning.
aspect ImageAspect = aspect::image;
@@ -1129,9 +1115,6 @@ class __SYCL_EBO sampled_image_accessor :
"Device associated with command group handler does not have "
"aspect::image.");
- detail::sampledImageConstructorNotification(
- detail::getSyclObjImpl(ImageRef).get(), this->impl.get(), AccessTarget,
- (const void *)typeid(DataT).name(), sizeof(DataT), CodeLoc);
detail::associateWithHandler(CommandGroupHandlerRef, this, AccessTarget);
GDBMethodsAnchor();
}
@@ -1249,11 +1232,8 @@ class __SYCL_EBO host_sampled_image_accessor
{ImageRef.getRowPitch(), ImageRef.getSlicePitch(), 0},
ImageRef.getChannelType(), ImageRef.getChannelOrder(),
ImageRef.getSampler(), PropList) {
+ std::ignore = CodeLoc;
addHostSampledImageAccessorAndWait(base_class::impl.get());
-
- detail::sampledImageConstructorNotification(
- detail::getSyclObjImpl(ImageRef).get(), this->impl.get(), std::nullopt,
- (const void *)typeid(DataT).name(), sizeof(DataT), CodeLoc);
}
/* -- common interface members -- */
diff --git a/sycl/include/sycl/buffer.hpp b/sycl/include/sycl/buffer.hpp
index 8b3a14af607f2..5f7c1bcad5c94 100644
--- a/sycl/include/sycl/buffer.hpp
+++ b/sycl/include/sycl/buffer.hpp
@@ -125,11 +125,6 @@ class __SYCL_EXPORT buffer_plain {
void set_write_back(bool NeedWriteBack);
- void constructorNotification(const detail::code_location &CodeLoc,
- void *UserObj, const void *HostObj,
- const void *Type, uint32_t Dim,
- uint32_t ElemType, size_t Range[3]);
-
template bool has_property() const noexcept {
return getPropList().template has_property();
}
@@ -204,9 +199,7 @@ class buffer : public detail::buffer_plain,
std::make_unique<
detail::SYCLMemObjAllocatorHolder>()),
Range(bufferRange) {
- buffer_plain::constructorNotification(
- CodeLoc, (void *)impl.get(), nullptr, (const void *)typeid(T).name(),
- dimensions, sizeof(T), detail::rangeToArray(Range).data());
+ std::ignore = CodeLoc;
}
buffer(const range &bufferRange, AllocatorT allocator,
@@ -217,9 +210,7 @@ class buffer : public detail::buffer_plain,
std::make_unique>(
allocator)),
Range(bufferRange) {
- buffer_plain::constructorNotification(
- CodeLoc, (void *)impl.get(), nullptr, (const void *)typeid(T).name(),
- dimensions, sizeof(T), detail::rangeToArray(Range).data());
+ std::ignore = CodeLoc;
}
buffer(T *hostData, const range &bufferRange,
@@ -230,9 +221,7 @@ class buffer : public detail::buffer_plain,
std::make_unique<
detail::SYCLMemObjAllocatorHolder>()),
Range(bufferRange) {
- buffer_plain::constructorNotification(
- CodeLoc, (void *)impl.get(), hostData, (const void *)typeid(T).name(),
- dimensions, sizeof(T), detail::rangeToArray(Range).data());
+ std::ignore = CodeLoc;
}
buffer(T *hostData, const range &bufferRange,
@@ -243,9 +232,7 @@ class buffer : public detail::buffer_plain,
std::make_unique>(
allocator)),
Range(bufferRange) {
- buffer_plain::constructorNotification(
- CodeLoc, (void *)impl.get(), hostData, (const void *)typeid(T).name(),
- dimensions, sizeof(T), detail::rangeToArray(Range).data());
+ std::ignore = CodeLoc;
}
template
@@ -258,9 +245,7 @@ class buffer : public detail::buffer_plain,
std::make_unique<
detail::SYCLMemObjAllocatorHolder>()),
Range(bufferRange) {
- buffer_plain::constructorNotification(
- CodeLoc, (void *)impl.get(), hostData, (const void *)typeid(T).name(),
- dimensions, sizeof(T), detail::rangeToArray(Range).data());
+ std::ignore = CodeLoc;
}
template
@@ -273,9 +258,7 @@ class buffer : public detail::buffer_plain,
std::make_unique>(
allocator)),
Range(bufferRange) {
- buffer_plain::constructorNotification(
- CodeLoc, (void *)impl.get(), hostData, (const void *)typeid(T).name(),
- dimensions, sizeof(T), detail::rangeToArray(Range).data());
+ std::ignore = CodeLoc;
}
buffer(const std::shared_ptr &hostData,
@@ -288,10 +271,7 @@ class buffer : public detail::buffer_plain,
allocator),
std::is_const::value),
Range(bufferRange) {
- buffer_plain::constructorNotification(
- CodeLoc, (void *)impl.get(), (void *)hostData.get(),
- (const void *)typeid(T).name(), dimensions, sizeof(T),
- detail::rangeToArray(Range).data());
+ std::ignore = CodeLoc;
}
buffer(const std::shared_ptr &hostData,
@@ -304,10 +284,7 @@ class buffer : public detail::buffer_plain,
allocator),
std::is_const::value),
Range(bufferRange) {
- buffer_plain::constructorNotification(
- CodeLoc, (void *)impl.get(), (void *)hostData.get(),
- (const void *)typeid(T).name(), dimensions, sizeof(T),
- detail::rangeToArray(Range).data());
+ std::ignore = CodeLoc;
}
buffer(const std::shared_ptr &hostData,
@@ -320,10 +297,7 @@ class buffer : public detail::buffer_plain,
detail::SYCLMemObjAllocatorHolder>(),
std::is_const::value),
Range(bufferRange) {
- buffer_plain::constructorNotification(
- CodeLoc, (void *)impl.get(), (void *)hostData.get(),
- (const void *)typeid(T).name(), dimensions, sizeof(T),
- detail::rangeToArray(Range).data());
+ std::ignore = CodeLoc;
}
buffer(const std::shared_ptr &hostData,
@@ -336,10 +310,7 @@ class buffer : public detail::buffer_plain,
detail::SYCLMemObjAllocatorHolder>(),
std::is_const::value),
Range(bufferRange) {
- buffer_plain::constructorNotification(
- CodeLoc, (void *)impl.get(), (void *)hostData.get(),
- (const void *)typeid(T).name(), dimensions, sizeof(T),
- detail::rangeToArray(Range).data());
+ std::ignore = CodeLoc;
}
template ::value),
Range(range<1>(std::distance(first, last))) {
- size_t r[3] = {Range[0], 0, 0};
- buffer_plain::constructorNotification(CodeLoc, (void *)impl.get(), &first,
- (const void *)typeid(T).name(),
- dimensions, sizeof(T), r);
+ std::ignore = CodeLoc;
}
template >(),
detail::iterator_to_const_type_t::value),
Range(range<1>(std::distance(first, last))) {
- size_t r[3] = {Range[0], 0, 0};
- buffer_plain::constructorNotification(CodeLoc, (void *)impl.get(), &first,
- (const void *)typeid(T).name(),
- dimensions, sizeof(T), r);
+ std::ignore = CodeLoc;
}
// This constructor is a prototype for a future SYCL specification
@@ -419,10 +384,7 @@ class buffer : public detail::buffer_plain,
std::make_unique>(
allocator)),
Range(range<1>(container.size())) {
- size_t r[3] = {Range[0], 0, 0};
- buffer_plain::constructorNotification(
- CodeLoc, (void *)impl.get(), container.data(),
- (const void *)typeid(T).name(), dimensions, sizeof(T), r);
+ std::ignore = CodeLoc;
}
// This constructor is a prototype for a future SYCL specification
@@ -439,9 +401,7 @@ class buffer : public detail::buffer_plain,
: buffer_plain(b.impl), Range(subRange),
OffsetInBytes(getOffsetInBytes(baseIndex, b.Range)),
IsSubBuffer(true) {
- buffer_plain::constructorNotification(
- CodeLoc, (void *)impl.get(), impl.get(), (const void *)typeid(T).name(),
- dimensions, sizeof(T), detail::rangeToArray(Range).data());
+ std::ignore = CodeLoc;
if (b.is_sub_buffer())
throw sycl::exception(make_error_code(errc::invalid),
@@ -458,18 +418,14 @@ class buffer : public detail::buffer_plain,
const detail::code_location CodeLoc = detail::code_location::current())
: buffer_plain(rhs.impl), Range(rhs.Range),
OffsetInBytes(rhs.OffsetInBytes), IsSubBuffer(rhs.IsSubBuffer) {
- buffer_plain::constructorNotification(
- CodeLoc, (void *)impl.get(), impl.get(), (const void *)typeid(T).name(),
- dimensions, sizeof(T), detail::rangeToArray(Range).data());
+ std::ignore = CodeLoc;
}
buffer(buffer &&rhs,
const detail::code_location CodeLoc = detail::code_location::current())
: buffer_plain(std::move(rhs.impl)), Range(rhs.Range),
OffsetInBytes(rhs.OffsetInBytes), IsSubBuffer(rhs.IsSubBuffer) {
- buffer_plain::constructorNotification(
- CodeLoc, (void *)impl.get(), impl.get(), (const void *)typeid(T).name(),
- dimensions, sizeof(T), detail::rangeToArray(Range).data());
+ std::ignore = CodeLoc;
}
buffer &operator=(const buffer &rhs) = default;
@@ -757,9 +713,7 @@ class buffer : public detail::buffer_plain,
Range{0} {
Range[0] = buffer_plain::getSize() / sizeof(T);
- buffer_plain::constructorNotification(
- CodeLoc, (void *)impl.get(), &MemObject, (const void *)typeid(T).name(),
- dimensions, sizeof(T), detail::rangeToArray(Range).data());
+ std::ignore = CodeLoc;
}
void addOrReplaceAccessorProperties(const property_list &PropertyList) {
@@ -777,9 +731,7 @@ class buffer : public detail::buffer_plain,
const detail::code_location CodeLoc = detail::code_location::current())
: buffer_plain(Impl), Range(reinterpretRange),
OffsetInBytes(reinterpretOffset), IsSubBuffer(isSubBuffer) {
- buffer_plain::constructorNotification(
- CodeLoc, (void *)impl.get(), Impl.get(), (const void *)typeid(T).name(),
- dimensions, sizeof(T), detail::rangeToArray(Range).data());
+ std::ignore = CodeLoc;
}
template
diff --git a/sycl/include/sycl/detail/ur.hpp b/sycl/include/sycl/detail/ur.hpp
index 1ed65046c0c1b..38b613026ed91 100644
--- a/sycl/include/sycl/detail/ur.hpp
+++ b/sycl/include/sycl/detail/ur.hpp
@@ -31,13 +31,6 @@ typedef void (*pi_context_extended_deleter)(void *user_data);
struct _sycl_device_binary_property_struct;
using sycl_device_binary_property = _sycl_device_binary_property_struct*;
-#ifdef XPTI_ENABLE_INSTRUMENTATION
-// Forward declarations
-namespace xpti {
-struct trace_event_data_t;
-}
-#endif
-
namespace sycl {
inline namespace _V1 {
diff --git a/sycl/include/sycl/ext/intel/experimental/pipes.hpp b/sycl/include/sycl/ext/intel/experimental/pipes.hpp
index b7f912183439c..5e36f1700fcb0 100644
--- a/sycl/include/sycl/ext/intel/experimental/pipes.hpp
+++ b/sycl/include/sycl/ext/intel/experimental/pipes.hpp
@@ -24,11 +24,6 @@
#include
#endif
-#ifdef XPTI_ENABLE_INSTRUMENTATION
-#include
-#include
-#endif
-
#include // for int32_t
#include // for string
#include // for _Swallow_...
diff --git a/sycl/include/sycl/image.hpp b/sycl/include/sycl/image.hpp
index 9a2c5fe1dedb9..245356dbec59e 100644
--- a/sycl/include/sycl/image.hpp
+++ b/sycl/include/sycl/image.hpp
@@ -288,18 +288,6 @@ class __SYCL_EXPORT image_plain {
image_channel_type getChannelType() const;
- void sampledImageConstructorNotification(const detail::code_location &CodeLoc,
- void *UserObj, const void *HostObj,
- uint32_t Dim, size_t Range[3],
- image_format Format,
- const image_sampler &Sampler);
- void sampledImageDestructorNotification(void *UserObj);
-
- void unsampledImageConstructorNotification(
- const detail::code_location &CodeLoc, void *UserObj, const void *HostObj,
- uint32_t Dim, size_t Range[3], image_format Format);
- void unsampledImageDestructorNotification(void *UserObj);
-
std::shared_ptr impl;
const property_list &getPropList() const;
@@ -747,9 +735,7 @@ class unsampled_image
std::make_unique<
detail::SYCLMemObjAllocatorHolder>(),
Dimensions, PropList) {
- common_base::unsampledImageConstructorNotification(
- CodeLoc, (void *)this->impl.get(), nullptr, Dimensions,
- detail::rangeToArray(Range).data(), Format);
+ std::ignore = CodeLoc;
}
unsampled_image(
@@ -763,9 +749,7 @@ class unsampled_image
std::make_unique<
detail::SYCLMemObjAllocatorHolder>(Allocator),
Dimensions, PropList) {
- common_base::unsampledImageConstructorNotification(
- CodeLoc, (void *)this->impl.get(), nullptr, Dimensions,
- detail::rangeToArray(Range).data(), Format);
+ std::ignore = CodeLoc;
}
template 1),
@@ -781,9 +765,7 @@ class unsampled_image
std::make_unique<
detail::SYCLMemObjAllocatorHolder>(),
Dimensions, PropList) {
- common_base::unsampledImageConstructorNotification(
- CodeLoc, (void *)this->impl.get(), nullptr, Dimensions,
- detail::rangeToArray(Range).data(), Format);
+ std::ignore = CodeLoc;
}
template 1),
@@ -801,9 +783,7 @@ class unsampled_image
std::make_unique<
detail::SYCLMemObjAllocatorHolder>(Allocator),
Dimensions, PropList) {
- common_base::unsampledImageConstructorNotification(
- CodeLoc, (void *)this->impl.get(), nullptr, Dimensions,
- detail::rangeToArray(Range).data(), Format);
+ std::ignore = CodeLoc;
}
unsampled_image(
@@ -816,9 +796,7 @@ class unsampled_image
std::make_unique<
detail::SYCLMemObjAllocatorHolder>(),
Dimensions, PropList) {
- common_base::unsampledImageConstructorNotification(
- CodeLoc, (void *)this->impl.get(), HostPointer, Dimensions,
- detail::rangeToArray(Range).data(), Format);
+ std::ignore = CodeLoc;
}
unsampled_image(
@@ -832,9 +810,7 @@ class unsampled_image
std::make_unique<
detail::SYCLMemObjAllocatorHolder>(Allocator),
Dimensions, PropList) {
- common_base::unsampledImageConstructorNotification(
- CodeLoc, (void *)this->impl.get(), HostPointer, Dimensions,
- detail::rangeToArray(Range).data(), Format);
+ std::ignore = CodeLoc;
}
template 1),
@@ -850,9 +826,7 @@ class unsampled_image
std::make_unique<
detail::SYCLMemObjAllocatorHolder>(),
Dimensions, PropList) {
- common_base::unsampledImageConstructorNotification(
- CodeLoc, (void *)this->impl.get(), HostPointer, Dimensions,
- detail::rangeToArray(Range).data(), Format);
+ std::ignore = CodeLoc;
}
template 1),
@@ -870,9 +844,7 @@ class unsampled_image
std::make_unique<
detail::SYCLMemObjAllocatorHolder>(Allocator),
Dimensions, PropList) {
- common_base::unsampledImageConstructorNotification(
- CodeLoc, (void *)this->impl.get(), HostPointer, Dimensions,
- detail::rangeToArray(Range).data(), Format);
+ std::ignore = CodeLoc;
}
unsampled_image(
@@ -885,9 +857,7 @@ class unsampled_image
std::make_unique<
detail::SYCLMemObjAllocatorHolder>(),
Dimensions, PropList, /*IsConstPtr*/ false) {
- common_base::unsampledImageConstructorNotification(
- CodeLoc, (void *)this->impl.get(), HostPointer.get(), Dimensions,
- detail::rangeToArray(Range).data(), Format);
+ std::ignore = CodeLoc;
}
unsampled_image(
@@ -902,9 +872,7 @@ class unsampled_image
std::make_unique<
detail::SYCLMemObjAllocatorHolder>(Allocator),
Dimensions, PropList, /*IsConstPtr*/ false) {
- common_base::unsampledImageConstructorNotification(
- CodeLoc, (void *)this->impl.get(), HostPointer.get(), Dimensions,
- detail::rangeToArray(Range).data(), Format);
+ std::ignore = CodeLoc;
}
template 1),
@@ -921,9 +889,7 @@ class unsampled_image
std::make_unique<
detail::SYCLMemObjAllocatorHolder>(),
Dimensions, PropList, /*IsConstPtr*/ false) {
- common_base::unsampledImageConstructorNotification(
- CodeLoc, (void *)this->impl.get(), HostPointer.get(), Dimensions,
- detail::rangeToArray(Range).data(), Format);
+ std::ignore = CodeLoc;
}
template 1),
@@ -941,9 +907,7 @@ class unsampled_image
std::make_unique<
detail::SYCLMemObjAllocatorHolder>(Allocator),
Dimensions, PropList, /*IsConstPtr*/ false) {
- common_base::unsampledImageConstructorNotification(
- CodeLoc, (void *)this->impl.get(), HostPointer.get(), Dimensions,
- detail::rangeToArray(Range).data(), Format);
+ std::ignore = CodeLoc;
}
/* -- common interface members -- */
@@ -956,14 +920,7 @@ class unsampled_image
unsampled_image &operator=(unsampled_image &&rhs) = default;
- ~unsampled_image() {
- try {
- common_base::unsampledImageDestructorNotification(
- (void *)this->impl.get());
- } catch (std::exception &e) {
- __SYCL_REPORT_EXCEPTION_TO_STREAM("exception in ~unsampled_image", e);
- }
- }
+ ~unsampled_image() {}
bool operator==(const unsampled_image &rhs) const {
return this->impl == rhs.impl;
@@ -1034,9 +991,7 @@ class sampled_image
std::make_unique<
detail::SYCLMemObjAllocatorHolder>(),
Dimensions, PropList) {
- common_base::sampledImageConstructorNotification(
- CodeLoc, (void *)this->impl.get(), nullptr, Dimensions,
- detail::rangeToArray(Range).data(), Format, Sampler);
+ std::ignore = CodeLoc;
}
template 1),
@@ -1053,9 +1008,7 @@ class sampled_image
std::make_unique<
detail::SYCLMemObjAllocatorHolder>(),
Dimensions, PropList) {
- common_base::sampledImageConstructorNotification(
- CodeLoc, (void *)this->impl.get(), HostPointer, Dimensions,
- detail::rangeToArray(Range).data(), Format, Sampler);
+ std::ignore = CodeLoc;
}
sampled_image(
@@ -1069,9 +1022,7 @@ class sampled_image
std::make_unique<
detail::SYCLMemObjAllocatorHolder>(),
Dimensions, PropList) {
- common_base::sampledImageConstructorNotification(
- CodeLoc, (void *)this->impl.get(), HostPointer.get(), Dimensions,
- detail::rangeToArray(Range).data(), Format, Sampler);
+ std::ignore = CodeLoc;
}
template 1),
@@ -1088,9 +1039,7 @@ class sampled_image
std::make_unique<
detail::SYCLMemObjAllocatorHolder>(),
Dimensions, PropList) {
- common_base::sampledImageConstructorNotification(
- CodeLoc, (void *)this->impl.get(), HostPointer.get(), Dimensions,
- detail::rangeToArray(Range).data(), Format, Sampler);
+ std::ignore = CodeLoc;
}
/* -- common interface members -- */
@@ -1103,13 +1052,7 @@ class sampled_image
sampled_image &operator=(sampled_image &&rhs) = default;
- ~sampled_image() {
- try {
- common_base::sampledImageDestructorNotification((void *)this->impl.get());
- } catch (std::exception &e) {
- __SYCL_REPORT_EXCEPTION_TO_STREAM("exception in ~sampled_image", e);
- }
- }
+ ~sampled_image() {}
bool operator==(const sampled_image &rhs) const {
return this->impl == rhs.impl;
diff --git a/sycl/include/sycl/range.hpp b/sycl/include/sycl/range.hpp
index 7d3249235a5ca..43f0b7efc731a 100644
--- a/sycl/include/sycl/range.hpp
+++ b/sycl/include/sycl/range.hpp
@@ -229,18 +229,5 @@ range(size_t, size_t)->range<2>;
range(size_t, size_t, size_t)->range<3>;
#endif
-namespace detail {
-// XPTI helpers for creating array from a range.
-inline std::array rangeToArray(const range<3> &r) {
- return {r[0], r[1], r[2]};
-}
-inline std::array rangeToArray(const range<2> &r) {
- return {r[0], r[1], 0};
-}
-inline std::array rangeToArray(const range<1> &r) {
- return {r[0], 0, 0};
-}
-} // namespace detail
-
} // namespace _V1
} // namespace sycl
diff --git a/sycl/source/CMakeLists.txt b/sycl/source/CMakeLists.txt
index d9f8801d45ba5..b971947e1770a 100644
--- a/sycl/source/CMakeLists.txt
+++ b/sycl/source/CMakeLists.txt
@@ -8,17 +8,10 @@ configure_file(
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY)
-if (SYCL_ENABLE_XPTI_TRACING)
- if (NOT DEFINED LLVM_EXTERNAL_XPTI_SOURCE_DIR)
- message (FATAL_ERROR "Undefined LLVM_EXTERNAL_XPTI_SOURCE_DIR variable: Must be set when XPTI tracing is set to ON")
- endif()
- include_directories(${LLVM_EXTERNAL_XPTI_SOURCE_DIR}/include)
-endif()
-
function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
# Add an optional argument so we can get the library name to
# link with for Windows Debug version
- cmake_parse_arguments(ARG "" "XPTI_LIB;IMPLIB_NAME" "COMPILE_OPTIONS;SOURCES" ${ARGN})
+ cmake_parse_arguments(ARG "" "IMPLIB_NAME" "COMPILE_OPTIONS;SOURCES" ${ARGN})
add_library(${LIB_OBJ_NAME} OBJECT ${ARG_SOURCES})
add_library(${LIB_NAME} SHARED
@@ -64,11 +57,6 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
set_target_properties(${LIB_NAME} PROPERTIES LINKER_LANGUAGE CXX)
- if (SYCL_ENABLE_XPTI_TRACING)
- target_compile_definitions(${LIB_OBJ_NAME} PRIVATE XPTI_ENABLE_INSTRUMENTATION XPTI_STATIC_LIBRARY)
- target_link_libraries(${LIB_NAME} PRIVATE ${ARG_XPTI_LIB})
- endif()
-
if (NOT LLVM_ENABLE_ZSTD)
target_compile_definitions(${LIB_OBJ_NAME} PRIVATE SYCL_RT_ZSTD_NOT_AVAIABLE)
else()
@@ -129,9 +117,6 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
${LIB_NAME} PRIVATE "-Wl,--version-script=${linker_script}")
set_target_properties(${LIB_NAME} PROPERTIES LINK_DEPENDS ${linker_script})
endif()
- if (SYCL_ENABLE_XPTI_TRACING)
- target_link_libraries(${LIB_NAME} PRIVATE ${CMAKE_DL_LIBS})
- endif()
endif()
target_compile_definitions(${LIB_OBJ_NAME} PRIVATE SYCL2020_DISABLE_DEPRECATION_WARNINGS)
@@ -300,7 +285,6 @@ set(SYCL_COMMON_SOURCES
"detail/usm/usm_impl.cpp"
"detail/ur.cpp"
"detail/util.cpp"
- "detail/xpti_registry.cpp"
"accessor.cpp"
"buffer.cpp"
"context.cpp"
@@ -347,16 +331,9 @@ if (MSVC)
endforeach()
set(WIN_DUPE "1")
- if (SYCL_ENABLE_XPTI_TRACING)
- add_sycl_rt_library(sycl${SYCL_MAJOR_VERSION}d sycld_object XPTI_LIB xptid COMPILE_OPTIONS "/MDd" SOURCES ${SYCL_NON_PREVIEW_SOURCES} IMPLIB_NAME sycld)
- if(SYCL_ENABLE_MAJOR_RELEASE_PREVIEW_LIB)
- add_sycl_rt_library(sycl${SYCL_MAJOR_VERSION}-previewd sycl-previewd_object XPTI_LIB xptid COMPILE_OPTIONS "/MDd" "/D__INTEL_PREVIEW_BREAKING_CHANGES" SOURCES ${SYCL_PREVIEW_SOURCES} IMPLIB_NAME sycl-previewd)
- endif()
- else()
- add_sycl_rt_library(sycl${SYCL_MAJOR_VERSION}d sycld_object COMPILE_OPTIONS "/MDd" SOURCES ${SYCL_NON_PREVIEW_SOURCES} IMPLIB_NAME sycld)
- if(SYCL_ENABLE_MAJOR_RELEASE_PREVIEW_LIB)
- add_sycl_rt_library(sycl${SYCL_MAJOR_VERSION}-previewd sycl-previewd_object COMPILE_OPTIONS "/MDd" "/D__INTEL_PREVIEW_BREAKING_CHANGES" SOURCES ${SYCL_PREVIEW_SOURCES} IMPLIB_NAME sycl-previewd)
- endif()
+ add_sycl_rt_library(sycl${SYCL_MAJOR_VERSION}d sycld_object COMPILE_OPTIONS "/MDd" SOURCES ${SYCL_NON_PREVIEW_SOURCES} IMPLIB_NAME sycld)
+ if(SYCL_ENABLE_MAJOR_RELEASE_PREVIEW_LIB)
+ add_sycl_rt_library(sycl${SYCL_MAJOR_VERSION}-previewd sycl-previewd_object COMPILE_OPTIONS "/MDd" "/D__INTEL_PREVIEW_BREAKING_CHANGES" SOURCES ${SYCL_PREVIEW_SOURCES} IMPLIB_NAME sycl-previewd)
endif()
unset(WIN_DUPE)
add_library(sycld ALIAS sycl${SYCL_MAJOR_VERSION}d)
@@ -381,16 +358,9 @@ endif()
# Version-agnostic name of the import library, has effect on Windows only.
set(IMPLIB_NAME "sycl")
-if (SYCL_ENABLE_XPTI_TRACING)
- add_sycl_rt_library(${LIB_NAME} sycl_object XPTI_LIB xpti COMPILE_OPTIONS ${SYCL_EXTRA_OPTS} SOURCES ${SYCL_NON_PREVIEW_SOURCES} IMPLIB_NAME ${IMPLIB_NAME})
- if(SYCL_ENABLE_MAJOR_RELEASE_PREVIEW_LIB)
- add_sycl_rt_library(${LIB_NAME}-preview sycl-preview_object XPTI_LIB xpti COMPILE_OPTIONS ${SYCL_EXTRA_OPTS} "-D__INTEL_PREVIEW_BREAKING_CHANGES" SOURCES ${SYCL_PREVIEW_SOURCES} IMPLIB_NAME ${IMPLIB_NAME}-preview)
- endif()
-else()
- add_sycl_rt_library(${LIB_NAME} sycl_object COMPILE_OPTIONS ${SYCL_EXTRA_OPTS} SOURCES ${SYCL_NON_PREVIEW_SOURCES} IMPLIB_NAME ${IMPLIB_NAME})
- if(SYCL_ENABLE_MAJOR_RELEASE_PREVIEW_LIB)
- add_sycl_rt_library(${LIB_NAME}-preview sycl-preview_object COMPILE_OPTIONS ${SYCL_EXTRA_OPTS} "-D__INTEL_PREVIEW_BREAKING_CHANGES" SOURCES ${SYCL_PREVIEW_SOURCES} IMPLIB_NAME ${IMPLIB_NAME}-preview)
- endif()
+add_sycl_rt_library(${LIB_NAME} sycl_object COMPILE_OPTIONS ${SYCL_EXTRA_OPTS} SOURCES ${SYCL_NON_PREVIEW_SOURCES} IMPLIB_NAME ${IMPLIB_NAME})
+if(SYCL_ENABLE_MAJOR_RELEASE_PREVIEW_LIB)
+ add_sycl_rt_library(${LIB_NAME}-preview sycl-preview_object COMPILE_OPTIONS ${SYCL_EXTRA_OPTS} "-D__INTEL_PREVIEW_BREAKING_CHANGES" SOURCES ${SYCL_PREVIEW_SOURCES} IMPLIB_NAME ${IMPLIB_NAME}-preview)
endif()
if (WIN32)
diff --git a/sycl/source/buffer.cpp b/sycl/source/buffer.cpp
index f62da9f968ccb..07e6ea8b39376 100644
--- a/sycl/source/buffer.cpp
+++ b/sycl/source/buffer.cpp
@@ -70,14 +70,6 @@ void buffer_plain::set_final_data_internal(
impl->set_final_data(FinalDataFunc);
}
-void buffer_plain::constructorNotification(const detail::code_location &CodeLoc,
- void *UserObj, const void *HostObj,
- const void *Type, uint32_t Dim,
- uint32_t ElemType, size_t Range[3]) {
- impl->constructorNotification(CodeLoc, UserObj, HostObj, Type, Dim, ElemType,
- Range);
-}
-
void buffer_plain::set_write_back(bool NeedWriteBack) {
impl->set_write_back(NeedWriteBack);
}
diff --git a/sycl/source/detail/accessor_impl.cpp b/sycl/source/detail/accessor_impl.cpp
index 1d349627e64e7..995d31d65df83 100644
--- a/sycl/source/detail/accessor_impl.cpp
+++ b/sycl/source/detail/accessor_impl.cpp
@@ -10,7 +10,6 @@
#include
#include
#include
-#include
namespace sycl {
inline namespace _V1 {
@@ -47,39 +46,6 @@ void addHostSampledImageAccessorAndWait(SampledImageAccessorImplHost *Req) {
addHostAccessorAndWait(Req);
}
-void constructorNotification(void *BufferObj, void *AccessorObj,
- sycl::access::target Target,
- sycl::access::mode Mode,
- const detail::code_location &CodeLoc) {
- XPTIRegistry::bufferAccessorNotification(
- BufferObj, AccessorObj, (uint32_t)Target, (uint32_t)Mode, CodeLoc);
-}
-
-void unsampledImageConstructorNotification(
- void *ImageObj, void *AccessorObj,
- const std::optional &Target, access::mode Mode,
- const void *Type, uint32_t ElemSize, const code_location &CodeLoc) {
- if (Target)
- XPTIRegistry::unsampledImageAccessorNotification(
- ImageObj, AccessorObj, (uint32_t)*Target, (uint32_t)Mode, Type,
- ElemSize, CodeLoc);
- else
- XPTIRegistry::unsampledImageHostAccessorNotification(
- ImageObj, AccessorObj, (uint32_t)Mode, Type, ElemSize, CodeLoc);
-}
-
-void sampledImageConstructorNotification(
- void *ImageObj, void *AccessorObj,
- const std::optional &Target, const void *Type,
- uint32_t ElemSize, const code_location &CodeLoc) {
- if (Target)
- XPTIRegistry::sampledImageAccessorNotification(
- ImageObj, AccessorObj, (uint32_t)*Target, Type, ElemSize, CodeLoc);
- else
- XPTIRegistry::sampledImageHostAccessorNotification(ImageObj, AccessorObj,
- Type, ElemSize, CodeLoc);
-}
-
} // namespace detail
} // namespace _V1
} // namespace sycl
diff --git a/sycl/source/detail/adapter.hpp b/sycl/source/detail/adapter.hpp
index d78743ac6159e..5c6a9c5771ff2 100644
--- a/sycl/source/detail/adapter.hpp
+++ b/sycl/source/detail/adapter.hpp
@@ -15,10 +15,6 @@
#include
#include
-#ifdef XPTI_ENABLE_INSTRUMENTATION
-// Include the headers necessary for emitting traces using the trace framework
-#include "xpti/xpti_trace_framework.h"
-#endif
#include
#include
diff --git a/sycl/source/detail/allowlist.cpp b/sycl/source/detail/allowlist.cpp
index 96b9577aca975..495e89db98723 100644
--- a/sycl/source/detail/allowlist.cpp
+++ b/sycl/source/detail/allowlist.cpp
@@ -190,7 +190,7 @@ AllowListParsedT parseAllowList(const std::string &AllowListRaw) {
Key) != SupportedKeyNamesRequireRegexValue.end()) {
const std::string Prefix("{{");
// TODO: can be changed to string_view::starts_with after switching
- // DPC++ RT to C++20
+ // the runtime to C++20
if (Prefix != AllowListRaw.substr(ValueStart, Prefix.length())) {
throw sycl::exception(
sycl::make_error_code(sycl::errc::runtime),
@@ -302,7 +302,7 @@ bool deviceIsAllowed(const DeviceDescT &DeviceDesc,
"SYCL_DEVICE_ALLOWLIST.");
auto EqualityComp = [&](const std::string &KeyName,
const DeviceDescT &AllowListDeviceDesc) {
- // change to map::contains after switching DPC++ RT to C++20
+ // change to map::contains after switching the runtime to C++20
if (AllowListDeviceDesc.find(KeyName) != AllowListDeviceDesc.end())
if (AllowListDeviceDesc.at(KeyName) != DeviceDesc.at(KeyName))
return false;
diff --git a/sycl/source/detail/buffer_impl.cpp b/sycl/source/detail/buffer_impl.cpp
index 777091f6be572..d868173feb478 100644
--- a/sycl/source/detail/buffer_impl.cpp
+++ b/sycl/source/detail/buffer_impl.cpp
@@ -11,16 +11,12 @@
#include
#include
#include
-#include
#include
#include
namespace sycl {
inline namespace _V1 {
namespace detail {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
-uint8_t GBufferStreamID;
-#endif
void *buffer_impl::allocateMem(ContextImplPtr Context, bool InitFromUserData,
void *HostPtr,
ur_event_handle_t &OutEventToWait) {
@@ -34,17 +30,6 @@ void *buffer_impl::allocateMem(ContextImplPtr Context, bool InitFromUserData,
BaseT::getSizeInBytes(), BaseT::MInteropEvent, BaseT::MInteropContext,
MProps, OutEventToWait);
}
-void buffer_impl::constructorNotification(const detail::code_location &CodeLoc,
- void *UserObj, const void *HostObj,
- const void *Type, uint32_t Dim,
- uint32_t ElemSize, size_t Range[3]) {
- XPTIRegistry::bufferConstructorNotification(UserObj, CodeLoc, HostObj, Type,
- Dim, ElemSize, Range);
-}
-
-void buffer_impl::destructorNotification(void *UserObj) {
- XPTIRegistry::bufferDestructorNotification(UserObj);
-}
void buffer_impl::addInteropObject(
std::vector &Handles) const {
diff --git a/sycl/source/detail/buffer_impl.hpp b/sycl/source/detail/buffer_impl.hpp
index be3a529f17718..ff5ff868508a9 100644
--- a/sycl/source/detail/buffer_impl.hpp
+++ b/sycl/source/detail/buffer_impl.hpp
@@ -131,11 +131,6 @@ class buffer_impl final : public SYCLMemObjT {
void *allocateMem(ContextImplPtr Context, bool InitFromUserData,
void *HostPtr, ur_event_handle_t &OutEventToWait) override;
- void constructorNotification(const detail::code_location &CodeLoc,
- void *UserObj, const void *HostObj,
- const void *Type, uint32_t Dim,
- uint32_t ElemType, size_t Range[3]);
- void destructorNotification(void *UserObj);
MemObjType getType() const override { return MemObjType::Buffer; }
@@ -144,7 +139,6 @@ class buffer_impl final : public SYCLMemObjT {
BaseT::updateHostMemory();
} catch (...) {
}
- destructorNotification(this);
}
void resize(size_t size) { BaseT::MSizeInBytes = size; }
diff --git a/sycl/source/detail/event_impl.cpp b/sycl/source/detail/event_impl.cpp
index f6e5edfc92e74..977df8576c8e0 100644
--- a/sycl/source/detail/event_impl.cpp
+++ b/sycl/source/detail/event_impl.cpp
@@ -18,19 +18,9 @@
#include
-#ifdef XPTI_ENABLE_INSTRUMENTATION
-#include "xpti/xpti_trace_framework.hpp"
-#include
-#include
-#include
-#endif
-
namespace sycl {
inline namespace _V1 {
namespace detail {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
-extern xpti::trace_event_data_t *GSYCLGraphEvent;
-#endif
// If we do not yet have a context, use the default one.
void event_impl::initContextIfNeeded() {
@@ -178,64 +168,6 @@ event_impl::event_impl(const QueueImplPtr &Queue)
MState.store(HES_Complete);
}
-void *event_impl::instrumentationProlog(std::string &Name, int32_t StreamID,
- uint64_t &IId) const {
- void *TraceEvent = nullptr;
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- constexpr uint16_t NotificationTraceType = xpti::trace_wait_begin;
- if (!xptiCheckTraceEnabled(StreamID, NotificationTraceType))
- return TraceEvent;
- xpti::trace_event_data_t *WaitEvent = nullptr;
-
- // Create a string with the event address so it
- // can be associated with other debug data
- xpti::utils::StringHelper SH;
- Name = SH.nameWithAddress("event.wait", this->getHandle());
-
- // We can emit the wait associated with the graph if the
- // event does not have a command object or associated with
- // the command object, if it exists
- if (MCommand) {
- Command *Cmd = (Command *)MCommand;
- WaitEvent = Cmd->MTraceEvent ? static_cast(Cmd->MTraceEvent)
- : GSYCLGraphEvent;
- } else {
- // If queue.wait() is used, we want to make sure the information about the
- // queue is available with the wait events. We check to see if the
- // TraceEvent is available in the Queue object.
- void *TraceEvent = nullptr;
- if (QueueImplPtr Queue = MQueue.lock()) {
- TraceEvent = Queue->getTraceEvent();
- WaitEvent =
- (TraceEvent ? static_cast(TraceEvent) : GSYCLGraphEvent);
- } else
- WaitEvent = GSYCLGraphEvent;
- }
- // Record the current instance ID for use by Epilog
- IId = xptiGetUniqueId();
- xptiNotifySubscribers(StreamID, NotificationTraceType, nullptr, WaitEvent,
- IId, static_cast(Name.c_str()));
- TraceEvent = (void *)WaitEvent;
-#endif
- return TraceEvent;
-}
-
-void event_impl::instrumentationEpilog(void *TelemetryEvent,
- const std::string &Name,
- int32_t StreamID, uint64_t IId) const {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- constexpr uint16_t NotificationTraceType = xpti::trace_wait_end;
- if (!(xptiCheckTraceEnabled(StreamID, NotificationTraceType) &&
- TelemetryEvent))
- return;
- // Close the wait() scope
- xpti::trace_event_data_t *TraceEvent =
- (xpti::trace_event_data_t *)TelemetryEvent;
- xptiNotifySubscribers(StreamID, NotificationTraceType, nullptr, TraceEvent,
- IId, static_cast(Name.c_str()));
-#endif
-}
-
void event_impl::wait(std::shared_ptr Self,
bool *Success) {
if (MState == HES_Discarded)
@@ -248,14 +180,6 @@ void event_impl::wait(std::shared_ptr Self,
"with a command graph.");
}
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- void *TelemetryEvent = nullptr;
- uint64_t IId = 0;
- std::string Name;
- int32_t StreamID = xptiRegisterStream(SYCL_STREAM_NAME);
- TelemetryEvent = instrumentationProlog(Name, StreamID, IId);
-#endif
-
auto EventHandle = getHandle();
if (EventHandle)
// presence of the native handle means the command has been enqueued, so no
@@ -263,10 +187,6 @@ void event_impl::wait(std::shared_ptr Self,
waitInternal(Success);
else if (MCommand)
detail::Scheduler::getInstance().waitForEvent(Self, Success);
-
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- instrumentationEpilog(TelemetryEvent, Name, StreamID, IId);
-#endif
}
void event_impl::wait_and_throw(
diff --git a/sycl/source/detail/event_impl.hpp b/sycl/source/detail/event_impl.hpp
index 768de70826624..2bd42c3e0060d 100644
--- a/sycl/source/detail/event_impl.hpp
+++ b/sycl/source/detail/event_impl.hpp
@@ -340,13 +340,6 @@ class event_impl {
}
protected:
- // When instrumentation is enabled emits trace event for event wait begin and
- // returns the telemetry event generated for the wait
- void *instrumentationProlog(std::string &Name, int32_t StreamID,
- uint64_t &instance_id) const;
- // Uses events generated by the Prolog and emits event wait done event
- void instrumentationEpilog(void *TelementryEvent, const std::string &Name,
- int32_t StreamID, uint64_t IId) const;
void checkProfilingPreconditions() const;
std::atomic MEvent = nullptr;
diff --git a/sycl/source/detail/global_handler.cpp b/sycl/source/detail/global_handler.cpp
index 5669fbdaacc50..2dcfda8e2b24c 100644
--- a/sycl/source/detail/global_handler.cpp
+++ b/sycl/source/detail/global_handler.cpp
@@ -19,7 +19,6 @@
#include
#include
#include
-#include
#include
#include
@@ -78,52 +77,6 @@ std::atomic_uint ObjectUsageCounter::MCounter{0};
GlobalHandler::GlobalHandler() = default;
GlobalHandler::~GlobalHandler() = default;
-void GlobalHandler::InitXPTI() {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- // Let subscribers know a new stream is being initialized
- getXPTIRegistry().initializeStream(SYCL_STREAM_NAME, GMajVer, GMinVer,
- GVerStr);
- xpti::payload_t SYCLPayload("SYCL Runtime Exceptions");
- uint64_t SYCLInstanceNo;
- GSYCLCallEvent = xptiMakeEvent("SYCL Try-catch Exceptions", &SYCLPayload,
- xpti::trace_algorithm_event, xpti_at::active,
- &SYCLInstanceNo);
-#endif
-}
-
-void GlobalHandler::TraceEventXPTI(const char *Message) {
- if (!Message)
- return;
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- static std::once_flag InitXPTIFlag;
- if (xptiTraceEnabled()) {
- std::call_once(InitXPTIFlag, [&]() { InitXPTI(); });
-
- // We have to handle the cases where: (1) we may have just the code location
- // set and not UID and (2) UID set
- detail::tls_code_loc_t Tls;
- auto CodeLocation = Tls.query();
-
- // Creating a tracepoint will convert a CodeLocation to UID, if not set
- xpti::framework::tracepoint_t TP(
- CodeLocation.fileName(), CodeLocation.functionName(),
- CodeLocation.lineNumber(), CodeLocation.columnNumber(), nullptr);
-
- // The call to notify will have the signature of:
- // (1) the stream defined in .stream()
- // (2) The trace type equal to what is set by .trace_type()
- // (3) Parent event set to NULL
- // (4) Current event set to one created from CodeLocation and UID
- // (5) An instance ID that records the number of times this code location
- // has been seen (6) The message generated by the exception handler
- TP.stream(SYCL_STREAM_NAME)
- .trace_type(xpti::trace_point_type_t::diagnostics)
- .notify(static_cast(Message));
- }
-
-#endif
-}
-
GlobalHandler *&GlobalHandler::getInstancePtr() {
static GlobalHandler *RTGlobalObjHandler = new GlobalHandler();
return RTGlobalObjHandler;
@@ -218,10 +171,6 @@ GlobalHandler::getOneapiDeviceSelectorTargets(const std::string &InitValue) {
return getOrCreate(MOneapiDeviceSelectorTargets, InitValue);
}
-XPTIRegistry &GlobalHandler::getXPTIRegistry() {
- return getOrCreate(MXPTIRegistry);
-}
-
ThreadPool &GlobalHandler::getHostTaskThreadPool() {
int Size = SYCLConfig::get();
ThreadPool &TP = getOrCreate(MHostTaskThreadPool, Size);
@@ -347,8 +296,6 @@ void shutdown_late() {
if (Handler->MAdapters.Inst)
Handler->MAdapters.Inst.reset(nullptr);
- Handler->MXPTIRegistry.Inst.reset(nullptr);
-
// Release the rest of global resources.
delete Handler;
Handler = nullptr;
@@ -374,13 +321,6 @@ extern "C" __SYCL_EXPORT BOOL WINAPI DllMain(HINSTANCE hinstDLL,
if (PrintUrTrace)
std::cout << "---> DLL_PROCESS_DETACH syclx.dll\n" << std::endl;
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- if (xptiTraceEnabled())
- return TRUE; // When doing xpti tracing, we can't safely call shutdown.
- // TODO: figure out what XPTI is doing that prevents
- // release.
-#endif
-
try {
shutdown_win();
} catch (std::exception &e) {
diff --git a/sycl/source/detail/global_handler.hpp b/sycl/source/detail/global_handler.hpp
index 4b834927e3832..e4a38316aa3c5 100644
--- a/sycl/source/detail/global_handler.hpp
+++ b/sycl/source/detail/global_handler.hpp
@@ -24,7 +24,6 @@ class ProgramManager;
class Sync;
class Adapter;
class ods_target_list;
-class XPTIRegistry;
class ThreadPool;
using PlatformImplPtr = std::shared_ptr;
@@ -70,7 +69,6 @@ class GlobalHandler {
std::mutex &getFilterMutex();
std::vector &getAdapters();
ods_target_list &getOneapiDeviceSelectorTargets(const std::string &InitValue);
- XPTIRegistry &getXPTIRegistry();
ThreadPool &getHostTaskThreadPool();
static void registerEarlyShutdownHandler();
@@ -82,17 +80,10 @@ class GlobalHandler {
void drainThreadPool();
void prepareSchedulerToRelease(bool Blocking);
- void InitXPTI();
- void TraceEventXPTI(const char *Message);
-
// For testing purposes only
void attachScheduler(Scheduler *Scheduler);
private:
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- void *GSYCLCallEvent = nullptr;
-#endif
-
bool OkToDefer = true;
friend void shutdown_win();
@@ -126,7 +117,6 @@ class GlobalHandler {
InstWithLock MFilterMutex;
InstWithLock> MAdapters;
InstWithLock MOneapiDeviceSelectorTargets;
- InstWithLock MXPTIRegistry;
// Thread pool for host task and event callbacks execution
InstWithLock MHostTaskThreadPool;
};
diff --git a/sycl/source/detail/graph_impl.cpp b/sycl/source/detail/graph_impl.cpp
index e6181a559d8e6..87a6c0745ea9c 100644
--- a/sycl/source/detail/graph_impl.cpp
+++ b/sycl/source/detail/graph_impl.cpp
@@ -779,22 +779,6 @@ exec_graph_impl::enqueueNodeDirect(sycl::context Ctx,
ur_exp_command_buffer_sync_point_t NewSyncPoint;
ur_exp_command_buffer_command_handle_t NewCommand = 0;
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- int32_t StreamID = xptiRegisterStream(sycl::detail::SYCL_STREAM_NAME);
- sycl::detail::CGExecKernel *CGExec =
- static_cast(Node->MCommandGroup.get());
- sycl::detail::code_location CodeLoc(CGExec->MFileName.c_str(),
- CGExec->MFunctionName.c_str(),
- CGExec->MLine, CGExec->MColumn);
- auto [CmdTraceEvent, InstanceID] = emitKernelInstrumentationData(
- StreamID, CGExec->MSyclKernel, CodeLoc, CGExec->MIsTopCodeLoc,
- CGExec->MKernelName.c_str(), nullptr, CGExec->MNDRDesc,
- CGExec->MKernelBundle, CGExec->MArgs);
- if (CmdTraceEvent)
- sycl::detail::emitInstrumentationGeneral(
- StreamID, InstanceID, CmdTraceEvent, xpti::trace_task_begin, nullptr);
-#endif
-
ur_result_t Res = sycl::detail::enqueueImpCommandBufferKernel(
Ctx, DeviceImpl, CommandBuffer,
*static_cast((Node->MCommandGroup.get())),
@@ -809,12 +793,6 @@ exec_graph_impl::enqueueNodeDirect(sycl::context Ctx,
"Failed to add kernel to UR command-buffer");
}
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- if (CmdTraceEvent)
- sycl::detail::emitInstrumentationGeneral(
- StreamID, InstanceID, CmdTraceEvent, xpti::trace_task_end, nullptr);
-#endif
-
return NewSyncPoint;
}
diff --git a/sycl/source/detail/image_impl.cpp b/sycl/source/detail/image_impl.cpp
index a8582a2893943..a222d14ac1eb9 100644
--- a/sycl/source/detail/image_impl.cpp
+++ b/sycl/source/detail/image_impl.cpp
@@ -9,7 +9,6 @@
#include
#include
#include
-#include
#include
#include
@@ -18,9 +17,6 @@
namespace sycl {
inline namespace _V1 {
namespace detail {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
-uint8_t GImageStreamID;
-#endif
template
static bool checkImageValueRange(const std::vector &Devices,
@@ -457,31 +453,6 @@ std::vector image_impl::getDevices(const ContextImplPtr Context) {
return Context->get_info();
}
-void image_impl::sampledImageConstructorNotification(
- const detail::code_location &CodeLoc, void *UserObj, const void *HostObj,
- uint32_t Dim, size_t Range[3], image_format Format,
- const image_sampler &Sampler) {
- XPTIRegistry::sampledImageConstructorNotification(
- UserObj, CodeLoc, HostObj, Dim, Range, (uint32_t)Format,
- (uint32_t)Sampler.addressing, (uint32_t)Sampler.coordinate,
- (uint32_t)Sampler.filtering);
-}
-
-void image_impl::sampledImageDestructorNotification(void *UserObj) {
- XPTIRegistry::sampledImageDestructorNotification(UserObj);
-}
-
-void image_impl::unsampledImageConstructorNotification(
- const detail::code_location &CodeLoc, void *UserObj, const void *HostObj,
- uint32_t Dim, size_t Range[3], image_format Format) {
- XPTIRegistry::unsampledImageConstructorNotification(
- UserObj, CodeLoc, HostObj, Dim, Range, (uint32_t)Format);
-}
-
-void image_impl::unsampledImageDestructorNotification(void *UserObj) {
- XPTIRegistry::unsampledImageDestructorNotification(UserObj);
-}
-
void image_impl::verifyProps(const property_list &Props) const {
auto CheckDataLessProperties = [](int PropertyKind) {
#define __SYCL_DATA_LESS_PROP(NS_QUALIFIER, PROP_NAME, ENUM_VAL) \
diff --git a/sycl/source/detail/image_impl.hpp b/sycl/source/detail/image_impl.hpp
index 7b4c7508effaf..d8e2c9f5441fa 100644
--- a/sycl/source/detail/image_impl.hpp
+++ b/sycl/source/detail/image_impl.hpp
@@ -285,18 +285,6 @@ class image_impl final : public SYCLMemObjT {
}
}
- void sampledImageConstructorNotification(const detail::code_location &CodeLoc,
- void *UserObj, const void *HostObj,
- uint32_t Dim, size_t Range[3],
- image_format Format,
- const image_sampler &Sampler);
- void sampledImageDestructorNotification(void *UserObj);
-
- void unsampledImageConstructorNotification(
- const detail::code_location &CodeLoc, void *UserObj, const void *HostObj,
- uint32_t Dim, size_t Range[3], image_format Format);
- void unsampledImageDestructorNotification(void *UserObj);
-
private:
std::vector getDevices(const ContextImplPtr Context);
diff --git a/sycl/source/detail/memory_manager.cpp b/sycl/source/detail/memory_manager.cpp
index 3069595d2b6d8..ca92f2f4ce70d 100644
--- a/sycl/source/detail/memory_manager.cpp
+++ b/sycl/source/detail/memory_manager.cpp
@@ -14,7 +14,6 @@
#include
#include
#include
-#include
#include
#include
@@ -26,98 +25,10 @@
#include
#include
-#ifdef XPTI_ENABLE_INSTRUMENTATION
-#include
-#include
-#endif
-
namespace sycl {
inline namespace _V1 {
namespace detail {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
-uint8_t GMemAllocStreamID;
-xpti::trace_event_data_t *GMemAllocEvent;
-#endif
-
-uint64_t emitMemAllocBeginTrace(uintptr_t ObjHandle, size_t AllocSize,
- size_t GuardZone) {
- (void)ObjHandle;
- (void)AllocSize;
- (void)GuardZone;
- uint64_t CorrelationID = 0;
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- constexpr uint16_t NotificationTraceType =
- static_cast(xpti::trace_point_type_t::mem_alloc_begin);
- if (xptiCheckTraceEnabled(GMemAllocStreamID, NotificationTraceType)) {
- xpti::mem_alloc_data_t MemAlloc{ObjHandle, 0 /* alloc ptr */, AllocSize,
- GuardZone};
-
- CorrelationID = xptiGetUniqueId();
- xptiNotifySubscribers(GMemAllocStreamID, NotificationTraceType,
- GMemAllocEvent, nullptr, CorrelationID, &MemAlloc);
- }
-#endif
- return CorrelationID;
-}
-
-void emitMemAllocEndTrace(uintptr_t ObjHandle, uintptr_t AllocPtr,
- size_t AllocSize, size_t GuardZone,
- uint64_t CorrelationID) {
- (void)ObjHandle;
- (void)AllocPtr;
- (void)AllocSize;
- (void)GuardZone;
- (void)CorrelationID;
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- constexpr uint16_t NotificationTraceType =
- static_cast(xpti::trace_point_type_t::mem_alloc_end);
- if (xptiCheckTraceEnabled(GMemAllocStreamID, NotificationTraceType)) {
- xpti::mem_alloc_data_t MemAlloc{ObjHandle, AllocPtr, AllocSize, GuardZone};
-
- xptiNotifySubscribers(GMemAllocStreamID, NotificationTraceType,
- GMemAllocEvent, nullptr, CorrelationID, &MemAlloc);
- }
-#endif
-}
-
-uint64_t emitMemReleaseBeginTrace(uintptr_t ObjHandle, uintptr_t AllocPtr) {
- (void)ObjHandle;
- (void)AllocPtr;
- uint64_t CorrelationID = 0;
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- constexpr uint16_t NotificationTraceType =
- static_cast(xpti::trace_point_type_t::mem_release_begin);
- if (xptiCheckTraceEnabled(GMemAllocStreamID, NotificationTraceType)) {
- xpti::mem_alloc_data_t MemAlloc{ObjHandle, AllocPtr, 0 /* alloc size */,
- 0 /* guard zone */};
-
- CorrelationID = xptiGetUniqueId();
- xptiNotifySubscribers(GMemAllocStreamID, NotificationTraceType,
- GMemAllocEvent, nullptr, CorrelationID, &MemAlloc);
- }
-#endif
- return CorrelationID;
-}
-
-void emitMemReleaseEndTrace(uintptr_t ObjHandle, uintptr_t AllocPtr,
- uint64_t CorrelationID) {
- (void)ObjHandle;
- (void)AllocPtr;
- (void)CorrelationID;
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- constexpr uint16_t NotificationTraceType =
- static_cast(xpti::trace_point_type_t::mem_release_end);
- if (xptiCheckTraceEnabled(GMemAllocStreamID, NotificationTraceType)) {
- xpti::mem_alloc_data_t MemAlloc{ObjHandle, AllocPtr, 0 /* alloc size */,
- 0 /* guard zone */};
-
- xptiNotifySubscribers(GMemAllocStreamID, NotificationTraceType,
- GMemAllocEvent, nullptr, CorrelationID, &MemAlloc);
- }
-#endif
-}
-
static void waitForEvents(const std::vector &Events) {
// Assuming all events will be on the same device or
// devices associated with the same Backend.
@@ -137,65 +48,16 @@ void memBufferCreateHelper(const AdapterPtr &Adapter, ur_context_handle_t Ctx,
ur_mem_flags_t Flags, size_t Size,
ur_mem_handle_t *RetMem,
const ur_buffer_properties_t *Props) {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- uint64_t CorrID = 0;
-#endif
- // We only want to instrument urMemBufferCreate
- {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- CorrID =
- emitMemAllocBeginTrace(0 /* mem object */, Size, 0 /* guard zone */);
- xpti::utils::finally _{[&] {
- // C-style cast is required for MSVC
- uintptr_t MemObjID = (uintptr_t)(*RetMem);
- ur_native_handle_t Ptr = 0;
- // Always use call_nocheck here, because call may throw an exception,
- // and this lambda will be called from destructor, which in combination
- // rewards us with UB.
- // When doing buffer interop we don't know what device the memory should
- // be resident on, so pass nullptr for Device param. Buffer interop may
- // not be supported by all backends.
- Adapter->call_nocheck(
- *RetMem, /*Dev*/ nullptr, &Ptr);
- emitMemAllocEndTrace(MemObjID, (uintptr_t)(Ptr), Size, 0 /* guard zone */,
- CorrID);
- }};
-#endif
- if (Size)
- Adapter->call(Ctx, Flags, Size, Props,
- RetMem);
- }
+ if (Size)
+ Adapter->call(Ctx, Flags, Size, Props,
+ RetMem);
}
void memReleaseHelper(const AdapterPtr &Adapter, ur_mem_handle_t Mem) {
// FIXME urMemRelease does not guarante memory release. It is only true if
// reference counter is 1. However, SYCL runtime currently only calls
// urMemRetain only for OpenCL interop
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- uint64_t CorrID = 0;
- // C-style cast is required for MSVC
- uintptr_t MemObjID = (uintptr_t)(Mem);
- uintptr_t Ptr = 0;
- // Do not make unnecessary UR calls without instrumentation enabled
- if (xptiTraceEnabled()) {
- ur_native_handle_t PtrHandle = 0;
- // When doing buffer interop we don't know what device the memory should be
- // resident on, so pass nullptr for Device param. Buffer interop may not be
- // supported by all backends.
- Adapter->call_nocheck(Mem, /*Dev*/ nullptr,
- &PtrHandle);
- Ptr = (uintptr_t)(PtrHandle);
- }
-#endif
- // We only want to instrument urMemRelease
- {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- CorrID = emitMemReleaseBeginTrace(MemObjID, Ptr);
- xpti::utils::finally _{
- [&] { emitMemReleaseEndTrace(MemObjID, Ptr, CorrID); }};
-#endif
- Adapter->call(Mem);
- }
+ Adapter->call(Mem);
}
void memBufferMapHelper(const AdapterPtr &Adapter, ur_queue_handle_t Queue,
@@ -203,19 +65,8 @@ void memBufferMapHelper(const AdapterPtr &Adapter, ur_queue_handle_t Queue,
ur_map_flags_t Flags, size_t Offset, size_t Size,
uint32_t NumEvents, const ur_event_handle_t *WaitList,
ur_event_handle_t *Event, void **RetMap) {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- uint64_t CorrID = 0;
- uintptr_t MemObjID = (uintptr_t)(Buffer);
-#endif
// We only want to instrument urEnqueueMemBufferMap
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- CorrID = emitMemAllocBeginTrace(MemObjID, Size, 0 /* guard zone */);
- xpti::utils::finally _{[&] {
- emitMemAllocEndTrace(MemObjID, (uintptr_t)(*RetMap), Size,
- 0 /* guard zone */, CorrID);
- }};
-#endif
Adapter->call(
Queue, Buffer, Blocking, Flags, Offset, Size, NumEvents, WaitList, Event,
RetMap);
@@ -225,29 +76,9 @@ void memUnmapHelper(const AdapterPtr &Adapter, ur_queue_handle_t Queue,
ur_mem_handle_t Mem, void *MappedPtr, uint32_t NumEvents,
const ur_event_handle_t *WaitList,
ur_event_handle_t *Event) {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- uint64_t CorrID = 0;
- uintptr_t MemObjID = (uintptr_t)(Mem);
- uintptr_t Ptr = (uintptr_t)(MappedPtr);
-#endif
// We only want to instrument urEnqueueMemUnmap
- {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- CorrID = emitMemReleaseBeginTrace(MemObjID, Ptr);
- xpti::utils::finally _{[&] {
- // There's no way for SYCL to know, when the pointer is freed, so we have
- // to explicitly wait for the end of data transfers here in order to
- // report correct events.
- // Always use call_nocheck here, because call may throw an exception,
- // and this lambda will be called from destructor, which in combination
- // rewards us with UB.
- Adapter->call_nocheck(1, Event);
- emitMemReleaseEndTrace(MemObjID, Ptr, CorrID);
- }};
-#endif
- Adapter->call(Queue, Mem, MappedPtr,
- NumEvents, WaitList, Event);
- }
+ Adapter->call(Queue, Mem, MappedPtr, NumEvents,
+ WaitList, Event);
}
void MemoryManager::release(ContextImplPtr TargetContext, SYCLMemObjI *MemObj,
@@ -258,7 +89,6 @@ void MemoryManager::release(ContextImplPtr TargetContext, SYCLMemObjI *MemObj,
// dependency events and return empty event.
waitForEvents(DepEvents);
OutEvent = nullptr;
- XPTIRegistry::bufferReleaseNotification(MemObj, MemAllocation);
MemObj->releaseMem(TargetContext, MemAllocation);
}
@@ -409,7 +239,6 @@ void *MemoryManager::allocateMemBuffer(ContextImplPtr TargetContext,
else
MemPtr = allocateBufferObject(TargetContext, UserPtr, HostPtrReadOnly, Size,
PropsList);
- XPTIRegistry::bufferAssociateNotification(MemObj, MemPtr);
return MemPtr;
}
diff --git a/sycl/source/detail/queue_impl.cpp b/sycl/source/detail/queue_impl.cpp
index 88374d3289c20..984e8e82b7e10 100644
--- a/sycl/source/detail/queue_impl.cpp
+++ b/sycl/source/detail/queue_impl.cpp
@@ -17,12 +17,6 @@
#include
#include
-#ifdef XPTI_ENABLE_INSTRUMENTATION
-#include "xpti/xpti_trace_framework.hpp"
-#include
-#include
-#endif
-
namespace sycl {
inline namespace _V1 {
namespace detail {
@@ -150,29 +144,6 @@ event queue_impl::memset(const std::shared_ptr &Self,
void *Ptr, int Value, size_t Count,
const std::vector &DepEvents,
bool CallerNeedsEvent) {
-#if XPTI_ENABLE_INSTRUMENTATION
- // We need a code pointer value and we use the object ptr; if code location
- // information is available, we will have function name and source file
- // information
- XPTIScope PrepareNotify((void *)this,
- (uint16_t)xpti::trace_point_type_t::node_create,
- SYCL_STREAM_NAME, "memory_transfer_node::memset");
- PrepareNotify.addMetadata([&](auto TEvent) {
- xpti::addMetadata(TEvent, "sycl_device",
- reinterpret_cast(MDevice->getHandleRef()));
- xpti::addMetadata(TEvent, "memory_ptr", reinterpret_cast(Ptr));
- xpti::addMetadata(TEvent, "value_set", Value);
- xpti::addMetadata(TEvent, "memory_size", Count);
- xpti::addMetadata(TEvent, "queue_id", MQueueID);
- });
- // Before we notifiy the subscribers, we broadcast the 'queue_id', which was a
- // metadata entry to TLS for use by callback handlers
- xpti::framework::stash_tuple(XPTI_QUEUE_INSTANCE_ID_KEY, MQueueID);
- // Notify XPTI about the memset submission
- PrepareNotify.notify();
- // Emit a begin/end scope for this call
- PrepareNotify.scopedNotify((uint16_t)xpti::trace_point_type_t::task_begin);
-#endif
const std::vector Pattern{static_cast(Value)};
return submitMemOpHelper(
Self, DepEvents, CallerNeedsEvent,
@@ -198,28 +169,6 @@ event queue_impl::memcpy(const std::shared_ptr &Self,
void *Dest, const void *Src, size_t Count,
const std::vector &DepEvents,
bool CallerNeedsEvent, const code_location &CodeLoc) {
-#if XPTI_ENABLE_INSTRUMENTATION
- // We need a code pointer value and we duse the object ptr; If code location
- // is available, we use the source file information along with the object
- // pointer.
- XPTIScope PrepareNotify((void *)this,
- (uint16_t)xpti::trace_point_type_t::node_create,
- SYCL_STREAM_NAME, "memory_transfer_node::memcpy");
- PrepareNotify.addMetadata([&](auto TEvent) {
- xpti::addMetadata(TEvent, "sycl_device",
- reinterpret_cast(MDevice->getHandleRef()));
- xpti::addMetadata(TEvent, "src_memory_ptr", reinterpret_cast(Src));
- xpti::addMetadata(TEvent, "dest_memory_ptr",
- reinterpret_cast(Dest));
- xpti::addMetadata(TEvent, "memory_size", Count);
- xpti::addMetadata(TEvent, "queue_id", MQueueID);
- });
- xpti::framework::stash_tuple(XPTI_QUEUE_INSTANCE_ID_KEY, MQueueID);
- // Notify XPTI about the memcpy submission
- PrepareNotify.notify();
- // Emit a begin/end scope for this call
- PrepareNotify.scopedNotify((uint16_t)xpti::trace_point_type_t::task_begin);
-#endif
if ((!Src || !Dest) && Count != 0) {
report(CodeLoc);
@@ -498,91 +447,8 @@ event queue_impl::submitMemOpHelper(const std::shared_ptr &Self,
return submitWithHandler(Self, DepEvents, CallerNeedsEvent, HandlerFunc);
}
-void *queue_impl::instrumentationProlog(const detail::code_location &CodeLoc,
- std::string &Name, int32_t StreamID,
- uint64_t &IId) {
- void *TraceEvent = nullptr;
- (void)CodeLoc;
- (void)Name;
- (void)StreamID;
- (void)IId;
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- constexpr uint16_t NotificationTraceType = xpti::trace_wait_begin;
- if (!xptiCheckTraceEnabled(StreamID, NotificationTraceType))
- return TraceEvent;
-
- xpti::payload_t Payload;
- bool HasSourceInfo = false;
- // We try to create a unique string for the wait() call by combining it with
- // the queue address
- xpti::utils::StringHelper NG;
- Name = NG.nameWithAddress("queue.wait", this);
-
- if (CodeLoc.fileName()) {
- // We have source code location information
- Payload =
- xpti::payload_t(Name.c_str(), CodeLoc.fileName(), CodeLoc.lineNumber(),
- CodeLoc.columnNumber(), (void *)this);
- HasSourceInfo = true;
- } else {
- // We have no location information, so we'll use the address of the queue
- Payload = xpti::payload_t(Name.c_str(), (void *)this);
- }
- // wait() calls could be at different user-code locations; We create a new
- // event based on the code location info and if this has been seen before, a
- // previously created event will be returned.
- uint64_t QWaitInstanceNo = 0;
- xpti::trace_event_data_t *WaitEvent =
- xptiMakeEvent(Name.c_str(), &Payload, xpti::trace_graph_event,
- xpti_at::active, &QWaitInstanceNo);
- IId = QWaitInstanceNo;
- if (WaitEvent) {
- xpti::addMetadata(WaitEvent, "sycl_device_type", queueDeviceToString(this));
- if (HasSourceInfo) {
- xpti::addMetadata(WaitEvent, "sym_function_name", CodeLoc.functionName());
- xpti::addMetadata(WaitEvent, "sym_source_file_name", CodeLoc.fileName());
- xpti::addMetadata(WaitEvent, "sym_line_no",
- static_cast((CodeLoc.lineNumber())));
- xpti::addMetadata(WaitEvent, "sym_column_no",
- static_cast((CodeLoc.columnNumber())));
- }
- xptiNotifySubscribers(StreamID, xpti::trace_wait_begin, nullptr, WaitEvent,
- QWaitInstanceNo,
- static_cast(Name.c_str()));
- TraceEvent = (void *)WaitEvent;
- }
-#endif
- return TraceEvent;
-}
-
-void queue_impl::instrumentationEpilog(void *TelemetryEvent, std::string &Name,
- int32_t StreamID, uint64_t IId) {
- (void)TelemetryEvent;
- (void)Name;
- (void)StreamID;
- (void)IId;
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- constexpr uint16_t NotificationTraceType = xpti::trace_wait_end;
- if (!(xptiCheckTraceEnabled(StreamID, NotificationTraceType) &&
- TelemetryEvent))
- return;
- // Close the wait() scope
- xpti::trace_event_data_t *TraceEvent =
- (xpti::trace_event_data_t *)TelemetryEvent;
- xptiNotifySubscribers(StreamID, NotificationTraceType, nullptr, TraceEvent,
- IId, static_cast(Name.c_str()));
-#endif
-}
-
void queue_impl::wait(const detail::code_location &CodeLoc) {
(void)CodeLoc;
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- void *TelemetryEvent = nullptr;
- uint64_t IId;
- std::string Name;
- int32_t StreamID = xptiRegisterStream(SYCL_STREAM_NAME);
- TelemetryEvent = instrumentationProlog(CodeLoc, Name, StreamID, IId);
-#endif
if (MGraph.lock()) {
throw sycl::exception(make_error_code(errc::invalid),
@@ -658,68 +524,6 @@ void queue_impl::wait(const detail::code_location &CodeLoc) {
}
for (const EventImplPtr &Event : StreamsServiceEvents)
Event->wait(Event);
-
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- instrumentationEpilog(TelemetryEvent, Name, StreamID, IId);
-#endif
-}
-
-void queue_impl::constructorNotification() {
-#if XPTI_ENABLE_INSTRUMENTATION
- if (xptiTraceEnabled()) {
- MStreamID = xptiRegisterStream(SYCL_STREAM_NAME);
- constexpr uint16_t NotificationTraceType =
- static_cast(xpti::trace_point_type_t::queue_create);
- if (xptiCheckTraceEnabled(MStreamID, NotificationTraceType)) {
- xpti::utils::StringHelper SH;
- std::string AddrStr = SH.addressAsString(MQueueID);
- std::string QueueName = SH.nameWithAddressString("queue", AddrStr);
- // Create a payload for the queue create event as we do not get code
- // location for the queue create event
- xpti::payload_t QPayload(QueueName.c_str());
- MInstanceID = xptiGetUniqueId();
- uint64_t RetInstanceNo;
- xpti_td *TEvent =
- xptiMakeEvent("queue_create", &QPayload,
- (uint16_t)xpti::trace_event_type_t::algorithm,
- xpti_at::active, &RetInstanceNo);
- // Cache the trace event, stream id and instance IDs for the destructor
- MTraceEvent = (void *)TEvent;
-
- xpti::addMetadata(TEvent, "sycl_context",
- reinterpret_cast(MContext->getHandleRef()));
- if (MDevice) {
- xpti::addMetadata(TEvent, "sycl_device_name", MDevice->getDeviceName());
- xpti::addMetadata(TEvent, "sycl_device",
- reinterpret_cast(MDevice->getHandleRef()));
- }
- xpti::addMetadata(TEvent, "is_inorder", MIsInorder);
- xpti::addMetadata(TEvent, "queue_id", MQueueID);
- xpti::addMetadata(TEvent, "queue_handle",
- reinterpret_cast(getHandleRef()));
- // Also publish to TLS before notification
- xpti::framework::stash_tuple(XPTI_QUEUE_INSTANCE_ID_KEY, MQueueID);
- xptiNotifySubscribers(
- MStreamID, (uint16_t)xpti::trace_point_type_t::queue_create, nullptr,
- TEvent, MInstanceID, static_cast("queue_create"));
- }
- }
-#endif
-}
-
-void queue_impl::destructorNotification() {
-#if XPTI_ENABLE_INSTRUMENTATION
- constexpr uint16_t NotificationTraceType =
- static_cast(xpti::trace_point_type_t::queue_destroy);
- if (xptiCheckTraceEnabled(MStreamID, NotificationTraceType)) {
- // Use the cached trace event, stream id and instance IDs for the
- // destructor
- xptiNotifySubscribers(MStreamID, NotificationTraceType, nullptr,
- (xpti::trace_event_data_t *)MTraceEvent, MInstanceID,
- static_cast("queue_destroy"));
- xptiReleaseEvent((xpti::trace_event_data_t *)MTraceEvent);
- }
-#endif
}
ur_native_handle_t queue_impl::getNative(int32_t &NativeHandleDesc) const {
diff --git a/sycl/source/detail/queue_impl.hpp b/sycl/source/detail/queue_impl.hpp
index 0f99f49d1257d..50fb4261c25bf 100644
--- a/sycl/source/detail/queue_impl.hpp
+++ b/sycl/source/detail/queue_impl.hpp
@@ -36,11 +36,6 @@
#include
-#ifdef XPTI_ENABLE_INSTRUMENTATION
-#include "xpti/xpti_trace_framework.hpp"
-#include
-#endif
-
namespace sycl {
inline namespace _V1 {
@@ -167,17 +162,6 @@ class queue_impl {
const QueueOrder QOrder =
MIsInorder ? QueueOrder::Ordered : QueueOrder::OOO;
MQueues.push_back(createQueue(QOrder));
- // This section is the second part of the instrumentation that uses the
- // tracepoint information and notifies
-
- // We enable XPTI tracing events using the TLS mechanism; if the code
- // location data is available, then the tracing data will be rich.
-#if XPTI_ENABLE_INSTRUMENTATION
- // Emit a trace event for queue creation; we currently do not get code
- // location information, so all queueus will have the same UID with a
- // different instance ID until this gets added.
- constructorNotification();
-#endif
}
event getLastEvent();
@@ -204,16 +188,6 @@ class queue_impl {
make_error_code(errc::invalid),
"Device provided by native Queue not found in Context.");
}
- // The following commented section provides a guideline on how to use the
- // TLS enabled mechanism to create a tracepoint and notify using XPTI. This
- // is the prolog section and the epilog section will initiate the
- // notification.
-#if XPTI_ENABLE_INSTRUMENTATION
- // Emit a trace event for queue creation; we currently do not get code
- // location information, so all queueus will have the same UID with a
- // different instance ID until this gets added.
- constructorNotification();
-#endif
}
public:
@@ -257,12 +231,6 @@ class queue_impl {
~queue_impl() {
try {
-#if XPTI_ENABLE_INSTRUMENTATION
- // The trace event created in the constructor should be active through the
- // lifetime of the queue object as member variable. We will send a
- // notification and destroy the trace event for this queue.
- destructorNotification();
-#endif
throw_asynchronous();
getAdapter()->call(MQueues[0]);
} catch (std::exception &e) {
@@ -705,8 +673,6 @@ class queue_impl {
unsigned long long getQueueID() { return MQueueID; }
- void *getTraceEvent() { return MTraceEvent; }
-
void setExternalEvent(const event &Event) {
std::lock_guard Lock(MInOrderExternalEventMtx);
MInOrderExternalEvent = Event;
@@ -894,22 +860,6 @@ class queue_impl {
bool CallerNeedsEvent, HandlerFuncT HandlerFunc,
MemMngrFuncT MemMngrFunc, MemMngrArgTs... MemOpArgs);
- // When instrumentation is enabled emits trace event for wait begin and
- // returns the telemetry event generated for the wait
- void *instrumentationProlog(const detail::code_location &CodeLoc,
- std::string &Name, int32_t StreamID,
- uint64_t &iid);
- // Uses events generated by the Prolog and emits wait done event
- void instrumentationEpilog(void *TelementryEvent, std::string &Name,
- int32_t StreamID, uint64_t IId);
-
- // We need to emit a queue_create notification when a queue object is created
- void constructorNotification();
-
- // We need to emit a queue_destroy notification when a queue object is
- // destroyed
- void destructorNotification();
-
/// queue_impl.addEvent tracks events with weak pointers
/// but some events have no other owners. addSharedEvent()
/// follows events with a shared pointer.
@@ -970,16 +920,6 @@ class queue_impl {
std::vector MStreamsServiceEvents;
std::mutex MStreamsServiceEventsMutex;
- // All member variable defined here are needed for the SYCL instrumentation
- // layer. Do not guard these variables below with XPTI_ENABLE_INSTRUMENTATION
- // to ensure we have the same object layout when the macro in the library and
- // SYCL app are not the same.
- void *MTraceEvent = nullptr;
- /// The stream under which the traces are emitted from the queue object
- uint8_t MStreamID = 0;
- /// The instance ID of the trace event for queue object
- uint64_t MInstanceID = 0;
-
// the fallback implementation of profiling info
bool MFallbackProfiling = false;
diff --git a/sycl/source/detail/scheduler/commands.cpp b/sycl/source/detail/scheduler/commands.cpp
index ac00313e670de..b5fa26de49861 100644
--- a/sycl/source/detail/scheduler/commands.cpp
+++ b/sycl/source/detail/scheduler/commands.cpp
@@ -22,7 +22,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -44,11 +43,6 @@
#endif
#endif
-#ifdef XPTI_ENABLE_INSTRUMENTATION
-#include "xpti/xpti_trace_framework.hpp"
-#include
-#endif
-
namespace sycl {
inline namespace _V1 {
namespace detail {
@@ -77,49 +71,6 @@ ur_result_t callMemOpHelperRet(MemOpRet &MemOpResult, MemOpFuncT &MemOpFunc,
return UR_RESULT_SUCCESS;
}
-#ifdef XPTI_ENABLE_INSTRUMENTATION
-// Global graph for the application
-extern xpti::trace_event_data_t *GSYCLGraphEvent;
-
-static bool CurrentCodeLocationValid() {
- detail::tls_code_loc_t Tls;
- auto CodeLoc = Tls.query();
- auto FileName = CodeLoc.fileName();
- auto FunctionName = CodeLoc.functionName();
- return (FileName && FileName[0] != '\0') ||
- (FunctionName && FunctionName[0] != '\0');
-}
-
-void emitInstrumentationGeneral(uint32_t StreamID, uint64_t InstanceID,
- xpti_td *TraceEvent, uint16_t Type,
- const void *Addr) {
- if (!(xptiCheckTraceEnabled(StreamID, Type) && TraceEvent))
- return;
- // Trace event notifier that emits a Type event
- xptiNotifySubscribers(StreamID, Type, detail::GSYCLGraphEvent,
- static_cast(TraceEvent), InstanceID, Addr);
-}
-
-static size_t deviceToID(const device &Device) {
- return reinterpret_cast(getSyclObjImpl(Device)->getHandleRef());
-}
-
-static void addDeviceMetadata(xpti_td *TraceEvent, const QueueImplPtr &Queue) {
- xpti::addMetadata(TraceEvent, "sycl_device_type",
- queueDeviceToString(Queue.get()));
- if (Queue) {
- xpti::addMetadata(TraceEvent, "sycl_device",
- deviceToID(Queue->get_device()));
- xpti::addMetadata(TraceEvent, "sycl_device_name",
- getSyclObjImpl(Queue->get_device())->getDeviceName());
- }
-}
-
-static unsigned long long getQueueID(const QueueImplPtr &Queue) {
- return Queue ? Queue->getQueueID() : 0;
-}
-#endif
-
static ContextImplPtr getContext(const QueueImplPtr &Queue) {
if (Queue)
return Queue->getContextImplPtr();
@@ -196,63 +147,6 @@ static std::string accessModeToString(access::mode Mode) {
}
}
-#ifdef XPTI_ENABLE_INSTRUMENTATION
-// Using the command group type to create node types for the asynchronous task
-// graph modeling
-static std::string commandToNodeType(Command::CommandType Type) {
- switch (Type) {
- case Command::CommandType::RUN_CG:
- return "command_group_node";
- case Command::CommandType::COPY_MEMORY:
- return "memory_transfer_node";
- case Command::CommandType::ALLOCA:
- return "memory_allocation_node";
- case Command::CommandType::ALLOCA_SUB_BUF:
- return "sub_buffer_creation_node";
- case Command::CommandType::RELEASE:
- return "memory_deallocation_node";
- case Command::CommandType::MAP_MEM_OBJ:
- return "memory_transfer_node";
- case Command::CommandType::UNMAP_MEM_OBJ:
- return "memory_transfer_node";
- case Command::CommandType::UPDATE_REQUIREMENT:
- return "host_acc_create_buffer_lock_node";
- case Command::CommandType::EMPTY_TASK:
- return "host_acc_destroy_buffer_release_node";
- default:
- return "unknown_node";
- }
-}
-
-// Using the names being generated and the string are subject to change to
-// something more meaningful to end-users as this will be visible in analysis
-// tools that subscribe to this data
-static std::string commandToName(Command::CommandType Type) {
- switch (Type) {
- case Command::CommandType::RUN_CG:
- return "Command Group Action";
- case Command::CommandType::COPY_MEMORY:
- return "Memory Transfer (Copy)";
- case Command::CommandType::ALLOCA:
- return "Memory Allocation";
- case Command::CommandType::ALLOCA_SUB_BUF:
- return "Sub Buffer Creation";
- case Command::CommandType::RELEASE:
- return "Memory Deallocation";
- case Command::CommandType::MAP_MEM_OBJ:
- return "Memory Transfer (Map)";
- case Command::CommandType::UNMAP_MEM_OBJ:
- return "Memory Transfer (Unmap)";
- case Command::CommandType::UPDATE_REQUIREMENT:
- return "Host Accessor Creation/Buffer Lock";
- case Command::CommandType::EMPTY_TASK:
- return "Host Accessor Destruction/Buffer Lock Release";
- default:
- return "Unknown Action";
- }
-}
-#endif
-
std::vector
Command::getUrEvents(const std::vector &EventImpls,
const QueueImplPtr &CommandQueue, bool IsHostTaskCommand) {
@@ -423,18 +317,6 @@ class DispatchHostTask {
CGHostTask &HostTask = static_cast(MThisCmd->getCG());
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- // Host task is executed async and in a separate thread that do not allow to
- // use code location data stored in TLS. So we keep submission code location
- // as Command field and put it here to TLS so that thrown exception could
- // query and report it.
- std::unique_ptr AsyncCodeLocationPtr;
- if (xptiTraceEnabled() && !CurrentCodeLocationValid()) {
- AsyncCodeLocationPtr.reset(
- new detail::tls_code_loc_t(MThisCmd->MSubmissionCodeLocation));
- }
-#endif
-
if (!waitForEvents()) {
std::exception_ptr EPtr = std::make_exception_ptr(sycl::exception(
make_error_code(errc::runtime),
@@ -485,35 +367,12 @@ class DispatchHostTask {
HostTask.MHostTask->call(MThisCmd->MEvent->getHostProfilingInfo());
} catch (...) {
auto CurrentException = std::current_exception();
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- // sycl::exception emit tracing of message with code location if
- // available. For other types of exception we need to explicitly trigger
- // tracing by calling TraceEventXPTI.
- if (xptiTraceEnabled()) {
- try {
- rethrow_exception(CurrentException);
- } catch (const sycl::exception &) {
- // it is already traced, nothing to care about
- } catch (const std::exception &StdException) {
- GlobalHandler::instance().TraceEventXPTI(StdException.what());
- } catch (...) {
- GlobalHandler::instance().TraceEventXPTI(
- "Host task lambda thrown non standard exception");
- }
- }
-#endif
MThisCmd->MEvent->getSubmittedQueue()->reportAsyncException(
CurrentException);
}
HostTask.MHostTask.reset();
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- // Host Task is done, clear its submittion location to not interfere with
- // following dependent kernels submission.
- AsyncCodeLocationPtr.reset();
-#endif
-
try {
// If we enqueue blocked users - ur level could throw exception that
// should be treated as async now.
@@ -605,184 +464,6 @@ Command::Command(
MEvent->setContextImpl(MQueue->getContextImplPtr());
MEvent->setStateIncomplete();
MEnqueueStatus = EnqueueResultT::SyclEnqueueReady;
-
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- if (!xptiTraceEnabled())
- return;
- // Obtain the stream ID so all commands can emit traces to that stream
- MStreamID = xptiRegisterStream(SYCL_STREAM_NAME);
-#endif
-}
-
-void Command::emitInstrumentationDataProxy() {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- emitInstrumentationData();
-#endif
-}
-
-/// Method takes in void * for the address as adding a template function to
-/// the command group object maybe undesirable.
-/// @param Cmd The command object of the source of the edge
-/// @param ObjAddr The address that defines the edge dependency; it is the
-/// event address when the edge is for an event and a memory object address if
-/// it is due to an accessor
-/// @param Prefix Contains "event" if the dependency is an edge and contains
-/// the access mode to the buffer if it is due to an accessor
-/// @param IsCommand True if the dependency has a command object as the
-/// source, false otherwise
-void Command::emitEdgeEventForCommandDependence(
- Command *Cmd, void *ObjAddr, bool IsCommand,
- std::optional AccMode) {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- // Bail early if either the source or the target node for the given
- // dependency is undefined or NULL
- constexpr uint16_t NotificationTraceType = xpti::trace_edge_create;
- if (!(xptiCheckTraceEnabled(MStreamID, NotificationTraceType) &&
- MTraceEvent && Cmd && Cmd->MTraceEvent))
- return;
-
- // If all the information we need for creating an edge event is available,
- // then go ahead with creating it; if not, bail early!
- xpti::utils::StringHelper SH;
- std::string AddressStr = SH.addressAsString(ObjAddr);
- std::string Prefix = AccMode ? accessModeToString(AccMode.value()) : "Event";
- std::string TypeString = SH.nameWithAddressString(Prefix, AddressStr);
- // Create an edge with the dependent buffer address for which a command
- // object has been created as one of the properties of the edge
- xpti::payload_t Payload(TypeString.c_str(), MAddress);
- uint64_t EdgeInstanceNo;
- xpti_td *EdgeEvent =
- xptiMakeEvent(TypeString.c_str(), &Payload, xpti::trace_graph_event,
- xpti_at::active, &EdgeInstanceNo);
- if (EdgeEvent) {
- xpti_td *SrcEvent = static_cast(Cmd->MTraceEvent);
- xpti_td *TgtEvent = static_cast(MTraceEvent);
- EdgeEvent->source_id = SrcEvent->unique_id;
- EdgeEvent->target_id = TgtEvent->unique_id;
- if (IsCommand) {
- xpti::addMetadata(EdgeEvent, "access_mode",
- static_cast(AccMode.value()));
- xpti::addMetadata(EdgeEvent, "memory_object",
- reinterpret_cast(ObjAddr));
- } else {
- xpti::addMetadata(EdgeEvent, "event", reinterpret_cast(ObjAddr));
- }
- xptiNotifySubscribers(MStreamID, NotificationTraceType,
- detail::GSYCLGraphEvent, EdgeEvent, EdgeInstanceNo,
- nullptr);
- }
- // General comment - None of these are serious errors as the instrumentation
- // layer MUST be tolerant of errors. If we need to let the end user know, we
- // throw exceptions in the future
-#endif
-}
-
-/// Creates an edge when the dependency is due to an event.
-/// @param Cmd The command object of the source of the edge
-/// @param UrEventAddr The address that defines the edge dependency, which in
-/// this case is an event
-void Command::emitEdgeEventForEventDependence(Command *Cmd,
- ur_event_handle_t &UrEventAddr) {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- // If we have failed to create an event to represent the Command, then we
- // cannot emit an edge event. Bail early!
- if (!(xptiCheckTraceEnabled(MStreamID) && MTraceEvent))
- return;
-
- if (Cmd && Cmd->MTraceEvent) {
- // If the event is associated with a command, we use this command's trace
- // event as the source of edge, hence modeling the control flow
- emitEdgeEventForCommandDependence(Cmd, (void *)UrEventAddr, false);
- return;
- }
- if (UrEventAddr) {
- xpti::utils::StringHelper SH;
- std::string AddressStr = SH.addressAsString(UrEventAddr);
- // This is the case when it is a OCL event enqueued by the user or another
- // event is registered by the runtime as a dependency The dependency on
- // this occasion is an OCL event; so we build a virtual node in the graph
- // with the event as the metadata for the node
- std::string NodeName = SH.nameWithAddressString("virtual_node", AddressStr);
-
- // Node name is "virtual_node[]"
- xpti::payload_t VNPayload(NodeName.c_str(), MAddress);
- uint64_t VNodeInstanceNo;
- xpti_td *NodeEvent =
- xptiMakeEvent(NodeName.c_str(), &VNPayload, xpti::trace_graph_event,
- xpti_at::active, &VNodeInstanceNo);
- // Emit the virtual node first
- xpti::addMetadata(NodeEvent, "kernel_name", NodeName);
- xptiNotifySubscribers(MStreamID, xpti::trace_node_create,
- detail::GSYCLGraphEvent, NodeEvent, VNodeInstanceNo,
- nullptr);
- // Create a new event for the edge
- std::string EdgeName = SH.nameWithAddressString("Event", AddressStr);
- xpti::payload_t EdgePayload(EdgeName.c_str(), MAddress);
- uint64_t EdgeInstanceNo;
- xpti_td *EdgeEvent =
- xptiMakeEvent(EdgeName.c_str(), &EdgePayload, xpti::trace_graph_event,
- xpti_at::active, &EdgeInstanceNo);
- if (EdgeEvent && NodeEvent) {
- // Source node represents the event and this event needs to be completed
- // before target node can execute
- xpti_td *TgtEvent = static_cast(MTraceEvent);
- EdgeEvent->source_id = NodeEvent->unique_id;
- EdgeEvent->target_id = TgtEvent->unique_id;
- xpti::addMetadata(EdgeEvent, "event",
- reinterpret_cast(UrEventAddr));
- xptiNotifySubscribers(MStreamID, xpti::trace_edge_create,
- detail::GSYCLGraphEvent, EdgeEvent, EdgeInstanceNo,
- nullptr);
- }
- return;
- }
-#endif
-}
-
-uint64_t Command::makeTraceEventProlog(void *MAddress) {
- uint64_t CommandInstanceNo = 0;
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- if (!xptiCheckTraceEnabled(MStreamID))
- return CommandInstanceNo;
-
- MTraceEventPrologComplete = true;
- // Setup the member variables with information needed for event notification
- MCommandNodeType = commandToNodeType(MType);
- MCommandName = commandToName(MType);
- xpti::utils::StringHelper SH;
- MAddressString = SH.addressAsString(MAddress);
- std::string CommandString =
- SH.nameWithAddressString(MCommandName, MAddressString);
-
- xpti::payload_t p(CommandString.c_str(), MAddress);
- xpti_td *CmdTraceEvent =
- xptiMakeEvent(CommandString.c_str(), &p, xpti::trace_graph_event,
- xpti_at::active, &CommandInstanceNo);
- MInstanceID = CommandInstanceNo;
- if (CmdTraceEvent) {
- MTraceEvent = (void *)CmdTraceEvent;
- // If we are seeing this event again, then the instance ID will be greater
- // than 1; in the previous implementation, we would skip sending a
- // notifications for subsequent instances. With the new implementation, we
- // will send a notification for each instance as this allows for mutable
- // metadata entries for multiple visits to the same code location and
- // maintaining data integrity.
- }
-#endif
- return CommandInstanceNo;
-}
-
-void Command::makeTraceEventEpilog() {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- constexpr uint16_t NotificationTraceType = xpti::trace_node_create;
- if (!(xptiCheckTraceEnabled(MStreamID, NotificationTraceType) && MTraceEvent))
- return;
- assert(MTraceEventPrologComplete);
- xptiNotifySubscribers(MStreamID, NotificationTraceType,
- detail::GSYCLGraphEvent,
- static_cast(MTraceEvent), MInstanceID,
- static_cast(MCommandNodeType.c_str()));
-#endif
}
Command *Command::processDepEvent(EventImplPtr DepEvent, const DepDesc &Dep,
@@ -849,62 +530,17 @@ Command *Command::addDep(DepDesc NewDep, std::vector &ToCleanUp) {
NewDep.MDepCommand->addUser(this);
}
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- emitEdgeEventForCommandDependence(NewDep.MDepCommand,
- (void *)NewDep.MDepRequirement->MSYCLMemObj,
- true, NewDep.MDepRequirement->MAccessMode);
-#endif
-
return ConnectionCmd;
}
Command *Command::addDep(EventImplPtr Event,
std::vector &ToCleanUp) {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- // We need this for just the instrumentation, so guarding it will prevent
- // unused variable warnings when instrumentation is turned off
- Command *Cmd = (Command *)Event->getCommand();
- ur_event_handle_t UrEventAddr = Event->getHandle();
- // Now make an edge for the dependent event
- emitEdgeEventForEventDependence(Cmd, UrEventAddr);
-#endif
-
return processDepEvent(std::move(Event), DepDesc{nullptr, nullptr, nullptr},
ToCleanUp);
}
-void Command::emitEnqueuedEventSignal(const ur_event_handle_t UrEventAddr) {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- emitInstrumentationGeneral(
- MStreamID, MInstanceID, static_cast(MTraceEvent),
- xpti::trace_signal, static_cast(UrEventAddr));
-#endif
- std::ignore = UrEventAddr;
-}
-
-void Command::emitInstrumentation(uint16_t Type, const char *Txt) {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- return emitInstrumentationGeneral(MStreamID, MInstanceID,
- static_cast(MTraceEvent), Type,
- static_cast(Txt));
-#else
- std::ignore = Type;
- std::ignore = Txt;
-#endif
-}
-
bool Command::enqueue(EnqueueResultT &EnqueueResult, BlockingT Blocking,
std::vector &ToCleanUp) {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- // If command is enqueued from host task thread - it will not have valid
- // submission code location set. So we set it manually to properly trace
- // failures if ur level report any.
- std::unique_ptr AsyncCodeLocationPtr;
- if (xptiTraceEnabled() && !CurrentCodeLocationValid()) {
- AsyncCodeLocationPtr.reset(
- new detail::tls_code_loc_t(MSubmissionCodeLocation));
- }
-#endif
// Exit if already enqueued
if (MEnqueueStatus == EnqueueResultT::SyclEnqueueSuccess)
return true;
@@ -917,21 +553,9 @@ bool Command::enqueue(EnqueueResultT &EnqueueResult, BlockingT Blocking,
return false;
}
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- // Scoped trace event notifier that emits a barrier begin and barrier end
- // event, which models the barrier while enqueuing along with the blocked
- // reason, as determined by the scheduler
- std::string Info = "enqueue.barrier[";
- Info += std::string(getBlockReason()) + "]";
- emitInstrumentation(xpti::trace_barrier_begin, Info.c_str());
-#endif
-
// Wait if blocking
while (MEnqueueStatus == EnqueueResultT::SyclEnqueueBlocked)
;
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- emitInstrumentation(xpti::trace_barrier_end, Info.c_str());
-#endif
}
std::lock_guard Lock(MEnqueueMtx);
@@ -940,10 +564,6 @@ bool Command::enqueue(EnqueueResultT &EnqueueResult, BlockingT Blocking,
if (MEnqueueStatus == EnqueueResultT::SyclEnqueueSuccess)
return true;
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- emitInstrumentation(xpti::trace_task_begin, nullptr);
-#endif
-
if (MEnqueueStatus == EnqueueResultT::SyclEnqueueFailed) {
EnqueueResult = EnqueueResultT(EnqueueResultT::SyclEnqueueFailed, this);
return false;
@@ -977,56 +597,9 @@ bool Command::enqueue(EnqueueResultT &EnqueueResult, BlockingT Blocking,
}
}
- // Emit this correlation signal before the task end
- emitEnqueuedEventSignal(MEvent->getHandle());
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- emitInstrumentation(xpti::trace_task_end, nullptr);
-#endif
return MEnqueueStatus == EnqueueResultT::SyclEnqueueSuccess;
}
-void Command::resolveReleaseDependencies(std::set &DepList) {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- assert(MType == CommandType::RELEASE && "Expected release command");
- if (!MTraceEvent)
- return;
- // The current command is the target node for all dependencies as the source
- // nodes have to be completed first before the current node can begin to
- // execute; these edges model control flow
- xpti_td *TgtTraceEvent = static_cast(MTraceEvent);
- // We have all the Commands that must be completed before the release
- // command can be enqueued; here we'll find the command that is an Alloca
- // with the same SYCLMemObject address and create a dependency line (edge)
- // between them in our sematic modeling
- for (auto &Item : DepList) {
- if (Item->MTraceEvent && Item->MAddress == MAddress) {
- xpti::utils::StringHelper SH;
- std::string AddressStr = SH.addressAsString(MAddress);
- std::string TypeString =
- "Edge:" + SH.nameWithAddressString(commandToName(MType), AddressStr);
-
- // Create an edge with the dependent buffer address being one of the
- // properties of the edge
- xpti::payload_t p(TypeString.c_str(), MAddress);
- uint64_t EdgeInstanceNo;
- xpti_td *EdgeEvent =
- xptiMakeEvent(TypeString.c_str(), &p, xpti::trace_graph_event,
- xpti_at::active, &EdgeInstanceNo);
- if (EdgeEvent) {
- xpti_td *SrcTraceEvent = static_cast(Item->MTraceEvent);
- EdgeEvent->target_id = TgtTraceEvent->unique_id;
- EdgeEvent->source_id = SrcTraceEvent->unique_id;
- xpti::addMetadata(EdgeEvent, "memory_object",
- reinterpret_cast(MAddress));
- xptiNotifySubscribers(MStreamID, xpti::trace_edge_create,
- detail::GSYCLGraphEvent, EdgeEvent,
- EdgeInstanceNo, nullptr);
- }
- }
- }
-#endif
-}
-
const char *Command::getBlockReason() const {
switch (MBlockReason) {
case BlockReason::HostAccessor:
@@ -1038,24 +611,6 @@ const char *Command::getBlockReason() const {
}
}
-void Command::copySubmissionCodeLocation() {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- if (!xptiTraceEnabled())
- return;
-
- detail::tls_code_loc_t Tls;
- auto TData = Tls.query();
- if (TData.fileName())
- MSubmissionFileName = TData.fileName();
- if (TData.functionName())
- MSubmissionFunctionName = TData.functionName();
- if (MSubmissionFileName.size() || MSubmissionFunctionName.size())
- MSubmissionCodeLocation = {
- MSubmissionFileName.c_str(), MSubmissionFunctionName.c_str(),
- (int)TData.lineNumber(), (int)TData.columnNumber()};
-#endif
-}
-
AllocaCommandBase::AllocaCommandBase(CommandType Type, QueueImplPtr Queue,
Requirement Req,
AllocaCommandBase *LinkedAllocaCmd,
@@ -1064,33 +619,6 @@ AllocaCommandBase::AllocaCommandBase(CommandType Type, QueueImplPtr Queue,
MIsLeaderAlloca(nullptr == LinkedAllocaCmd), MIsConst(IsConst),
MRequirement(std::move(Req)), MReleaseCmd(Queue, this) {
MRequirement.MAccessMode = access::mode::read_write;
- emitInstrumentationDataProxy();
-}
-
-void AllocaCommandBase::emitInstrumentationData() {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- if (!xptiCheckTraceEnabled(MStreamID))
- return;
- // Create a payload with the command name and an event using this payload to
- // emit a node_create
- MAddress = MRequirement.MSYCLMemObj;
- makeTraceEventProlog(MAddress);
- // Set the relevant meta data properties for this command; in the 64-bit key
- // based implementation, we would notify the graph events only for the first
- // instance as the trace event structure was invariant across all instances.
- // Due to mutable metadata requirements, we now create and notify them for all
- // instances. In addition to this, we have moved to 128-bit keys in the XPTI
- // internal infrastructure to guarantee collision free universal IDs.
- if (MTraceEvent) {
- xpti_td *TE = static_cast(MTraceEvent);
- addDeviceMetadata(TE, MQueue);
- xpti::addMetadata(TE, "memory_object", reinterpret_cast(MAddress));
- // Since we do NOT add queue_id value to metadata, we are stashing it to TLS
- // as this data is mutable and the metadata is supposed to be invariant
- xpti::framework::stash_tuple(XPTI_QUEUE_INSTANCE_ID_KEY,
- getQueueID(MQueue));
- }
-#endif
}
bool AllocaCommandBase::producesPiEvent() const { return false; }
@@ -1105,9 +633,6 @@ AllocaCommand::AllocaCommand(QueueImplPtr Queue, Requirement Req,
: AllocaCommandBase(CommandType::ALLOCA, std::move(Queue), std::move(Req),
LinkedAllocaCmd, IsConst),
MInitFromUserData(InitFromUserData) {
- // Node event must be created before the dependent edge is added to this
- // node, so this call must be before the addDep() call.
- emitInstrumentationDataProxy();
// "Nothing to depend on"
std::vector ToCleanUp;
Command *ConnectionCmd =
@@ -1117,15 +642,6 @@ AllocaCommand::AllocaCommand(QueueImplPtr Queue, Requirement Req,
(void)ConnectionCmd;
}
-void AllocaCommand::emitInstrumentationData() {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- if (!xptiCheckTraceEnabled(MStreamID))
- return;
-
- makeTraceEventEpilog();
-#endif
-}
-
ur_result_t AllocaCommand::enqueueImp() {
waitForPreparedHostEvents();
std::vector EventImpls = MPreparedDepsEvents;
@@ -1157,6 +673,20 @@ ur_result_t AllocaCommand::enqueueImp() {
return UR_RESULT_SUCCESS;
}
+static std::string queueDeviceToString(const queue_impl *const &Queue) {
+ if (!Queue)
+ return "HOST";
+ auto Device = Queue->get_device();
+ if (Device.is_cpu())
+ return "CPU";
+ else if (Device.is_gpu())
+ return "GPU";
+ else if (Device.is_accelerator())
+ return "ACCELERATOR";
+ else
+ return "UNKNOWN";
+}
+
void AllocaCommand::printDot(std::ostream &Stream) const {
Stream << "\"" << this << "\" [style=filled, fillcolor=\"#FFD28A\", label=\"";
@@ -1185,31 +715,12 @@ AllocaSubBufCommand::AllocaSubBufCommand(QueueImplPtr Queue, Requirement Req,
std::move(Req),
/*LinkedAllocaCmd*/ nullptr, /*IsConst*/ false),
MParentAlloca(ParentAlloca) {
- // Node event must be created before the dependent edge
- // is added to this node, so this call must be before
- // the addDep() call.
- emitInstrumentationDataProxy();
Command *ConnectionCmd = addDep(
DepDesc(MParentAlloca, getRequirement(), MParentAlloca), ToCleanUp);
if (ConnectionCmd)
ToEnqueue.push_back(ConnectionCmd);
}
-void AllocaSubBufCommand::emitInstrumentationData() {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- if (!xptiCheckTraceEnabled(MStreamID))
- return;
-
- xpti_td *TE = static_cast(MTraceEvent);
- xpti::addMetadata(TE, "offset", this->MRequirement.MOffsetInBytes);
- xpti::addMetadata(TE, "access_range_start",
- this->MRequirement.MAccessRange[0]);
- xpti::addMetadata(TE, "access_range_end", this->MRequirement.MAccessRange[1]);
- xpti::framework::stash_tuple(XPTI_QUEUE_INSTANCE_ID_KEY, getQueueID(MQueue));
- makeTraceEventEpilog();
-#endif
-}
-
void *AllocaSubBufCommand::getMemAllocation() const {
// In some cases parent`s memory allocation might change (e.g., after
// map/unmap operations). If parent`s memory allocation changes, sub-buffer
@@ -1237,8 +748,6 @@ ur_result_t AllocaSubBufCommand::enqueueImp() {
MEvent->setHandle(UREvent);
- XPTIRegistry::bufferAssociateNotification(MParentAlloca->getSYCLMemObj(),
- MMemAllocation);
return UR_RESULT_SUCCESS;
}
@@ -1264,29 +773,7 @@ void AllocaSubBufCommand::printDot(std::ostream &Stream) const {
}
ReleaseCommand::ReleaseCommand(QueueImplPtr Queue, AllocaCommandBase *AllocaCmd)
- : Command(CommandType::RELEASE, std::move(Queue)), MAllocaCmd(AllocaCmd) {
- emitInstrumentationDataProxy();
-}
-
-void ReleaseCommand::emitInstrumentationData() {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- if (!xptiCheckTraceEnabled(MStreamID))
- return;
- // Create a payload with the command name and an event using this payload to
- // emit a node_create
- MAddress = MAllocaCmd->getSYCLMemObj();
- makeTraceEventProlog(MAddress);
-
- xpti_td *TE = static_cast(MTraceEvent);
- addDeviceMetadata(TE, MQueue);
- xpti::addMetadata(TE, "allocation_type",
- commandToName(MAllocaCmd->getType()));
- // Since we do NOT add queue_id value to metadata, we are stashing it to TLS
- // as this data is mutable and the metadata is supposed to be invariant
- xpti::framework::stash_tuple(XPTI_QUEUE_INSTANCE_ID_KEY, getQueueID(MQueue));
- makeTraceEventEpilog();
-#endif
-}
+ : Command(CommandType::RELEASE, std::move(Queue)), MAllocaCmd(AllocaCmd) {}
ur_result_t ReleaseCommand::enqueueImp() {
waitForPreparedHostEvents();
@@ -1389,28 +876,7 @@ MapMemObject::MapMemObject(AllocaCommandBase *SrcAllocaCmd, Requirement Req,
access::mode MapMode)
: Command(CommandType::MAP_MEM_OBJ, std::move(Queue)),
MSrcAllocaCmd(SrcAllocaCmd), MSrcReq(std::move(Req)), MDstPtr(DstPtr),
- MMapMode(MapMode) {
- emitInstrumentationDataProxy();
-}
-
-void MapMemObject::emitInstrumentationData() {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- if (!xptiCheckTraceEnabled(MStreamID))
- return;
- // Create a payload with the command name and an event using this payload to
- // emit a node_create
- MAddress = MSrcAllocaCmd->getSYCLMemObj();
- makeTraceEventProlog(MAddress);
-
- xpti_td *TE = static_cast(MTraceEvent);
- addDeviceMetadata(TE, MQueue);
- xpti::addMetadata(TE, "memory_object", reinterpret_cast(MAddress));
- // Since we do NOT add queue_id value to metadata, we are stashing it to TLS
- // as this data is mutable and the metadata is supposed to be invariant
- xpti::framework::stash_tuple(XPTI_QUEUE_INSTANCE_ID_KEY, getQueueID(MQueue));
- makeTraceEventEpilog();
-#endif
-}
+ MMapMode(MapMode) {}
ur_result_t MapMemObject::enqueueImp() {
waitForPreparedHostEvents();
@@ -1451,28 +917,7 @@ void MapMemObject::printDot(std::ostream &Stream) const {
UnMapMemObject::UnMapMemObject(AllocaCommandBase *DstAllocaCmd, Requirement Req,
void **SrcPtr, QueueImplPtr Queue)
: Command(CommandType::UNMAP_MEM_OBJ, std::move(Queue)),
- MDstAllocaCmd(DstAllocaCmd), MDstReq(std::move(Req)), MSrcPtr(SrcPtr) {
- emitInstrumentationDataProxy();
-}
-
-void UnMapMemObject::emitInstrumentationData() {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- if (!xptiCheckTraceEnabled(MStreamID))
- return;
- // Create a payload with the command name and an event using this payload to
- // emit a node_create
- MAddress = MDstAllocaCmd->getSYCLMemObj();
- makeTraceEventProlog(MAddress);
-
- xpti_td *TE = static_cast(MTraceEvent);
- addDeviceMetadata(TE, MQueue);
- xpti::addMetadata(TE, "memory_object", reinterpret_cast(MAddress));
- // Since we do NOT add queue_id value to metadata, we are stashing it to TLS
- // as this data is mutable and the metadata is supposed to be invariant
- xpti::framework::stash_tuple(XPTI_QUEUE_INSTANCE_ID_KEY, getQueueID(MQueue));
- makeTraceEventEpilog();
-#endif
-}
+ MDstAllocaCmd(DstAllocaCmd), MDstReq(std::move(Req)), MSrcPtr(SrcPtr) {}
bool UnMapMemObject::producesPiEvent() const {
// TODO remove this workaround once the batching issue is addressed in Level
@@ -1546,32 +991,6 @@ MemCpyCommand::MemCpyCommand(Requirement SrcReq,
MWorkerQueue = !MQueue ? MSrcQueue : MQueue;
MEvent->setWorkerQueue(MWorkerQueue);
-
- emitInstrumentationDataProxy();
-}
-
-void MemCpyCommand::emitInstrumentationData() {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- if (!xptiCheckTraceEnabled(MStreamID))
- return;
- // Create a payload with the command name and an event using this payload to
- // emit a node_create
- MAddress = MSrcAllocaCmd->getSYCLMemObj();
- makeTraceEventProlog(MAddress);
-
- xpti_td *CmdTraceEvent = static_cast(MTraceEvent);
- addDeviceMetadata(CmdTraceEvent, MQueue);
- xpti::addMetadata(CmdTraceEvent, "memory_object",
- reinterpret_cast(MAddress));
- xpti::addMetadata(CmdTraceEvent, "copy_from",
- MSrcQueue ? deviceToID(MSrcQueue->get_device()) : 0);
- xpti::addMetadata(CmdTraceEvent, "copy_to",
- MQueue ? deviceToID(MQueue->get_device()) : 0);
- // Since we do NOT add queue_id value to metadata, we are stashing it to TLS
- // as this data is mutable and the metadata is supposed to be invariant
- xpti::framework::stash_tuple(XPTI_QUEUE_INSTANCE_ID_KEY, getQueueID(MQueue));
- makeTraceEventEpilog();
-#endif
}
ContextImplPtr MemCpyCommand::getWorkerContext() const {
@@ -1720,32 +1139,6 @@ MemCpyCommandHost::MemCpyCommandHost(Requirement SrcReq,
MWorkerQueue = !MQueue ? MSrcQueue : MQueue;
MEvent->setWorkerQueue(MWorkerQueue);
-
- emitInstrumentationDataProxy();
-}
-
-void MemCpyCommandHost::emitInstrumentationData() {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- if (!xptiCheckTraceEnabled(MStreamID))
- return;
- // Create a payload with the command name and an event using this payload to
- // emit a node_create
- MAddress = MSrcAllocaCmd->getSYCLMemObj();
- makeTraceEventProlog(MAddress);
-
- xpti_td *CmdTraceEvent = static_cast(MTraceEvent);
- addDeviceMetadata(CmdTraceEvent, MQueue);
- xpti::addMetadata(CmdTraceEvent, "memory_object",
- reinterpret_cast(MAddress));
- xpti::addMetadata(CmdTraceEvent, "copy_from",
- MSrcQueue ? deviceToID(MSrcQueue->get_device()) : 0);
- xpti::addMetadata(CmdTraceEvent, "copy_to",
- MQueue ? deviceToID(MQueue->get_device()) : 0);
- // Since we do NOT add queue_id value to metadata, we are stashing it to TLS
- // as this data is mutable and the metadata is supposed to be invariant
- xpti::framework::stash_tuple(XPTI_QUEUE_INSTANCE_ID_KEY, getQueueID(MQueue));
- makeTraceEventEpilog();
-#endif
}
ContextImplPtr MemCpyCommandHost::getWorkerContext() const {
@@ -1787,9 +1180,7 @@ ur_result_t MemCpyCommandHost::enqueueImp() {
return UR_RESULT_SUCCESS;
}
-EmptyCommand::EmptyCommand() : Command(CommandType::EMPTY_TASK, nullptr) {
- emitInstrumentationDataProxy();
-}
+EmptyCommand::EmptyCommand() : Command(CommandType::EMPTY_TASK, nullptr) {}
ur_result_t EmptyCommand::enqueueImp() {
waitForPreparedHostEvents();
@@ -1815,31 +1206,6 @@ void EmptyCommand::addRequirement(Command *DepCmd, AllocaCommandBase *AllocaCmd,
(void)Cmd;
}
-void EmptyCommand::emitInstrumentationData() {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- if (!xptiCheckTraceEnabled(MStreamID))
- return;
- // Create a payload with the command name and an event using this payload to
- // emit a node_create
- if (MRequirements.empty())
- return;
-
- Requirement &Req = *MRequirements.begin();
-
- MAddress = Req.MSYCLMemObj;
- makeTraceEventProlog(MAddress);
-
- xpti_td *CmdTraceEvent = static_cast(MTraceEvent);
- addDeviceMetadata(CmdTraceEvent, MQueue);
- xpti::addMetadata(CmdTraceEvent, "memory_object",
- reinterpret_cast(MAddress));
- // Since we do NOT add queue_id value to metadata, we are stashing it to TLS
- // as this data is mutable and the metadata is supposed to be invariant
- xpti::framework::stash_tuple(XPTI_QUEUE_INSTANCE_ID_KEY, getQueueID(MQueue));
- makeTraceEventEpilog();
-#endif
-}
-
void EmptyCommand::printDot(std::ostream &Stream) const {
Stream << "\"" << this << "\" [style=filled, fillcolor=\"#8d8f29\", label=\"";
@@ -1881,30 +1247,7 @@ UpdateHostRequirementCommand::UpdateHostRequirementCommand(
QueueImplPtr Queue, Requirement Req, AllocaCommandBase *SrcAllocaCmd,
void **DstPtr)
: Command(CommandType::UPDATE_REQUIREMENT, std::move(Queue)),
- MSrcAllocaCmd(SrcAllocaCmd), MDstReq(std::move(Req)), MDstPtr(DstPtr) {
-
- emitInstrumentationDataProxy();
-}
-
-void UpdateHostRequirementCommand::emitInstrumentationData() {
-#ifdef XPTI_ENABLE_INSTRUMENTATION
- if (!xptiCheckTraceEnabled(MStreamID))
- return;
- // Create a payload with the command name and an event using this payload to
- // emit a node_create
- MAddress = MSrcAllocaCmd->getSYCLMemObj();
- makeTraceEventProlog(MAddress);
-
- xpti_td *CmdTraceEvent = static_cast(MTraceEvent);
- addDeviceMetadata(CmdTraceEvent, MQueue);
- xpti::addMetadata(CmdTraceEvent, "memory_object",
- reinterpret_cast(MAddress));
- // Since we do NOT add queue_id value to metadata, we are stashing it to TLS
- // as this data is mutable and the metadata is supposed to be invariant
- xpti::framework::stash_tuple(XPTI_QUEUE_INSTANCE_ID_KEY, getQueueID(MQueue));
- makeTraceEventEpilog();
-#endif
-}
+ MSrcAllocaCmd(SrcAllocaCmd), MDstReq(std::move(Req)), MDstPtr(DstPtr) {}
static std::string_view cgTypeToString(detail::CGType Type) {
switch (Type) {
@@ -1988,266 +1331,6 @@ ExecCGCommand::ExecCGCommand(
}
if (MCommandGroup->getType() == detail::CGType::ProfilingTag)
MEvent->markAsProfilingTagEvent();
-
- emitInstrumentationDataProxy();
-}
-
-#ifdef XPTI_ENABLE_INSTRUMENTATION
-std::string instrumentationGetKernelName(
- const std::shared_ptr &SyclKernel,
- const std::string &FunctionName, const std::string &SyclKernelName,
- void *&Address, std::optional &FromSource) {
- std::string KernelName;
- if (SyclKernel && SyclKernel->isCreatedFromSource()) {
- FromSource = true;
- ur_kernel_handle_t KernelHandle = SyclKernel->getHandleRef();
- Address = KernelHandle;
- KernelName = FunctionName;
- } else {
- FromSource = false;
- KernelName = demangleKernelName(SyclKernelName);
- }
- return KernelName;
-}
-
-void instrumentationAddExtraKernelMetadata(
- xpti_td *&CmdTraceEvent, const NDRDescT &NDRDesc,
- const std::shared_ptr &KernelBundleImplPtr,
- const std::string &KernelName,
- const std::shared_ptr &SyclKernel,
- const QueueImplPtr &Queue,
- std::vector &CGArgs) // CGArgs are not const since they could be
- // sorted in this function
-{
- std::vector