diff --git a/sycl/doc/design/CommandGraph.md b/sycl/doc/design/CommandGraph.md index 9b57dd51c0a9a..47c835d664330 100644 --- a/sycl/doc/design/CommandGraph.md +++ b/sycl/doc/design/CommandGraph.md @@ -149,8 +149,8 @@ yet been implemented. Implementation of UR command-buffers for each of the supported SYCL 2020 backends. -Currently Level Zero and CUDA backends are implemented. -More sub-sections will be added here as other backends are supported. +Backends which are implemented currently are: [Level Zero](#level-zero), +[CUDA](#cuda), and partial support for [OpenCL](#opencl). ### Level Zero @@ -246,3 +246,104 @@ the executable CUDA Graph that represent this series of operations. An executable CUDA Graph, which contains all commands and synchronization information, is saved in the UR command-buffer to allow for efficient graph resubmission. + +### OpenCL + +SYCL-Graph is only enabled for an OpenCL backend when the +[cl_khr_command_buffer](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_Ext.html#cl_khr_command_buffer) +extension is available, however this information isn't available until runtime +due to OpenCL implementations being loaded through an ICD. + +The `ur_exp_command_buffer` string is conditionally returned from the OpenCL +command-buffer UR backend at runtime based on `cl_khr_command_buffer` support +to indicate that the graph extension should be enabled. This is information +is propagated to the SYCL user via the +`device.get_info()` query for graph extension +support. + +#### Limitations + +Due to the API mapping gaps documented in the following section, OpenCL as a +SYCL backend cannot fully support the graph API. Instead, there are +limitations in the types of nodes which a user can add to a graph, using +an unsupported node type will cause a sycl exception to be thrown in graph +finalization with error code `sycl::errc::feature_not_supported` and a message +mentioning the unsupported command. For example, + +``` +terminate called after throwing an instance of 'sycl::_V1::exception' +what(): USM copy command not supported by graph backend +``` + +The types of commands which are unsupported, and lead to this exception are: +* `handler::copy(src, dest)` - Where `src` is an accessor and `dest` is a pointer. + This corresponds to a memory buffer read command. +* `handler::copy(src, dest)` - Where `src` is an pointer and `dest` is an accessor. + This corresponds to a memory buffer write command. +* `handler::copy(src, dest)` or `handler::memcpy(dest, src)` - Where both `src` and + `dest` are USM pointers. This corresponds to a USM copy command. + +Note that `handler::copy(src, dest)` where both `src` and `dest` are an accessor +is supported, as a memory buffer copy command exists in the OpenCL extension. + +#### UR API Mapping + +There are some gaps in both the OpenCL and UR specifications for Command +Buffers shown in the list below. There are implementations in the UR OpenCL +adapter where there is matching support for each function in the list. + +| UR | OpenCL | Supported | +| --- | --- | --- | +| urCommandBufferCreateExp | clCreateCommandBufferKHR | Yes | +| urCommandBufferRetainExp | clRetainCommandBufferKHR | Yes | +| urCommandBufferReleaseExp | clReleaseCommandBufferKHR | Yes | +| urCommandBufferFinalizeExp | clFinalizeCommandBufferKHR | Yes | +| urCommandBufferAppendKernelLaunchExp | clCommandNDRangeKernelKHR | Yes | +| urCommandBufferAppendUSMMemcpyExp | | No | +| urCommandBufferAppendUSMFillExp | | No | +| urCommandBufferAppendMembufferCopyExp | clCommandCopyBufferKHR | Yes | +| urCommandBufferAppendMemBufferWriteExp | | No | +| urCommandBufferAppendMemBufferReadExp | | No | +| urCommandBufferAppendMembufferCopyRectExp | clCommandCopyBufferRectKHR | Yes | +| urCommandBufferAppendMemBufferWriteRectExp | | No | +| urCommandBufferAppendMemBufferReadRectExp | | No | +| urCommandBufferAppendMemBufferFillExp | clCommandFillBufferKHR | Yes | +| urCommandBufferEnqueueExp | clEnqueueCommandBufferKHR | Yes | +| | clCommandBarrierWithWaitListKHR | No | +| | clCommandCopyImageKHR | No | +| | clCommandCopyImageToBufferKHR | No | +| | clCommandFillImageKHR | No | +| | clGetCommandBufferInfoKHR | No | +| | clCommandSVMMemcpyKHR | No | +| | clCommandSVMMemFillKHR | No | + +We are looking to address these gaps in the future so that SYCL-Graph can be +fully supported on a `cl_khr_command_buffer` backend. + +#### UR Command-Buffer Implementation + +Many of the OpenCL functions take a `cl_command_queue` parameter which is not +present in most of the UR functions. Instead, when a new command buffer is +created in `urCommandBufferCreateExp` we also create and maintain a new +internal `ur_queue_handle_t` with a reference stored inside of the +`ur_exp_command_buffer_handle_t_` struct. The internal queue is retained and +released whenever the owning command buffer is retained or released. + +With command buffers being an OpenCL extension, each function is accessed by +loading a function pointer to its implementation. These are defined in a common +header file in the UR OpenCL adapter. The symbols for the functions are however +defined in [OpenCL-Headers](https://github.com/KhronosGroup/OpenCL-Headers/blob/main/CL/cl_ext.h) +but it is not known at this time what version of the headers will be used in +the UR GitHub CI configuration, so loading the function pointers will be used +until this can be verified. A future piece of work would be replacing the +custom defined symbols with the ones from OpenCL-Headers. + +#### Available OpenCL Command-Buffer Implementations + +Publicly available implementations of `cl_khr_command_buffer` that can be used +to enable the graph extension in OpenCL: + +- [OneAPI Construction Kit](https://github.com/codeplaysoftware/oneapi-construction-kit) (must enable `OCL_EXTENSION_cl_khr_command_buffer` when building) +- [PoCL](http://portablecl.org/) +- [Command-Buffer Emulation Layer](https://github.com/bashbaug/SimpleOpenCLSamples/tree/efeae73139ddf064fafce565cc39640af10d900f/layers/10_cmdbufemu) + diff --git a/sycl/doc/design/images/SYCL-Graph-Architecture.svg b/sycl/doc/design/images/SYCL-Graph-Architecture.svg index f67db81aadbbb..c554391f6544d 100644 --- a/sycl/doc/design/images/SYCL-Graph-Architecture.svg +++ b/sycl/doc/design/images/SYCL-Graph-Architecture.svg @@ -1,4 +1,4 @@ -
Application
Application
SYCL-Graph Extension API
SYCL-Graph Extension API
SYCL Runtime
SYCL Runtime
Unified Runtime + Command Buffer Extension
Unified Runtime + Command Buffer Extension
CUDA
CUDA
NVIDIA GPU
NVIDIA GPU
Level Zero
Level Zero
Intel CPU, GPU, FPGA, ...
Intel CPU, GPU,...
HIP
HIP
OpenCL cl_khr_command_buffer
OpenCL cl_khr_command_b...
AMD GPU
AMD GPU
CPU, GPU, FPGA, ...
CPU, GPU, FPG...
SYCL-Graph Architecture
SYCL-Graph Architecture


Application Layer
Application Layer
Implemented Backend
Implemented Backend
SYCL Runtime
SYCL Runtime
Future Backend Support
Future Backend Support
Legend
Legend
Text is not SVG - cannot display
\ No newline at end of file +
Application
Application
SYCL-Graph Extension API
SYCL-Graph Extension API
SYCL Runtime
SYCL Runtime
Unified Runtime + Command Buffer Extension
Unified Runtime + Command Buffer Extension
CUDA
CUDA
NVIDIA GPU
NVIDIA GPU
Level Zero
Level Zero
Intel CPU, GPU, FPGA, ...
Intel CPU, GPU,...
HIP
HIP
OpenCL cl_khr_command_buffer
OpenCL cl_khr_command_b...
AMD GPU
AMD GPU
CPU, GPU, FPGA, ...
CPU, GPU, FPG...
SYCL-Graph Architecture
SYCL-Graph Architecture


Application Layer
Application Layer
Implemented Backend
Implemented Backend
SYCL Runtime
SYCL Runtime
Future Backend Support
Future Backend Support
Legend
Legend
Partial Backend Support
Partial Backend Support
Text is not SVG - cannot display
\ No newline at end of file diff --git a/sycl/plugins/native_cpu/CMakeLists.txt b/sycl/plugins/native_cpu/CMakeLists.txt index 5e858cfd911d0..e696b7c5e89e9 100644 --- a/sycl/plugins/native_cpu/CMakeLists.txt +++ b/sycl/plugins/native_cpu/CMakeLists.txt @@ -1,38 +1,27 @@ +# Plugin for SYCL Native CPU +# Create shared library for libpi_nativecpu.so + +# Get the Native CPU adapter sources so they can be shared with the Native CPU PI plugin +get_target_property(UR_NATIVE_CPU_ADAPTER_SOURCES ur_adapter_native_cpu SOURCES) + add_sycl_plugin(native_cpu SOURCES - "pi_native_cpu.cpp" + ${UR_NATIVE_CPU_ADAPTER_SOURCES} + # Some code is shared with the UR adapter "../unified_runtime/pi2ur.hpp" "../unified_runtime/pi2ur.cpp" - "../unified_runtime/ur/ur.hpp" - "../unified_runtime/ur/ur.cpp" - "../unified_runtime/ur/adapters/native_cpu/adapter.cpp" - "../unified_runtime/ur/adapters/native_cpu/command_buffer.cpp" - "../unified_runtime/ur/adapters/native_cpu/common.cpp" - "../unified_runtime/ur/adapters/native_cpu/common.hpp" - "../unified_runtime/ur/adapters/native_cpu/context.cpp" - "../unified_runtime/ur/adapters/native_cpu/context.hpp" - "../unified_runtime/ur/adapters/native_cpu/device.cpp" - "../unified_runtime/ur/adapters/native_cpu/device.hpp" - "../unified_runtime/ur/adapters/native_cpu/enqueue.cpp" - "../unified_runtime/ur/adapters/native_cpu/event.cpp" - "../unified_runtime/ur/adapters/native_cpu/image.cpp" - "../unified_runtime/ur/adapters/native_cpu/kernel.cpp" - "../unified_runtime/ur/adapters/native_cpu/kernel.hpp" - "../unified_runtime/ur/adapters/native_cpu/memory.cpp" - "../unified_runtime/ur/adapters/native_cpu/memory.hpp" - "../unified_runtime/ur/adapters/native_cpu/platform.cpp" - "../unified_runtime/ur/adapters/native_cpu/platform.hpp" - "../unified_runtime/ur/adapters/native_cpu/program.cpp" - "../unified_runtime/ur/adapters/native_cpu/program.hpp" - "../unified_runtime/ur/adapters/native_cpu/queue.cpp" - "../unified_runtime/ur/adapters/native_cpu/queue.hpp" - "../unified_runtime/ur/adapters/native_cpu/sampler.cpp" - "../unified_runtime/ur/adapters/native_cpu/ur_interface_loader.cpp" - "../unified_runtime/ur/adapters/native_cpu/usm.cpp" - "../unified_runtime/ur/adapters/native_cpu/usm_p2p.cpp" + "${sycl_inc_dir}/sycl/detail/pi.h" + "${sycl_inc_dir}/sycl/detail/pi.hpp" + "pi_native_cpu.cpp" + "pi_native_cpu.hpp" INCLUDE_DIRS - ${CMAKE_CURRENT_SOURCE_DIR}/../unified_runtime + ${sycl_inc_dir} + ${CMAKE_CURRENT_SOURCE_DIR}/../unified_runtime # for Unified Runtime + ${UNIFIED_RUNTIME_SOURCE_DIR}/source/ # for adapters/native_cpu LIBRARIES sycl UnifiedRuntime-Headers + UnifiedRuntimeCommon ) + +set_target_properties(pi_native_cpu PROPERTIES LINKER_LANGUAGE CXX) diff --git a/sycl/plugins/native_cpu/pi_native_cpu.hpp b/sycl/plugins/native_cpu/pi_native_cpu.hpp index b1edb3bb1999f..1d92580997b76 100644 --- a/sycl/plugins/native_cpu/pi_native_cpu.hpp +++ b/sycl/plugins/native_cpu/pi_native_cpu.hpp @@ -8,13 +8,13 @@ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include struct _pi_context : ur_context_handle_t_ { using ur_context_handle_t_::ur_context_handle_t_; diff --git a/sycl/plugins/unified_runtime/CMakeLists.txt b/sycl/plugins/unified_runtime/CMakeLists.txt index 1d4d0c52caa19..74e7e44bc743d 100644 --- a/sycl/plugins/unified_runtime/CMakeLists.txt +++ b/sycl/plugins/unified_runtime/CMakeLists.txt @@ -30,9 +30,12 @@ if("hip" IN_LIST SYCL_ENABLE_PLUGINS) endif() if("opencl" IN_LIST SYCL_ENABLE_PLUGINS) set(UR_BUILD_ADAPTER_OPENCL ON) - set(UR_OPENCL_ICD_LOADER_LIBRARY OpenCL-ICD) + set(UR_OPENCL_ICD_LOADER_LIBRARY OpenCL-ICD CACHE FILEPATH + "Path of the OpenCL ICD Loader library" FORCE) +endif() +if("native_cpu" IN_LIST SYCL_ENABLE_PLUGINS) + set(UR_BUILD_ADAPTER_NATIVE_CPU ON) endif() -# TODO: Set UR_BUILD_ADAPTER_NATIVE_CPU once adapter moved # Disable errors from warnings while building the UR. # And remember origin flags before doing that. @@ -54,13 +57,11 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT) include(FetchContent) set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git") - # commit ec7982bac6cb3a6b9ed610cd6b7cb41fcbc780dc - # Merge: 62e6d2f9 5fb82924 + # commit aaa4661f5c32e6dcb43248ed7575de6971852cc3 # Author: Kenneth Benzie (Benie) - # Date: Wed Nov 8 13:32:46 2023 +0000 - # Merge pull request #1022 from 0x12CC/l0_usm_error_checking_2 - # [UR][L0] Propagate OOM errors from `USMAllocationMakeResident` - set(UNIFIED_RUNTIME_TAG ec7982bac6cb3a6b9ed610cd6b7cb41fcbc780dc) + # Date: Fri Dec 15 16:05:36 2023 +0000 + # Set version to v0.8.2 + set(UNIFIED_RUNTIME_TAG aaa4661f5c32e6dcb43248ed7575de6971852cc3) if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO) set(UNIFIED_RUNTIME_REPO "${SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO}") @@ -159,49 +160,6 @@ endif() add_sycl_plugin(unified_runtime ${UNIFIED_RUNTIME_PLUGIN_ARGS}) -if("native_cpu" IN_LIST SYCL_ENABLE_PLUGINS) - add_sycl_library("ur_adapter_native_cpu" SHARED - SOURCES - "ur/ur.cpp" - "ur/ur.hpp" - "ur/adapters/native_cpu/adapter.cpp" - "ur/adapters/native_cpu/command_buffer.cpp" - "ur/adapters/native_cpu/common.cpp" - "ur/adapters/native_cpu/common.hpp" - "ur/adapters/native_cpu/context.cpp" - "ur/adapters/native_cpu/context.hpp" - "ur/adapters/native_cpu/device.cpp" - "ur/adapters/native_cpu/device.hpp" - "ur/adapters/native_cpu/enqueue.cpp" - "ur/adapters/native_cpu/event.cpp" - "ur/adapters/native_cpu/image.cpp" - "ur/adapters/native_cpu/kernel.cpp" - "ur/adapters/native_cpu/kernel.hpp" - "ur/adapters/native_cpu/memory.cpp" - "ur/adapters/native_cpu/memory.hpp" - "ur/adapters/native_cpu/platform.cpp" - "ur/adapters/native_cpu/platform.hpp" - "ur/adapters/native_cpu/program.cpp" - "ur/adapters/native_cpu/program.hpp" - "ur/adapters/native_cpu/queue.cpp" - "ur/adapters/native_cpu/queue.hpp" - "ur/adapters/native_cpu/sampler.cpp" - "ur/adapters/native_cpu/ur_interface_loader.cpp" - "ur/adapters/native_cpu/usm.cpp" - "ur/adapters/native_cpu/usm_p2p.cpp" - LIBRARIES - UnifiedRuntime-Headers - Threads::Threads - OpenCL-Headers - ) - - set_target_properties("ur_adapter_native_cpu" PROPERTIES - VERSION "0.0.0" - SOVERSION "0" - ) -endif() - - if(TARGET UnifiedRuntimeLoader) set_target_properties(hello_world PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1) # Install the UR loader. @@ -238,3 +196,7 @@ endif() if ("opencl" IN_LIST SYCL_ENABLE_PLUGINS) add_dependencies(sycl-runtime-libraries ur_adapter_opencl) endif() + +if ("native_cpu" IN_LIST SYCL_ENABLE_PLUGINS) + add_dependencies(sycl-runtime-libraries ur_adapter_native_cpu) +endif() diff --git a/sycl/plugins/unified_runtime/pi2ur.hpp b/sycl/plugins/unified_runtime/pi2ur.hpp index 69637713fc6ba..b5f4d2a0f8cc1 100644 --- a/sycl/plugins/unified_runtime/pi2ur.hpp +++ b/sycl/plugins/unified_runtime/pi2ur.hpp @@ -101,6 +101,7 @@ static pi_result ur2piResult(ur_result_t urResult) { return PI_ERROR_LINK_PROGRAM_FAILURE; case UR_RESULT_ERROR_UNSUPPORTED_VERSION: case UR_RESULT_ERROR_UNSUPPORTED_FEATURE: + return PI_ERROR_INVALID_OPERATION; case UR_RESULT_ERROR_INVALID_ARGUMENT: case UR_RESULT_ERROR_INVALID_NULL_HANDLE: case UR_RESULT_ERROR_HANDLE_OBJECT_IN_USE: @@ -127,7 +128,6 @@ static pi_result ur2piResult(ur_result_t urResult) { return PI_ERROR_INVALID_WORK_DIMENSION; case UR_RESULT_ERROR_INVALID_GLOBAL_WIDTH_DIMENSION: return PI_ERROR_INVALID_VALUE; - case UR_RESULT_ERROR_PROGRAM_UNLINKED: return PI_ERROR_INVALID_PROGRAM_EXECUTABLE; case UR_RESULT_ERROR_OVERLAPPING_REGIONS: @@ -140,6 +140,10 @@ static pi_result ur2piResult(ur_result_t urResult) { return PI_ERROR_OUT_OF_RESOURCES; case UR_RESULT_ERROR_ADAPTER_SPECIFIC: return PI_ERROR_PLUGIN_SPECIFIC_ERROR; + case UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP: + return PI_ERROR_INVALID_COMMAND_BUFFER_KHR; + case UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_WAIT_LIST_EXP: + return PI_ERROR_INVALID_SYNC_POINT_WAIT_LIST_KHR; case UR_RESULT_ERROR_UNKNOWN: default: return PI_ERROR_UNKNOWN; @@ -1985,10 +1989,17 @@ piProgramLink(pi_context Context, pi_uint32 NumDevices, ur_program_handle_t *UrProgram = reinterpret_cast(RetProgram); - HANDLE_ERRORS(urProgramLink(UrContext, NumInputPrograms, UrInputPrograms, - Options, UrProgram)); + auto UrDevices = reinterpret_cast( + const_cast(DeviceList)); - return PI_SUCCESS; + auto urResult = + urProgramLinkExp(UrContext, NumDevices, UrDevices, NumInputPrograms, + UrInputPrograms, Options, UrProgram); + if (urResult == UR_RESULT_ERROR_UNSUPPORTED_FEATURE) { + urResult = urProgramLink(UrContext, NumInputPrograms, UrInputPrograms, + Options, UrProgram); + } + return ur2piResult(urResult); } inline pi_result piProgramCompile( @@ -2017,9 +2028,15 @@ inline pi_result piProgramCompile( HANDLE_ERRORS(urProgramGetInfo(UrProgram, PropName, sizeof(&UrContext), &UrContext, nullptr)); - HANDLE_ERRORS(urProgramCompile(UrContext, UrProgram, Options)); + auto UrDevices = reinterpret_cast( + const_cast(DeviceList)); - return PI_SUCCESS; + auto urResult = + urProgramCompileExp(UrProgram, NumDevices, UrDevices, Options); + if (urResult == UR_RESULT_ERROR_UNSUPPORTED_FEATURE) { + urResult = urProgramCompile(UrContext, UrProgram, Options); + } + return ur2piResult(urResult); } inline pi_result @@ -2050,9 +2067,14 @@ piProgramBuild(pi_program Program, pi_uint32 NumDevices, HANDLE_ERRORS(urProgramGetInfo(UrProgram, PropName, sizeof(&UrContext), &UrContext, nullptr)); - HANDLE_ERRORS(urProgramBuild(UrContext, UrProgram, Options)); + auto UrDevices = reinterpret_cast( + const_cast(DeviceList)); - return PI_SUCCESS; + auto urResult = urProgramBuildExp(UrProgram, NumDevices, UrDevices, Options); + if (urResult == UR_RESULT_ERROR_UNSUPPORTED_FEATURE) { + urResult = urProgramBuild(UrContext, UrProgram, Options); + } + return ur2piResult(urResult); } inline pi_result piextProgramSetSpecializationConstant(pi_program Program, @@ -2336,8 +2358,18 @@ inline pi_result piKernelGetInfo(pi_kernel Kernel, pi_kernel_info ParamName, break; } case PI_KERNEL_INFO_NUM_ARGS: { - UrParamName = UR_KERNEL_INFO_NUM_ARGS; - break; + size_t NumArgs = 0; + HANDLE_ERRORS(urKernelGetInfo(UrKernel, UR_KERNEL_INFO_NUM_ARGS, + sizeof(NumArgs), &NumArgs, nullptr)); + if (ParamValueSizeRet) { + *ParamValueSizeRet = sizeof(uint32_t); + } + if (ParamValue) { + if (ParamValueSize != sizeof(uint32_t)) + return PI_ERROR_INVALID_BUFFER_SIZE; + *static_cast(ParamValue) = static_cast(NumArgs); + } + return PI_SUCCESS; } case PI_KERNEL_INFO_REFERENCE_COUNT: { UrParamName = UR_KERNEL_INFO_REFERENCE_COUNT; @@ -2670,12 +2702,28 @@ inline pi_result piMemBufferCreate(pi_context Context, pi_mem_flags Flags, inline pi_result piextUSMHostAlloc(void **ResultPtr, pi_context Context, pi_usm_mem_properties *Properties, size_t Size, pi_uint32 Alignment) { + ur_usm_desc_t USMDesc{}; + USMDesc.align = Alignment; + + ur_usm_alloc_location_desc_t UsmLocationDesc{}; + UsmLocationDesc.stype = UR_STRUCTURE_TYPE_USM_ALLOC_LOCATION_DESC; + + if (Properties) { + uint32_t Next = 0; + while (Properties[Next]) { + if (Properties[Next] == PI_MEM_USM_ALLOC_BUFFER_LOCATION) { + UsmLocationDesc.location = static_cast(Properties[Next + 1]); + USMDesc.pNext = &UsmLocationDesc; + } else { + return PI_ERROR_INVALID_VALUE; + } + Next += 2; + } + } - std::ignore = Properties; ur_context_handle_t UrContext = reinterpret_cast(Context); - ur_usm_desc_t USMDesc{}; - USMDesc.align = Alignment; + ur_usm_pool_handle_t Pool{}; HANDLE_ERRORS(urUSMHostAlloc(UrContext, &USMDesc, Pool, Size, ResultPtr)); return PI_SUCCESS; @@ -3104,14 +3152,29 @@ inline pi_result piextUSMDeviceAlloc(void **ResultPtr, pi_context Context, pi_device Device, pi_usm_mem_properties *Properties, size_t Size, pi_uint32 Alignment) { - - std::ignore = Properties; ur_context_handle_t UrContext = reinterpret_cast(Context); auto UrDevice = reinterpret_cast(Device); ur_usm_desc_t USMDesc{}; USMDesc.align = Alignment; + + ur_usm_alloc_location_desc_t UsmLocDesc{}; + UsmLocDesc.stype = UR_STRUCTURE_TYPE_USM_ALLOC_LOCATION_DESC; + + if (Properties) { + uint32_t Next = 0; + while (Properties[Next]) { + if (Properties[Next] == PI_MEM_USM_ALLOC_BUFFER_LOCATION) { + UsmLocDesc.location = static_cast(Properties[Next + 1]); + USMDesc.pNext = &UsmLocDesc; + } else { + return PI_ERROR_INVALID_VALUE; + } + Next += 2; + } + } + ur_usm_pool_handle_t Pool{}; HANDLE_ERRORS( urUSMDeviceAlloc(UrContext, UrDevice, &USMDesc, Pool, Size, ResultPtr)); @@ -3144,42 +3207,58 @@ inline pi_result piextUSMSharedAlloc(void **ResultPtr, pi_context Context, pi_device Device, pi_usm_mem_properties *Properties, size_t Size, pi_uint32 Alignment) { - - std::ignore = Properties; - if (Properties && *Properties != 0) { - PI_ASSERT(*(Properties) == PI_MEM_ALLOC_FLAGS && *(Properties + 2) == 0, - PI_ERROR_INVALID_VALUE); - } - ur_context_handle_t UrContext = reinterpret_cast(Context); auto UrDevice = reinterpret_cast(Device); ur_usm_desc_t USMDesc{}; + USMDesc.align = Alignment; ur_usm_device_desc_t UsmDeviceDesc{}; UsmDeviceDesc.stype = UR_STRUCTURE_TYPE_USM_DEVICE_DESC; ur_usm_host_desc_t UsmHostDesc{}; UsmHostDesc.stype = UR_STRUCTURE_TYPE_USM_HOST_DESC; + ur_usm_alloc_location_desc_t UsmLocationDesc{}; + UsmLocationDesc.stype = UR_STRUCTURE_TYPE_USM_ALLOC_LOCATION_DESC; + + // One properties bitfield can correspond to a host_desc and a device_desc + // struct, since having `0` values in these is harmless we can set up this + // pNext chain in advance. + USMDesc.pNext = &UsmDeviceDesc; + UsmDeviceDesc.pNext = &UsmHostDesc; + if (Properties) { - if (Properties[0] == PI_MEM_ALLOC_FLAGS) { - if (Properties[1] == PI_MEM_ALLOC_WRTITE_COMBINED) { - UsmDeviceDesc.flags |= UR_USM_DEVICE_MEM_FLAG_WRITE_COMBINED; - } - if (Properties[1] == PI_MEM_ALLOC_INITIAL_PLACEMENT_DEVICE) { - UsmDeviceDesc.flags |= UR_USM_DEVICE_MEM_FLAG_INITIAL_PLACEMENT; + uint32_t Next = 0; + while (Properties[Next]) { + switch (Properties[Next]) { + case PI_MEM_ALLOC_FLAGS: { + if (Properties[Next + 1] & PI_MEM_ALLOC_WRTITE_COMBINED) { + UsmDeviceDesc.flags |= UR_USM_DEVICE_MEM_FLAG_WRITE_COMBINED; + } + if (Properties[Next + 1] & PI_MEM_ALLOC_INITIAL_PLACEMENT_DEVICE) { + UsmDeviceDesc.flags |= UR_USM_DEVICE_MEM_FLAG_INITIAL_PLACEMENT; + } + if (Properties[Next + 1] & PI_MEM_ALLOC_INITIAL_PLACEMENT_HOST) { + UsmHostDesc.flags |= UR_USM_HOST_MEM_FLAG_INITIAL_PLACEMENT; + } + if (Properties[Next + 1] & PI_MEM_ALLOC_DEVICE_READ_ONLY) { + UsmDeviceDesc.flags |= UR_USM_DEVICE_MEM_FLAG_DEVICE_READ_ONLY; + } + break; } - if (Properties[1] == PI_MEM_ALLOC_INITIAL_PLACEMENT_HOST) { - UsmHostDesc.flags |= UR_USM_HOST_MEM_FLAG_INITIAL_PLACEMENT; + case PI_MEM_USM_ALLOC_BUFFER_LOCATION: { + UsmLocationDesc.location = static_cast(Properties[Next + 1]); + // We wait until we've seen a BUFFER_LOCATION property to tack this + // onto the end of the chain, a `0` here might be valid as far as we + // know so we must exclude it unless we've been given a value. + UsmHostDesc.pNext = &UsmLocationDesc; + break; } - if (Properties[1] == PI_MEM_ALLOC_DEVICE_READ_ONLY) { - UsmDeviceDesc.flags |= UR_USM_DEVICE_MEM_FLAG_DEVICE_READ_ONLY; + default: + return PI_ERROR_INVALID_VALUE; } + Next += 2; } } - UsmDeviceDesc.pNext = &UsmHostDesc; - USMDesc.pNext = &UsmDeviceDesc; - - USMDesc.align = Alignment; ur_usm_pool_handle_t Pool{}; HANDLE_ERRORS( diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/README.md b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/README.md new file mode 100644 index 0000000000000..da10e962ff638 --- /dev/null +++ b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/README.md @@ -0,0 +1,7 @@ +# Native CPU adapter +The source for the SYCL Native CPU adapter has been moved to the +[adapters](https://github.com/oneapi-src/unified-runtime/tree/adapters) branch +of the [Unified Runtime](https://github.com/oneapi-src/unified-runtime/) repo. +Changes can be made by opening pull requests against that branch, and updating +the Unified Runtime commit in the parent +[CMakeLists.txt](../../../CMakeLists.txt). diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/adapter.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/adapter.cpp deleted file mode 100644 index dd046336a2532..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/adapter.cpp +++ /dev/null @@ -1,71 +0,0 @@ -//===---------------- adapter.cpp - Native CPU Adapter --------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "common.hpp" -#include "ur_api.h" - -struct ur_adapter_handle_t_ { - std::atomic RefCount = 0; -} Adapter; - -UR_APIEXPORT ur_result_t UR_APICALL urInit(ur_device_init_flags_t, - ur_loader_config_handle_t) { - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urTearDown(void *) { - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urAdapterGet( - uint32_t, ur_adapter_handle_t *phAdapters, uint32_t *pNumAdapters) { - if (phAdapters) { - Adapter.RefCount++; - *phAdapters = &Adapter; - } - if (pNumAdapters) { - *pNumAdapters = 1; - } - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urAdapterRelease(ur_adapter_handle_t) { - Adapter.RefCount--; - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urAdapterRetain(ur_adapter_handle_t) { - Adapter.RefCount++; - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urAdapterGetLastError( - ur_adapter_handle_t, const char **ppMessage, int32_t *pError) { - *ppMessage = ErrorMessage; - *pError = ErrorMessageCode; - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urAdapterGetInfo(ur_adapter_handle_t, - ur_adapter_info_t propName, - size_t propSize, - void *pPropValue, - size_t *pPropSizeRet) { - UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); - - switch (propName) { - case UR_ADAPTER_INFO_BACKEND: - return ReturnValue(UR_ADAPTER_BACKEND_NATIVE_CPU); - case UR_ADAPTER_INFO_REFERENCE_COUNT: - return ReturnValue(Adapter.RefCount.load()); - default: - return UR_RESULT_ERROR_INVALID_ENUMERATION; - } - - return UR_RESULT_SUCCESS; -} diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/command_buffer.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/command_buffer.cpp deleted file mode 100644 index 15f311a0a9881..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/command_buffer.cpp +++ /dev/null @@ -1,131 +0,0 @@ -//===--------- command_buffer.cpp - NativeCPU Adapter ---------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===-----------------------------------------------------------------===// - -#include "common.hpp" - -/// Stub implementations of UR experimental feature command-buffers -/// Taken almost unchanged from another adapter. Perhaps going forward -/// these stubs could be defined in core UR as the default which would -/// reduce code duplication. Adapters could then "override" these defaults. - -UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferCreateExp( - ur_context_handle_t, ur_device_handle_t, - const ur_exp_command_buffer_desc_t *, ur_exp_command_buffer_handle_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urCommandBufferRetainExp(ur_exp_command_buffer_handle_t) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urCommandBufferReleaseExp(ur_exp_command_buffer_handle_t) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urCommandBufferFinalizeExp(ur_exp_command_buffer_handle_t) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp( - ur_exp_command_buffer_handle_t, ur_kernel_handle_t, uint32_t, - const size_t *, const size_t *, const size_t *, uint32_t, - const ur_exp_command_buffer_sync_point_t *, - ur_exp_command_buffer_sync_point_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemcpyUSMExp( - ur_exp_command_buffer_handle_t, void *, const void *, size_t, uint32_t, - const ur_exp_command_buffer_sync_point_t *, - ur_exp_command_buffer_sync_point_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMembufferCopyExp( - ur_exp_command_buffer_handle_t, ur_mem_handle_t, ur_mem_handle_t, size_t, - size_t, size_t, uint32_t, const ur_exp_command_buffer_sync_point_t *, - ur_exp_command_buffer_sync_point_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMembufferCopyRectExp( - ur_exp_command_buffer_handle_t, ur_mem_handle_t, ur_mem_handle_t, - ur_rect_offset_t, ur_rect_offset_t, ur_rect_region_t, size_t, size_t, - size_t, size_t, uint32_t, const ur_exp_command_buffer_sync_point_t *, - ur_exp_command_buffer_sync_point_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT -ur_result_t UR_APICALL urCommandBufferAppendMembufferWriteExp( - ur_exp_command_buffer_handle_t, ur_mem_handle_t, size_t, size_t, - const void *, uint32_t, const ur_exp_command_buffer_sync_point_t *, - ur_exp_command_buffer_sync_point_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT -ur_result_t UR_APICALL urCommandBufferAppendMembufferReadExp( - ur_exp_command_buffer_handle_t, ur_mem_handle_t, size_t, size_t, void *, - uint32_t, const ur_exp_command_buffer_sync_point_t *, - ur_exp_command_buffer_sync_point_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT -ur_result_t UR_APICALL urCommandBufferAppendMembufferWriteRectExp( - ur_exp_command_buffer_handle_t, ur_mem_handle_t, ur_rect_offset_t, - ur_rect_offset_t, ur_rect_region_t, size_t, size_t, size_t, size_t, void *, - uint32_t, const ur_exp_command_buffer_sync_point_t *, - ur_exp_command_buffer_sync_point_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT -ur_result_t UR_APICALL urCommandBufferAppendMembufferReadRectExp( - ur_exp_command_buffer_handle_t, ur_mem_handle_t, ur_rect_offset_t, - ur_rect_offset_t, ur_rect_region_t, size_t, size_t, size_t, size_t, void *, - uint32_t, const ur_exp_command_buffer_sync_point_t *, - ur_exp_command_buffer_sync_point_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp( - ur_exp_command_buffer_handle_t, ur_queue_handle_t, uint32_t, - const ur_event_handle_t *, ur_event_handle_t *) { - detail::ur::die("Experimental Command-buffer feature is not " - "implemented for the NativeCPU adapter."); - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/common.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/common.cpp deleted file mode 100644 index 799fb11cc2e30..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/common.cpp +++ /dev/null @@ -1,32 +0,0 @@ -//===---------------- common.cpp - Native CPU Adapter ---------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "common.hpp" - -// Global variables for UR_RESULT_ADAPTER_SPECIFIC_ERROR -// See urGetLastResult -thread_local ur_result_t ErrorMessageCode = UR_RESULT_SUCCESS; -thread_local char ErrorMessage[MaxMessageSize]; - -// Utility function for setting a message and warning -[[maybe_unused]] void setErrorMessage(const char *pMessage, - ur_result_t ErrorCode) { - assert(strlen(pMessage) <= MaxMessageSize); - strcpy(ErrorMessage, pMessage); - ErrorMessageCode = ErrorCode; -} - -ur_result_t urGetLastResult(ur_platform_handle_t, const char **ppMessage) { - *ppMessage = &ErrorMessage[0]; - return ErrorMessageCode; -} - -void detail::ur::die(const char *pMessage) { - std::cerr << "ur_die: " << pMessage << '\n'; - std::terminate(); -} diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/common.hpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/common.hpp deleted file mode 100644 index 839dc3db60430..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/common.hpp +++ /dev/null @@ -1,68 +0,0 @@ -//===----------- common.hpp - Native CPU Adapter ---------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===-----------------------------------------------------------------===// - -#pragma once - -#include "ur/ur.hpp" - -constexpr size_t MaxMessageSize = 256; - -extern thread_local ur_result_t ErrorMessageCode; -extern thread_local char ErrorMessage[MaxMessageSize]; - -#define DIE_NO_IMPLEMENTATION \ - if (PrintTrace) { \ - std::cerr << "Not Implemented : " << __FUNCTION__ \ - << " - File : " << __FILE__; \ - std::cerr << " / Line : " << __LINE__ << std::endl; \ - } \ - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; - -#define CONTINUE_NO_IMPLEMENTATION \ - if (PrintTrace) { \ - std::cerr << "Warning : Not Implemented : " << __FUNCTION__ \ - << " - File : " << __FILE__; \ - std::cerr << " / Line : " << __LINE__ << std::endl; \ - } \ - return UR_RESULT_SUCCESS; - -#define CASE_UR_UNSUPPORTED(not_supported) \ - case not_supported: \ - if (PrintTrace) { \ - std::cerr << std::endl \ - << "Unsupported UR case : " << #not_supported << " in " \ - << __FUNCTION__ << ":" << __LINE__ << "(" << __FILE__ << ")" \ - << std::endl; \ - } \ - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; - -/// ------ Error handling, matching OpenCL plugin semantics. -/// Taken from other adapter -namespace detail { -namespace ur { - -// Report error and no return (keeps compiler from printing warnings). -// TODO: Probably change that to throw a catchable exception, -// but for now it is useful to see every failure. -// -[[noreturn]] void die(const char *pMessage); -} // namespace ur -} // namespace detail - -// Base class to store common data -struct _ur_object { - ur_shared_mutex Mutex; -}; - -struct RefCounted { - std::atomic_uint32_t _refCount; - void incrementReferenceCount() { _refCount++; } - void decrementReferenceCount() { _refCount--; } - RefCounted() : _refCount{1} {} - uint32_t getReferenceCount() const { return _refCount; } -}; diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/context.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/context.cpp deleted file mode 100644 index 84ac17bcc6684..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/context.cpp +++ /dev/null @@ -1,101 +0,0 @@ -//===--------- context.cpp - Native CPU Adapter ---------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include -#include - -#include "ur/ur.hpp" -#include "ur_api.h" - -#include "common.hpp" -#include "context.hpp" - -UR_APIEXPORT ur_result_t UR_APICALL -urContextCreate(uint32_t DeviceCount, const ur_device_handle_t *phDevices, - const ur_context_properties_t *pProperties, - ur_context_handle_t *phContext) { - std::ignore = pProperties; - assert(DeviceCount == 1); - - // TODO: Proper error checking. - auto ctx = new ur_context_handle_t_(*phDevices); - *phContext = ctx; - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urContextRetain(ur_context_handle_t hContext) { - std::ignore = hContext; - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL -urContextRelease(ur_context_handle_t hContext) { - delete hContext; - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urContextGetInfo(ur_context_handle_t hContext, ur_context_info_t propName, - size_t propSize, void *pPropValue, size_t *pPropSizeRet) { - UrReturnHelper returnValue(propSize, pPropValue, pPropSizeRet); - - switch (propName) { - case UR_CONTEXT_INFO_NUM_DEVICES: - return returnValue(1); - case UR_CONTEXT_INFO_DEVICES: - return returnValue(hContext->_device); - case UR_CONTEXT_INFO_REFERENCE_COUNT: - return returnValue(nullptr); - case UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT: - return returnValue(true); - case UR_CONTEXT_INFO_USM_FILL2D_SUPPORT: - // case UR_CONTEXT_INFO_USM_MEMSET2D_SUPPORT: - // 2D USM operations currently not supported. - return returnValue(false); - case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: { - return UR_RESULT_ERROR_ADAPTER_SPECIFIC; - } - default: - return UR_RESULT_ERROR_INVALID_ENUMERATION; - } -} - -UR_APIEXPORT ur_result_t UR_APICALL urContextGetNativeHandle( - ur_context_handle_t hContext, ur_native_handle_t *phNativeContext) { - std::ignore = hContext; - std::ignore = phNativeContext; - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL urContextCreateWithNativeHandle( - ur_native_handle_t hNativeContext, uint32_t numDevices, - const ur_device_handle_t *phDevices, - const ur_context_native_properties_t *pProperties, - ur_context_handle_t *phContext) { - std::ignore = hNativeContext; - std::ignore = numDevices; - std::ignore = phDevices; - std::ignore = pProperties; - std::ignore = phContext; - - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL urContextSetExtendedDeleter( - ur_context_handle_t hContext, ur_context_extended_deleter_t pfnDeleter, - void *pUserData) { - std::ignore = hContext; - std::ignore = pfnDeleter; - std::ignore = pUserData; - - DIE_NO_IMPLEMENTATION -} diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/context.hpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/context.hpp deleted file mode 100644 index fd6f74e52a1ba..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/context.hpp +++ /dev/null @@ -1,19 +0,0 @@ -//===--------- context.hpp - Native CPU Adapter ---------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#pragma once - -#include - -#include "device.hpp" - -struct ur_context_handle_t_ { - ur_context_handle_t_(ur_device_handle_t_ *phDevices) : _device{phDevices} {} - - ur_device_handle_t _device; -}; diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/device.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/device.cpp deleted file mode 100644 index ad51194c212c4..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/device.cpp +++ /dev/null @@ -1,398 +0,0 @@ -//===--------- device.cpp - NATIVE CPU Adapter ----------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include - -#include "platform.hpp" - -UR_APIEXPORT ur_result_t UR_APICALL urDeviceGet(ur_platform_handle_t hPlatform, - ur_device_type_t DeviceType, - uint32_t NumEntries, - ur_device_handle_t *phDevices, - uint32_t *pNumDevices) { - UR_ASSERT(hPlatform, UR_RESULT_ERROR_INVALID_NULL_HANDLE); - - const bool AskingForAll = DeviceType == UR_DEVICE_TYPE_ALL; - const bool AskingForDefault = DeviceType == UR_DEVICE_TYPE_DEFAULT; - const bool AskingForCPU = DeviceType == UR_DEVICE_TYPE_CPU; - const bool ValidDeviceType = AskingForDefault || AskingForAll || AskingForCPU; - uint32_t DeviceCount = ValidDeviceType ? 1 : 0; - - if (pNumDevices) { - *pNumDevices = DeviceCount; - } - - if (NumEntries == 0) { - /// Runtime queries number of devices - if (phDevices != nullptr) { - if (PrintTrace) { - std::cerr << "Invalid Arguments for urDevicesGet\n"; - } - return UR_RESULT_ERROR_INVALID_VALUE; - } - return UR_RESULT_SUCCESS; - } - - if (DeviceCount == 0) { - /// No CPU entry to fill 'Device' array - return UR_RESULT_SUCCESS; - } - - if (phDevices) { - phDevices[0] = &hPlatform->TheDevice; - } - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, - ur_device_info_t propName, - size_t propSize, - void *pPropValue, - size_t *pPropSizeRet) { - UR_ASSERT(hDevice, UR_RESULT_ERROR_INVALID_NULL_HANDLE); - UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); - - switch (propName) { - case UR_DEVICE_INFO_TYPE: - return ReturnValue(UR_DEVICE_TYPE_CPU); - case UR_DEVICE_INFO_PARENT_DEVICE: - return ReturnValue(nullptr); - case UR_DEVICE_INFO_PLATFORM: - return ReturnValue(hDevice->Platform); - case UR_DEVICE_INFO_NAME: - return ReturnValue("SYCL Native CPU"); - case UR_DEVICE_INFO_IMAGE_SUPPORTED: - return ReturnValue(bool{false}); - case UR_DEVICE_INFO_DRIVER_VERSION: - return ReturnValue("0.0.0"); - case UR_DEVICE_INFO_VENDOR: - return ReturnValue("Intel(R) Corporation"); - case UR_DEVICE_INFO_BACKEND_RUNTIME_VERSION: - // TODO : CHECK - return ReturnValue("0.0.0"); - case UR_DEVICE_INFO_IMAGE2D_MAX_WIDTH: - return ReturnValue(size_t{8192}); - case UR_DEVICE_INFO_IMAGE2D_MAX_HEIGHT: - return ReturnValue(size_t{8192}); - case UR_DEVICE_INFO_IMAGE_MAX_BUFFER_SIZE: - return ReturnValue(size_t(65536 /*todo: min if aspect::image*/)); - case UR_DEVICE_INFO_MAX_SAMPLERS: - return ReturnValue(uint32_t{16 /*todo: min if aspect::image*/}); - case UR_DEVICE_INFO_HOST_UNIFIED_MEMORY: - return ReturnValue(bool{1}); - case UR_DEVICE_INFO_EXTENSIONS: - // TODO : Populate return string accordingly - e.g. cl_khr_fp16, - // cl_khr_fp64, cl_khr_int64_base_atomics, - // cl_khr_int64_extended_atomics - return ReturnValue("cl_khr_fp64 "); - case UR_DEVICE_INFO_VERSION: - return ReturnValue("0.1"); - case UR_DEVICE_INFO_COMPILER_AVAILABLE: - return ReturnValue(bool{false}); - case UR_DEVICE_INFO_LINKER_AVAILABLE: - return ReturnValue(bool{false}); - case UR_DEVICE_INFO_MAX_COMPUTE_UNITS: - return ReturnValue(uint32_t{256}); - case UR_DEVICE_INFO_PARTITION_MAX_SUB_DEVICES: - return ReturnValue(uint32_t{0}); - case UR_DEVICE_INFO_SUPPORTED_PARTITIONS: - // TODO: Ensure this property is tested correctly - // Taken from CUDA ur adapter - if (pPropSizeRet) { - *pPropSizeRet = 0; - } - return UR_RESULT_SUCCESS; - case UR_DEVICE_INFO_VENDOR_ID: - // '0x8086' : 'Intel HD graphics vendor ID' - return ReturnValue(uint32_t{0x8086}); - case UR_DEVICE_INFO_MAX_WORK_GROUP_SIZE: - return ReturnValue(size_t{256}); - case UR_DEVICE_INFO_MEM_BASE_ADDR_ALIGN: - // Imported from level_zero - return ReturnValue(uint32_t{8}); - case UR_DEVICE_INFO_IMAGE3D_MAX_WIDTH: - case UR_DEVICE_INFO_IMAGE3D_MAX_HEIGHT: - case UR_DEVICE_INFO_IMAGE3D_MAX_DEPTH: - // Default minimum values required by the SYCL specification. - return ReturnValue(size_t{2048}); - case UR_DEVICE_INFO_HALF_FP_CONFIG: { - // todo: - ur_device_fp_capability_flags_t HalfFPValue = 0; - return ReturnValue(HalfFPValue); - } - case UR_DEVICE_INFO_SINGLE_FP_CONFIG: { - // todo - ur_device_fp_capability_flags_t SingleFPValue = 0; - return ReturnValue(SingleFPValue); - } - case UR_DEVICE_INFO_DOUBLE_FP_CONFIG: { - ur_device_fp_capability_flags_t DoubleFPValue = 0; - return ReturnValue(DoubleFPValue); - } - case UR_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS: - return ReturnValue(uint32_t{3}); - case UR_DEVICE_INFO_PARTITION_TYPE: - return ReturnValue(ur_device_partition_property_t{}); - case UR_EXT_DEVICE_INFO_OPENCL_C_VERSION: - return ReturnValue(""); - case UR_DEVICE_INFO_QUEUE_PROPERTIES: - return ReturnValue( - ur_queue_flag_t(UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE | - UR_QUEUE_FLAG_PROFILING_ENABLE)); - case UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES: { - struct { - size_t Arr[3]; - } MaxGroupSize = {{256, 256, 1}}; - return ReturnValue(MaxGroupSize); - } - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_CHAR: - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_SHORT: - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_INT: - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG: - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_FLOAT: - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_DOUBLE: - case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_HALF: - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_CHAR: - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_SHORT: - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT: - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG: - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT: - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_DOUBLE: - case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_HALF: - return ReturnValue(uint32_t{1}); - - // Imported from level_zero - case UR_DEVICE_INFO_USM_HOST_SUPPORT: - case UR_DEVICE_INFO_USM_DEVICE_SUPPORT: - case UR_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT: - case UR_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT: - case UR_DEVICE_INFO_USM_SYSTEM_SHARED_SUPPORT: { - uint64_t Supported = 0; - // TODO[1.0]: how to query for USM support now? - if (true) { - // TODO: Use ze_memory_access_capabilities_t - Supported = UR_DEVICE_USM_ACCESS_CAPABILITY_FLAG_ACCESS | - UR_DEVICE_USM_ACCESS_CAPABILITY_FLAG_ATOMIC_ACCESS | - UR_DEVICE_USM_ACCESS_CAPABILITY_FLAG_CONCURRENT_ACCESS | - UR_DEVICE_USM_ACCESS_CAPABILITY_FLAG_ATOMIC_CONCURRENT_ACCESS; - } - return ReturnValue(Supported); - } - case UR_DEVICE_INFO_ADDRESS_BITS: - return ReturnValue( - uint32_t{sizeof(void *) * std::numeric_limits::digits}); - case UR_DEVICE_INFO_MAX_CLOCK_FREQUENCY: - return ReturnValue(uint32_t{1000}); - case UR_DEVICE_INFO_ENDIAN_LITTLE: - return ReturnValue(bool{true}); - case UR_DEVICE_INFO_AVAILABLE: - return ReturnValue(bool{true}); - case UR_DEVICE_INFO_MAX_READ_IMAGE_ARGS: - case UR_DEVICE_INFO_MAX_WRITE_IMAGE_ARGS: - /// TODO : Check - return ReturnValue(uint32_t{0}); - case UR_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE: - /// TODO : Check - return ReturnValue(size_t{0}); - case UR_DEVICE_INFO_MAX_PARAMETER_SIZE: - /// TODO : Check - return ReturnValue(size_t{32}); - case UR_DEVICE_INFO_GLOBAL_MEM_CACHE_TYPE: - return ReturnValue(UR_DEVICE_MEM_CACHE_TYPE_READ_WRITE_CACHE); - case UR_DEVICE_INFO_GLOBAL_MEM_CACHELINE_SIZE: - // TODO : CHECK - return ReturnValue(uint32_t{64}); - case UR_DEVICE_INFO_GLOBAL_MEM_CACHE_SIZE: - // TODO : CHECK - return ReturnValue(uint64_t{0}); - case UR_DEVICE_INFO_GLOBAL_MEM_SIZE: - // TODO : CHECK - return ReturnValue(uint64_t{0}); - case UR_DEVICE_INFO_LOCAL_MEM_SIZE: - // TODO : CHECK - return ReturnValue(uint64_t{0}); - case UR_DEVICE_INFO_MAX_CONSTANT_BUFFER_SIZE: - // TODO : CHECK - return ReturnValue(uint64_t{0}); - case UR_DEVICE_INFO_MAX_CONSTANT_ARGS: - // TODO : CHECK - return ReturnValue(uint32_t{64}); - case UR_DEVICE_INFO_LOCAL_MEM_TYPE: - // TODO : CHECK - return ReturnValue(UR_DEVICE_LOCAL_MEM_TYPE_LOCAL); - case UR_DEVICE_INFO_ERROR_CORRECTION_SUPPORT: - return ReturnValue(bool{false}); - case UR_DEVICE_INFO_PROFILING_TIMER_RESOLUTION: - // TODO : CHECK - return ReturnValue(size_t{0}); - case UR_DEVICE_INFO_BUILT_IN_KERNELS: - // TODO : CHECK - return ReturnValue(""); - case UR_DEVICE_INFO_PRINTF_BUFFER_SIZE: - // TODO : CHECK - return ReturnValue(size_t{1024}); - case UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC: - return ReturnValue(bool{false}); - case UR_DEVICE_INFO_PARTITION_AFFINITY_DOMAIN: - return ReturnValue(ur_device_affinity_domain_flags_t{0}); - case UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE: - // TODO : CHECK - return ReturnValue(uint64_t{0}); - case UR_DEVICE_INFO_EXECUTION_CAPABILITIES: - // TODO : CHECK - return ReturnValue(ur_device_exec_capability_flags_t{ - UR_DEVICE_EXEC_CAPABILITY_FLAG_KERNEL}); - case UR_DEVICE_INFO_PROFILE: - return ReturnValue("FULL_PROFILE"); - case UR_DEVICE_INFO_REFERENCE_COUNT: - // TODO : CHECK - return ReturnValue(uint32_t{0}); - case UR_DEVICE_INFO_BUILD_ON_SUBDEVICE: - return ReturnValue(bool{0}); - case UR_DEVICE_INFO_ATOMIC_64: - return ReturnValue(bool{0}); - case UR_DEVICE_INFO_BFLOAT16: - return ReturnValue(bool{0}); - case UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT: - return ReturnValue(bool{0}); - case UR_DEVICE_INFO_IMAGE_SRGB: - return ReturnValue(bool{0}); - case UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL: - return ReturnValue(uint32_t{1}); - case UR_DEVICE_INFO_GPU_EU_COUNT: - case UR_DEVICE_INFO_PCI_ADDRESS: - case UR_DEVICE_INFO_GPU_EU_SLICES: - case UR_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE: - case UR_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE: - case UR_DEVICE_INFO_GPU_EU_SIMD_WIDTH: - case UR_DEVICE_INFO_GPU_HW_THREADS_PER_EU: - case UR_DEVICE_INFO_UUID: - case UR_DEVICE_INFO_DEVICE_ID: - case UR_DEVICE_INFO_MAX_NUM_SUB_GROUPS: - case UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS: - case UR_DEVICE_INFO_IL_VERSION: - case UR_DEVICE_INFO_MAX_WORK_GROUPS_3D: - case UR_DEVICE_INFO_MEMORY_CLOCK_RATE: - case UR_DEVICE_INFO_MEMORY_BUS_WIDTH: - return UR_RESULT_ERROR_INVALID_VALUE; - case UR_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES: { - ur_memory_order_capability_flags_t Capabilities = - UR_MEMORY_ORDER_CAPABILITY_FLAG_RELAXED | - UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQUIRE | - UR_MEMORY_ORDER_CAPABILITY_FLAG_RELEASE | - UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQ_REL; - return ReturnValue(Capabilities); - } - case UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: { - uint64_t Capabilities = UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_ITEM | - UR_MEMORY_SCOPE_CAPABILITY_FLAG_SUB_GROUP | - UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_GROUP | - UR_MEMORY_SCOPE_CAPABILITY_FLAG_DEVICE; - return ReturnValue(Capabilities); - } - case UR_DEVICE_INFO_ESIMD_SUPPORT: - return ReturnValue(false); - - CASE_UR_UNSUPPORTED(UR_DEVICE_INFO_MAX_MEMORY_BANDWIDTH); - - default: - DIE_NO_IMPLEMENTATION; - } - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urDeviceRetain(ur_device_handle_t hDevice) { - UR_ASSERT(hDevice, UR_RESULT_ERROR_INVALID_NULL_HANDLE) - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urDeviceRelease(ur_device_handle_t hDevice) { - UR_ASSERT(hDevice, UR_RESULT_ERROR_INVALID_NULL_HANDLE) - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urDevicePartition( - ur_device_handle_t hDevice, - const ur_device_partition_properties_t *pProperties, uint32_t NumDevices, - ur_device_handle_t *phSubDevices, uint32_t *pNumDevicesRet) { - std::ignore = hDevice; - std::ignore = NumDevices; - std::ignore = pProperties; - std::ignore = phSubDevices; - std::ignore = pNumDevicesRet; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetNativeHandle( - ur_device_handle_t hDevice, ur_native_handle_t *phNativeDevice) { - std::ignore = hDevice; - std::ignore = phNativeDevice; - - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( - ur_native_handle_t hNativeDevice, ur_platform_handle_t hPlatform, - const ur_device_native_properties_t *pProperties, - ur_device_handle_t *phDevice) { - std::ignore = hNativeDevice; - std::ignore = hPlatform; - std::ignore = pProperties; - std::ignore = phDevice; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetGlobalTimestamps( - ur_device_handle_t hDevice, uint64_t *pDeviceTimestamp, - uint64_t *pHostTimestamp) { - std::ignore = hDevice; // todo - if (pHostTimestamp) { - using namespace std::chrono; - *pHostTimestamp = - duration_cast(steady_clock::now().time_since_epoch()) - .count(); - } - if (pDeviceTimestamp) { - // todo: calculate elapsed time properly - using namespace std::chrono; - *pDeviceTimestamp = - duration_cast(steady_clock::now().time_since_epoch()) - .count(); - } - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urDeviceSelectBinary( - ur_device_handle_t hDevice, const ur_device_binary_t *pBinaries, - uint32_t NumBinaries, uint32_t *pSelectedBinary) { - std::ignore = hDevice; - std::ignore = pBinaries; - std::ignore = NumBinaries; - std::ignore = pSelectedBinary; - -#define UR_DEVICE_BINARY_TARGET_NATIVE_CPU "native_cpu" - // look for a binary with type "native_cpu" - // Todo: error checking - // Todo: define UR_DEVICE_BINARY_TARGET_NATIVE_CPU in upstream - const char *image_target = UR_DEVICE_BINARY_TARGET_NATIVE_CPU; - for (uint32_t i = 0; i < NumBinaries; ++i) { - if (strcmp(pBinaries[i].pDeviceTargetSpec, image_target) == 0) { - *pSelectedBinary = i; - return UR_RESULT_SUCCESS; - } - } - - // No image can be loaded for the given device - return UR_RESULT_ERROR_INVALID_BINARY; -} diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/device.hpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/device.hpp deleted file mode 100644 index 5e30e56fe107e..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/device.hpp +++ /dev/null @@ -1,17 +0,0 @@ -//===--------- device.hpp - Native CPU Adapter ----------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#pragma once - -#include - -struct ur_device_handle_t_ { - ur_device_handle_t_(ur_platform_handle_t ArgPlt) : Platform(ArgPlt) {} - - ur_platform_handle_t Platform; -}; diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/enqueue.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/enqueue.cpp deleted file mode 100644 index fc9e5f545e0d9..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/enqueue.cpp +++ /dev/null @@ -1,531 +0,0 @@ -//===----------- enqueue.cpp - NATIVE CPU Adapter -------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include -#include - -#include "ur_api.h" - -#include "common.hpp" -#include "kernel.hpp" -#include "memory.hpp" - -namespace native_cpu { -struct NDRDescT { - using RangeT = std::array; - uint32_t WorkDim; - RangeT GlobalOffset; - RangeT GlobalSize; - RangeT LocalSize; - NDRDescT(uint32_t WorkDim, const size_t *GlobalWorkOffset, - const size_t *GlobalWorkSize, const size_t *LocalWorkSize) { - for (uint32_t I = 0; I < WorkDim; I++) { - GlobalOffset[I] = GlobalWorkOffset[I]; - GlobalSize[I] = GlobalWorkSize[I]; - LocalSize[I] = LocalWorkSize[I]; - } - for (uint32_t I = WorkDim; I < 3; I++) { - GlobalSize[I] = 1; - LocalSize[I] = LocalSize[0] ? 1 : 0; - GlobalOffset[I] = 0; - } - } -}; -} // namespace native_cpu - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueKernelLaunch( - ur_queue_handle_t hQueue, ur_kernel_handle_t hKernel, uint32_t workDim, - const size_t *pGlobalWorkOffset, const size_t *pGlobalWorkSize, - const size_t *pLocalWorkSize, uint32_t numEventsInWaitList, - const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - UR_ASSERT(hQueue, UR_RESULT_ERROR_INVALID_NULL_HANDLE); - UR_ASSERT(hKernel, UR_RESULT_ERROR_INVALID_NULL_HANDLE); - UR_ASSERT(pGlobalWorkOffset, UR_RESULT_ERROR_INVALID_NULL_POINTER); - UR_ASSERT(workDim > 0, UR_RESULT_ERROR_INVALID_WORK_DIMENSION); - UR_ASSERT(workDim < 4, UR_RESULT_ERROR_INVALID_WORK_DIMENSION); - - if (*pGlobalWorkSize == 0) { - DIE_NO_IMPLEMENTATION; - } - - // TODO: add proper error checking - // TODO: add proper event dep management - native_cpu::NDRDescT ndr(workDim, pGlobalWorkOffset, pGlobalWorkSize, - pLocalWorkSize); - hKernel->handleLocalArgs(); - - native_cpu::state state(ndr.GlobalSize[0], ndr.GlobalSize[1], - ndr.GlobalSize[2], ndr.LocalSize[0], ndr.LocalSize[1], - ndr.LocalSize[2], ndr.GlobalOffset[0], - ndr.GlobalOffset[1], ndr.GlobalOffset[2]); - - auto numWG0 = ndr.GlobalSize[0] / ndr.LocalSize[0]; - auto numWG1 = ndr.GlobalSize[1] / ndr.LocalSize[1]; - auto numWG2 = ndr.GlobalSize[2] / ndr.LocalSize[2]; - for (unsigned g2 = 0; g2 < numWG2; g2++) { - for (unsigned g1 = 0; g1 < numWG1; g1++) { - for (unsigned g0 = 0; g0 < numWG0; g0++) { - for (unsigned local2 = 0; local2 < ndr.LocalSize[2]; local2++) { - for (unsigned local1 = 0; local1 < ndr.LocalSize[1]; local1++) { - for (unsigned local0 = 0; local0 < ndr.LocalSize[0]; local0++) { - state.update(g0, g1, g2, local0, local1, local2); - hKernel->_subhandler(hKernel->_args.data(), &state); - } - } - } - } - } - } - // TODO: we should avoid calling clear here by avoiding using push_back - // in setKernelArgs. - hKernel->_args.clear(); - hKernel->_localArgInfo.clear(); - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueEventsWait( - ur_queue_handle_t hQueue, uint32_t numEventsInWaitList, - const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { - std::ignore = hQueue; - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier( - ur_queue_handle_t hQueue, uint32_t numEventsInWaitList, - const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { - std::ignore = hQueue; - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - DIE_NO_IMPLEMENTATION; -} - -template -static inline ur_result_t enqueueMemBufferReadWriteRect_impl( - ur_queue_handle_t, ur_mem_handle_t Buff, bool, - ur_rect_offset_t BufferOffset, ur_rect_offset_t HostOffset, - ur_rect_region_t region, size_t BufferRowPitch, size_t BufferSlicePitch, - size_t HostRowPitch, size_t HostSlicePitch, - typename std::conditional::type DstMem, - uint32_t, const ur_event_handle_t *, ur_event_handle_t *) { - // TODO: events, blocking, check other constraints, performance optimizations - // More sharing with level_zero where possible - - if (BufferRowPitch == 0) - BufferRowPitch = region.width; - if (BufferSlicePitch == 0) - BufferSlicePitch = BufferRowPitch * region.height; - if (HostRowPitch == 0) - HostRowPitch = region.width; - if (HostSlicePitch == 0) - HostSlicePitch = HostRowPitch * region.height; - for (size_t w = 0; w < region.width; w++) - for (size_t h = 0; h < region.height; h++) - for (size_t d = 0; d < region.depth; d++) { - size_t buff_orign = (d + BufferOffset.z) * BufferSlicePitch + - (h + BufferOffset.y) * BufferRowPitch + w + - BufferOffset.x; - size_t host_origin = (d + HostOffset.z) * HostSlicePitch + - (h + HostOffset.y) * HostRowPitch + w + - HostOffset.x; - int8_t &host_mem = ur_cast(DstMem)[host_origin]; - int8_t &buff_mem = ur_cast(Buff->_mem)[buff_orign]; - if (IsRead) - host_mem = buff_mem; - else - buff_mem = host_mem; - } - return UR_RESULT_SUCCESS; -} - -static inline ur_result_t doCopy_impl(ur_queue_handle_t hQueue, void *DstPtr, - const void *SrcPtr, size_t Size, - uint32_t numEventsInWaitList, - const ur_event_handle_t *EventWaitList, - ur_event_handle_t *Event) { - // todo: non-blocking, events, UR integration - std::ignore = hQueue; - std::ignore = numEventsInWaitList; - if (SrcPtr != DstPtr && Size) - memmove(DstPtr, SrcPtr, Size); - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferRead( - ur_queue_handle_t hQueue, ur_mem_handle_t hBuffer, bool blockingRead, - size_t offset, size_t size, void *pDst, uint32_t numEventsInWaitList, - const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { - std::ignore = blockingRead; - - void *FromPtr = /*Src*/ hBuffer->_mem + offset; - return doCopy_impl(hQueue, pDst, FromPtr, size, numEventsInWaitList, - phEventWaitList, phEvent); -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferWrite( - ur_queue_handle_t hQueue, ur_mem_handle_t hBuffer, bool blockingWrite, - size_t offset, size_t size, const void *pSrc, uint32_t numEventsInWaitList, - const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { - std::ignore = blockingWrite; - - void *ToPtr = hBuffer->_mem + offset; - return doCopy_impl(hQueue, ToPtr, pSrc, size, numEventsInWaitList, - phEventWaitList, phEvent); -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferReadRect( - ur_queue_handle_t hQueue, ur_mem_handle_t hBuffer, bool blockingRead, - ur_rect_offset_t bufferOrigin, ur_rect_offset_t hostOrigin, - ur_rect_region_t region, size_t bufferRowPitch, size_t bufferSlicePitch, - size_t hostRowPitch, size_t hostSlicePitch, void *pDst, - uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList, - ur_event_handle_t *phEvent) { - return enqueueMemBufferReadWriteRect_impl( - hQueue, hBuffer, blockingRead, bufferOrigin, hostOrigin, region, - bufferRowPitch, bufferSlicePitch, hostRowPitch, hostSlicePitch, pDst, - numEventsInWaitList, phEventWaitList, phEvent); -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferWriteRect( - ur_queue_handle_t hQueue, ur_mem_handle_t hBuffer, bool blockingWrite, - ur_rect_offset_t bufferOrigin, ur_rect_offset_t hostOrigin, - ur_rect_region_t region, size_t bufferRowPitch, size_t bufferSlicePitch, - size_t hostRowPitch, size_t hostSlicePitch, void *pSrc, - uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList, - ur_event_handle_t *phEvent) { - return enqueueMemBufferReadWriteRect_impl( - hQueue, hBuffer, blockingWrite, bufferOrigin, hostOrigin, region, - bufferRowPitch, bufferSlicePitch, hostRowPitch, hostSlicePitch, pSrc, - numEventsInWaitList, phEventWaitList, phEvent); -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferCopy( - ur_queue_handle_t hQueue, ur_mem_handle_t hBufferSrc, - ur_mem_handle_t hBufferDst, size_t srcOffset, size_t dstOffset, size_t size, - uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList, - ur_event_handle_t *phEvent) { - const void *SrcPtr = hBufferSrc->_mem + srcOffset; - void *DstPtr = hBufferDst->_mem + dstOffset; - return doCopy_impl(hQueue, DstPtr, SrcPtr, size, numEventsInWaitList, - phEventWaitList, phEvent); -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferCopyRect( - ur_queue_handle_t hQueue, ur_mem_handle_t hBufferSrc, - ur_mem_handle_t hBufferDst, ur_rect_offset_t srcOrigin, - ur_rect_offset_t dstOrigin, ur_rect_region_t region, size_t srcRowPitch, - size_t srcSlicePitch, size_t dstRowPitch, size_t dstSlicePitch, - uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList, - ur_event_handle_t *phEvent) { - return enqueueMemBufferReadWriteRect_impl( - hQueue, hBufferSrc, false /*todo: check blocking*/, srcOrigin, - /*HostOffset*/ dstOrigin, region, srcRowPitch, srcSlicePitch, dstRowPitch, - dstSlicePitch, hBufferDst->_mem, numEventsInWaitList, phEventWaitList, - phEvent); -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferFill( - ur_queue_handle_t hQueue, ur_mem_handle_t hBuffer, const void *pPattern, - size_t patternSize, size_t offset, size_t size, - uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList, - ur_event_handle_t *phEvent) { - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - UR_ASSERT(hQueue, UR_RESULT_ERROR_INVALID_NULL_HANDLE); - - // TODO: error checking - // TODO: handle async - void *startingPtr = hBuffer->_mem + offset; - unsigned steps = size / patternSize; - for (unsigned i = 0; i < steps; i++) { - memcpy(static_cast(startingPtr) + i * patternSize, pPattern, - patternSize); - } - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageRead( - ur_queue_handle_t hQueue, ur_mem_handle_t hImage, bool blockingRead, - ur_rect_offset_t origin, ur_rect_region_t region, size_t rowPitch, - size_t slicePitch, void *pDst, uint32_t numEventsInWaitList, - const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { - std::ignore = hQueue; - std::ignore = hImage; - std::ignore = blockingRead; - std::ignore = origin; - std::ignore = region; - std::ignore = rowPitch; - std::ignore = slicePitch; - std::ignore = pDst; - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageWrite( - ur_queue_handle_t hQueue, ur_mem_handle_t hImage, bool blockingWrite, - ur_rect_offset_t origin, ur_rect_region_t region, size_t rowPitch, - size_t slicePitch, void *pSrc, uint32_t numEventsInWaitList, - const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { - std::ignore = hQueue; - std::ignore = hImage; - std::ignore = blockingWrite; - std::ignore = origin; - std::ignore = region; - std::ignore = rowPitch; - std::ignore = slicePitch; - std::ignore = pSrc; - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageCopy( - ur_queue_handle_t hQueue, ur_mem_handle_t hImageSrc, - ur_mem_handle_t hImageDst, ur_rect_offset_t srcOrigin, - ur_rect_offset_t dstOrigin, ur_rect_region_t region, - uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList, - ur_event_handle_t *phEvent) { - std::ignore = hQueue; - std::ignore = hImageSrc; - std::ignore = hImageDst; - std::ignore = srcOrigin; - std::ignore = dstOrigin; - std::ignore = region; - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferMap( - ur_queue_handle_t hQueue, ur_mem_handle_t hBuffer, bool blockingMap, - ur_map_flags_t mapFlags, size_t offset, size_t size, - uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList, - ur_event_handle_t *phEvent, void **ppRetMap) { - std::ignore = hQueue; - std::ignore = blockingMap; - std::ignore = mapFlags; - std::ignore = size; - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - *ppRetMap = hBuffer->_mem + offset; - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemUnmap( - ur_queue_handle_t hQueue, ur_mem_handle_t hMem, void *pMappedPtr, - uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList, - ur_event_handle_t *phEvent) { - std::ignore = hQueue; - std::ignore = hMem; - std::ignore = pMappedPtr; - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMFill( - ur_queue_handle_t hQueue, void *ptr, size_t patternSize, - const void *pPattern, size_t size, uint32_t numEventsInWaitList, - const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { - std::ignore = hQueue; - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - UR_ASSERT(ptr, UR_RESULT_ERROR_INVALID_NULL_POINTER); - UR_ASSERT(pPattern, UR_RESULT_ERROR_INVALID_NULL_POINTER); - UR_ASSERT(size % patternSize == 0 || patternSize > size, - UR_RESULT_ERROR_INVALID_SIZE); - - memset(ptr, *static_cast(pPattern), size * patternSize); - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMMemcpy( - ur_queue_handle_t hQueue, bool blocking, void *pDst, const void *pSrc, - size_t size, uint32_t numEventsInWaitList, - const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { - std::ignore = hQueue; - std::ignore = blocking; - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - UR_ASSERT(hQueue, UR_RESULT_ERROR_INVALID_QUEUE); - UR_ASSERT(pDst, UR_RESULT_ERROR_INVALID_NULL_POINTER); - UR_ASSERT(pSrc, UR_RESULT_ERROR_INVALID_NULL_POINTER); - - memcpy(pDst, pSrc, size); - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMPrefetch( - ur_queue_handle_t hQueue, const void *pMem, size_t size, - ur_usm_migration_flags_t flags, uint32_t numEventsInWaitList, - const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { - std::ignore = hQueue; - std::ignore = pMem; - std::ignore = size; - std::ignore = flags; - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size, - ur_usm_advice_flags_t advice, ur_event_handle_t *phEvent) { - std::ignore = hQueue; - std::ignore = pMem; - std::ignore = size; - std::ignore = advice; - std::ignore = phEvent; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMFill2D( - ur_queue_handle_t hQueue, void *pMem, size_t pitch, size_t patternSize, - const void *pPattern, size_t width, size_t height, - uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList, - ur_event_handle_t *phEvent) { - std::ignore = hQueue; - std::ignore = pMem; - std::ignore = pitch; - std::ignore = patternSize; - std::ignore = pPattern; - std::ignore = width; - std::ignore = height; - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMMemcpy2D( - ur_queue_handle_t hQueue, bool blocking, void *pDst, size_t dstPitch, - const void *pSrc, size_t srcPitch, size_t width, size_t height, - uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList, - ur_event_handle_t *phEvent) { - std::ignore = hQueue; - std::ignore = blocking; - std::ignore = pDst; - std::ignore = dstPitch; - std::ignore = pSrc; - std::ignore = srcPitch; - std::ignore = width; - std::ignore = height; - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableWrite( - ur_queue_handle_t hQueue, ur_program_handle_t hProgram, const char *name, - bool blockingWrite, size_t count, size_t offset, const void *pSrc, - uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList, - ur_event_handle_t *phEvent) { - std::ignore = hQueue; - std::ignore = hProgram; - std::ignore = name; - std::ignore = blockingWrite; - std::ignore = count; - std::ignore = offset; - std::ignore = pSrc; - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableRead( - ur_queue_handle_t hQueue, ur_program_handle_t hProgram, const char *name, - bool blockingRead, size_t count, size_t offset, void *pDst, - uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList, - ur_event_handle_t *phEvent) { - std::ignore = hQueue; - std::ignore = hProgram; - std::ignore = name; - std::ignore = blockingRead; - std::ignore = count; - std::ignore = offset; - std::ignore = pDst; - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueReadHostPipe( - ur_queue_handle_t hQueue, ur_program_handle_t hProgram, - const char *pipe_symbol, bool blocking, void *pDst, size_t size, - uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList, - ur_event_handle_t *phEvent) { - std::ignore = hQueue; - std::ignore = hProgram; - std::ignore = pipe_symbol; - std::ignore = blocking; - std::ignore = pDst; - std::ignore = size; - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEnqueueWriteHostPipe( - ur_queue_handle_t hQueue, ur_program_handle_t hProgram, - const char *pipe_symbol, bool blocking, void *pSrc, size_t size, - uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList, - ur_event_handle_t *phEvent) { - std::ignore = hQueue; - std::ignore = hProgram; - std::ignore = pipe_symbol; - std::ignore = blocking; - std::ignore = pSrc; - std::ignore = size; - std::ignore = numEventsInWaitList; - std::ignore = phEventWaitList; - std::ignore = phEvent; - - DIE_NO_IMPLEMENTATION; -} diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/event.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/event.cpp deleted file mode 100644 index 901d10c95cf0f..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/event.cpp +++ /dev/null @@ -1,87 +0,0 @@ -//===--------- event.cpp - NATIVE CPU Adapter -----------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "ur_api.h" - -#include "common.hpp" - -UR_APIEXPORT ur_result_t UR_APICALL urEventGetInfo(ur_event_handle_t hEvent, - ur_event_info_t propName, - size_t propSize, - void *pPropValue, - size_t *pPropSizeRet) { - std::ignore = hEvent; - std::ignore = propName; - std::ignore = propSize; - std::ignore = pPropValue; - std::ignore = pPropSizeRet; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEventGetProfilingInfo( - ur_event_handle_t hEvent, ur_profiling_info_t propName, size_t propSize, - void *pPropValue, size_t *pPropSizeRet) { - std::ignore = hEvent; - std::ignore = propName; - std::ignore = propSize; - std::ignore = pPropValue; - std::ignore = pPropSizeRet; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urEventWait(uint32_t numEvents, const ur_event_handle_t *phEventWaitList) { - std::ignore = numEvents; - std::ignore = phEventWaitList; - // TODO: currently we do everything synchronously so this is a no-op - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEventRetain(ur_event_handle_t hEvent) { - std::ignore = hEvent; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEventRelease(ur_event_handle_t hEvent) { - std::ignore = hEvent; - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEventGetNativeHandle( - ur_event_handle_t hEvent, ur_native_handle_t *phNativeEvent) { - std::ignore = hEvent; - std::ignore = phNativeEvent; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urEventCreateWithNativeHandle( - ur_native_handle_t hNativeEvent, ur_context_handle_t hContext, - const ur_event_native_properties_t *pProperties, - ur_event_handle_t *phEvent) { - std::ignore = hNativeEvent; - std::ignore = hContext; - std::ignore = pProperties; - std::ignore = phEvent; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urEventSetCallback(ur_event_handle_t hEvent, ur_execution_info_t execStatus, - ur_event_callback_t pfnNotify, void *pUserData) { - std::ignore = hEvent; - std::ignore = execStatus; - std::ignore = pfnNotify; - std::ignore = pUserData; - - DIE_NO_IMPLEMENTATION; -} diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/image.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/image.cpp deleted file mode 100644 index 72a7174e38eff..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/image.cpp +++ /dev/null @@ -1,173 +0,0 @@ -//===--------- image.cpp - NativeCPU Adapter ------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===-----------------------------------------------------------------===// - -#include "ur/ur.hpp" - -UR_APIEXPORT ur_result_t UR_APICALL urUSMPitchedAllocExp( - [[maybe_unused]] ur_context_handle_t hContext, - [[maybe_unused]] ur_device_handle_t hDevice, - [[maybe_unused]] const ur_usm_desc_t *pUSMDesc, - [[maybe_unused]] ur_usm_pool_handle_t pool, - [[maybe_unused]] size_t widthInBytes, [[maybe_unused]] size_t height, - [[maybe_unused]] size_t elementSizeBytes, [[maybe_unused]] void **ppMem, - [[maybe_unused]] size_t *pResultPitch) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urBindlessImagesUnsampledImageHandleDestroyExp( - [[maybe_unused]] ur_context_handle_t hContext, - [[maybe_unused]] ur_device_handle_t hDevice, - [[maybe_unused]] ur_exp_image_handle_t hImage) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urBindlessImagesSampledImageHandleDestroyExp( - [[maybe_unused]] ur_context_handle_t hContext, - [[maybe_unused]] ur_device_handle_t hDevice, - [[maybe_unused]] ur_exp_image_handle_t hImage) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( - [[maybe_unused]] ur_context_handle_t hContext, - [[maybe_unused]] ur_device_handle_t hDevice, - [[maybe_unused]] const ur_image_format_t *pImageFormat, - [[maybe_unused]] const ur_image_desc_t *pImageDesc, - [[maybe_unused]] ur_exp_image_mem_handle_t *phImageMem) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageFreeExp( - [[maybe_unused]] ur_context_handle_t hContext, - [[maybe_unused]] ur_device_handle_t hDevice, - [[maybe_unused]] ur_exp_image_mem_handle_t hImageMem) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( - [[maybe_unused]] ur_context_handle_t hContext, - [[maybe_unused]] ur_device_handle_t hDevice, - [[maybe_unused]] ur_exp_image_mem_handle_t hImageMem, - [[maybe_unused]] const ur_image_format_t *pImageFormat, - [[maybe_unused]] const ur_image_desc_t *pImageDesc, - [[maybe_unused]] ur_mem_handle_t *phMem, - [[maybe_unused]] ur_exp_image_handle_t *phImage) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( - [[maybe_unused]] ur_context_handle_t hContext, - [[maybe_unused]] ur_device_handle_t hDevice, - [[maybe_unused]] ur_exp_image_mem_handle_t hImageMem, - [[maybe_unused]] const ur_image_format_t *pImageFormat, - [[maybe_unused]] const ur_image_desc_t *pImageDesc, - [[maybe_unused]] ur_sampler_handle_t hSampler, - [[maybe_unused]] ur_mem_handle_t *phMem, - [[maybe_unused]] ur_exp_image_handle_t *phImage) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp( - [[maybe_unused]] ur_queue_handle_t hQueue, [[maybe_unused]] void *pDst, - [[maybe_unused]] void *pSrc, - [[maybe_unused]] const ur_image_format_t *pImageFormat, - [[maybe_unused]] const ur_image_desc_t *pImageDesc, - [[maybe_unused]] ur_exp_image_copy_flags_t imageCopyFlags, - [[maybe_unused]] ur_rect_offset_t srcOffset, - [[maybe_unused]] ur_rect_offset_t dstOffset, - [[maybe_unused]] ur_rect_region_t copyExtent, - [[maybe_unused]] ur_rect_region_t hostExtent, - [[maybe_unused]] uint32_t numEventsInWaitList, - [[maybe_unused]] const ur_event_handle_t *phEventWaitList, - [[maybe_unused]] ur_event_handle_t *phEvent) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( - [[maybe_unused]] ur_exp_image_mem_handle_t hImageMem, - [[maybe_unused]] ur_image_info_t propName, - [[maybe_unused]] void *pPropValue, [[maybe_unused]] size_t *pPropSizeRet) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( - [[maybe_unused]] ur_context_handle_t hContext, - [[maybe_unused]] ur_device_handle_t hDevice, - [[maybe_unused]] ur_exp_image_mem_handle_t hImageMem, - [[maybe_unused]] uint32_t mipmapLevel, - [[maybe_unused]] ur_exp_image_mem_handle_t *phImageMem) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urBindlessImagesMipmapFreeExp([[maybe_unused]] ur_context_handle_t hContext, - [[maybe_unused]] ur_device_handle_t hDevice, - [[maybe_unused]] ur_exp_image_mem_handle_t hMem) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImportOpaqueFDExp( - [[maybe_unused]] ur_context_handle_t hContext, - [[maybe_unused]] ur_device_handle_t hDevice, [[maybe_unused]] size_t size, - [[maybe_unused]] ur_exp_interop_mem_desc_t *pInteropMemDesc, - [[maybe_unused]] ur_exp_interop_mem_handle_t *phInteropMem) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( - [[maybe_unused]] ur_context_handle_t hContext, - [[maybe_unused]] ur_device_handle_t hDevice, - [[maybe_unused]] const ur_image_format_t *pImageFormat, - [[maybe_unused]] const ur_image_desc_t *pImageDesc, - [[maybe_unused]] ur_exp_interop_mem_handle_t hInteropMem, - [[maybe_unused]] ur_exp_image_mem_handle_t *phImageMem) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesReleaseInteropExp( - [[maybe_unused]] ur_context_handle_t hContext, - [[maybe_unused]] ur_device_handle_t hDevice, - [[maybe_unused]] ur_exp_interop_mem_handle_t hInteropMem) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urBindlessImagesImportExternalSemaphoreOpaqueFDExp( - [[maybe_unused]] ur_context_handle_t hContext, - [[maybe_unused]] ur_device_handle_t hDevice, - [[maybe_unused]] ur_exp_interop_semaphore_desc_t *pInteropSemaphoreDesc, - [[maybe_unused]] ur_exp_interop_semaphore_handle_t *phInteropSemaphore) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesDestroyExternalSemaphoreExp( - [[maybe_unused]] ur_context_handle_t hContext, - [[maybe_unused]] ur_device_handle_t hDevice, - [[maybe_unused]] ur_exp_interop_semaphore_handle_t hInteropSemaphore) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesWaitExternalSemaphoreExp( - [[maybe_unused]] ur_queue_handle_t hQueue, - [[maybe_unused]] ur_exp_interop_semaphore_handle_t hSemaphore, - [[maybe_unused]] uint32_t numEventsInWaitList, - [[maybe_unused]] const ur_event_handle_t *phEventWaitList, - [[maybe_unused]] ur_event_handle_t *phEvent) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} - -UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesSignalExternalSemaphoreExp( - [[maybe_unused]] ur_queue_handle_t hQueue, - [[maybe_unused]] ur_exp_interop_semaphore_handle_t hSemaphore, - [[maybe_unused]] uint32_t numEventsInWaitList, - [[maybe_unused]] const ur_event_handle_t *phEventWaitList, - [[maybe_unused]] ur_event_handle_t *phEvent) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; -} diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/kernel.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/kernel.cpp deleted file mode 100644 index 45dcaa7ba42e9..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/kernel.cpp +++ /dev/null @@ -1,282 +0,0 @@ -//===--------------- kernel.cpp - Native CPU Adapter ----------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "ur_api.h" - -#include "common.hpp" -#include "kernel.hpp" -#include "memory.hpp" -#include "program.hpp" - -UR_APIEXPORT ur_result_t UR_APICALL -urKernelCreate(ur_program_handle_t hProgram, const char *pKernelName, - ur_kernel_handle_t *phKernel) { - UR_ASSERT(hProgram, UR_RESULT_ERROR_INVALID_NULL_HANDLE); - UR_ASSERT(pKernelName, UR_RESULT_ERROR_INVALID_NULL_POINTER); - - auto kernelEntry = hProgram->_kernels.find(pKernelName); - if (kernelEntry == hProgram->_kernels.end()) - return UR_RESULT_ERROR_INVALID_KERNEL; - - auto f = reinterpret_cast(kernelEntry->second); - auto kernel = new ur_kernel_handle_t_(pKernelName, *f); - - *phKernel = kernel; - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgValue( - ur_kernel_handle_t hKernel, uint32_t argIndex, size_t argSize, - const ur_kernel_arg_value_properties_t *pProperties, - const void *pArgValue) { - // Todo: error checking - // Todo: I think that the opencl spec (and therefore the pi spec mandates that - // arg is copied (this is why it is defined as const void*, I guess we should - // do it - // TODO: can args arrive out of order? - std::ignore = argIndex; - std::ignore = pProperties; - - UR_ASSERT(hKernel, UR_RESULT_ERROR_INVALID_NULL_HANDLE); - UR_ASSERT(argSize, UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE); - - hKernel->_args.emplace_back(const_cast(pArgValue)); - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgLocal( - ur_kernel_handle_t hKernel, uint32_t argIndex, size_t argSize, - const ur_kernel_arg_local_properties_t *pProperties) { - std::ignore = pProperties; - // emplace a placeholder kernel arg, gets replaced with a pointer to the - // memory pool before enqueueing the kernel. - hKernel->_args.emplace_back(nullptr); - hKernel->_localArgInfo.emplace_back(argIndex, argSize); - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urKernelGetInfo(ur_kernel_handle_t hKernel, - ur_kernel_info_t propName, - size_t propSize, - void *pPropValue, - size_t *pPropSizeRet) { - std::ignore = hKernel; - std::ignore = propName; - std::ignore = pPropValue; - - UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); - // todo: check if we need this - // std::shared_lock Guard(hKernel->Mutex); - switch (propName) { - // case UR_KERNEL_INFO_CONTEXT: - // return ReturnValue(ur_context_handle_t{ hKernel->Program->Context }); - // case UR_KERNEL_INFO_PROGRAM: - // return ReturnValue(ur_program_handle_t{ Kernel->Program }); - case UR_KERNEL_INFO_FUNCTION_NAME: - if (hKernel->_name) { - return ReturnValue(hKernel->_name); - } - return UR_RESULT_ERROR_INVALID_FUNCTION_NAME; - // case UR_KERNEL_INFO_NUM_ARGS: - // return ReturnValue(uint32_t{ Kernel->ZeKernelProperties->numKernelArgs - // }); - case UR_KERNEL_INFO_REFERENCE_COUNT: - return ReturnValue(uint32_t{hKernel->getReferenceCount()}); - case UR_KERNEL_INFO_ATTRIBUTES: - return ReturnValue(""); - default: - return UR_RESULT_ERROR_INVALID_VALUE; - } - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL -urKernelGetGroupInfo(ur_kernel_handle_t hKernel, ur_device_handle_t hDevice, - ur_kernel_group_info_t propName, size_t propSize, - void *pPropValue, size_t *pPropSizeRet) { - std::ignore = hDevice; - - UR_ASSERT(hKernel, UR_RESULT_ERROR_INVALID_NULL_HANDLE); - - UrReturnHelper returnValue(propSize, pPropValue, pPropSizeRet); - - switch (propName) { - case UR_KERNEL_GROUP_INFO_GLOBAL_WORK_SIZE: { - size_t global_work_size[3] = {0, 0, 0}; - return returnValue(global_work_size, 3); - } - case UR_KERNEL_GROUP_INFO_WORK_GROUP_SIZE: { - // todo: set proper values - size_t max_threads = 128; - return returnValue(max_threads); - } - case UR_KERNEL_GROUP_INFO_COMPILE_WORK_GROUP_SIZE: { - size_t group_size[3] = {1, 1, 1}; - return returnValue(group_size, 3); - } - case UR_KERNEL_GROUP_INFO_LOCAL_MEM_SIZE: { - int bytes = 0; - return returnValue(static_cast(bytes)); - } - case UR_KERNEL_GROUP_INFO_PREFERRED_WORK_GROUP_SIZE_MULTIPLE: { - // todo: set proper values - int warpSize = 16; - return returnValue(static_cast(warpSize)); - } - case UR_KERNEL_GROUP_INFO_PRIVATE_MEM_SIZE: { - int bytes = 0; - return returnValue(static_cast(bytes)); - } - - default: - break; - } - - return UR_RESULT_ERROR_INVALID_ENUMERATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urKernelGetSubGroupInfo(ur_kernel_handle_t hKernel, ur_device_handle_t hDevice, - ur_kernel_sub_group_info_t propName, size_t propSize, - void *pPropValue, size_t *pPropSizeRet) { - std::ignore = hKernel; - std::ignore = hDevice; - - UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); - switch (propName) { - case UR_KERNEL_SUB_GROUP_INFO_MAX_SUB_GROUP_SIZE: { - // todo: set proper values - int WarpSize = 8; - return ReturnValue(static_cast(WarpSize)); - } - case UR_KERNEL_SUB_GROUP_INFO_MAX_NUM_SUB_GROUPS: { - // todo: set proper values - int MaxWarps = 32; - return ReturnValue(static_cast(MaxWarps)); - } - case UR_KERNEL_SUB_GROUP_INFO_COMPILE_NUM_SUB_GROUPS: { - // todo: set proper values - return ReturnValue(0); - } - case UR_KERNEL_SUB_GROUP_INFO_SUB_GROUP_SIZE_INTEL: { - // todo: set proper values - return ReturnValue(0); - } - } - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urKernelRetain(ur_kernel_handle_t hKernel) { - hKernel->incrementReferenceCount(); - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urKernelRelease(ur_kernel_handle_t hKernel) { - delete hKernel; - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urKernelSetArgPointer(ur_kernel_handle_t hKernel, uint32_t argIndex, - const ur_kernel_arg_pointer_properties_t *pProperties, - const void *pArgValue) { - // TODO: out_of_order args? - std::ignore = argIndex; - std::ignore = pProperties; - - UR_ASSERT(hKernel, UR_RESULT_ERROR_INVALID_NULL_HANDLE); - UR_ASSERT(pArgValue, UR_RESULT_ERROR_INVALID_NULL_POINTER); - - auto ptrToPtr = reinterpret_cast(pArgValue); - auto derefPtr = reinterpret_cast(*ptrToPtr); - hKernel->_args.push_back(derefPtr); - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urKernelSetExecInfo( - ur_kernel_handle_t hKernel, ur_kernel_exec_info_t propName, size_t propSize, - const ur_kernel_exec_info_properties_t *pProperties, - const void *pPropValue) { - std::ignore = hKernel; - std::ignore = propName; - std::ignore = propSize; - std::ignore = pProperties; - std::ignore = pPropValue; - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urKernelSetArgSampler(ur_kernel_handle_t hKernel, uint32_t argIndex, - const ur_kernel_arg_sampler_properties_t *pProperties, - ur_sampler_handle_t hArgValue) { - std::ignore = hKernel; - std::ignore = argIndex; - std::ignore = pProperties; - std::ignore = hArgValue; - - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL -urKernelSetArgMemObj(ur_kernel_handle_t hKernel, uint32_t argIndex, - const ur_kernel_arg_mem_obj_properties_t *pProperties, - ur_mem_handle_t hArgValue) { - // TODO: out_of_order args? - std::ignore = argIndex; - std::ignore = pProperties; - - UR_ASSERT(hKernel, UR_RESULT_ERROR_INVALID_NULL_HANDLE); - - // Taken from ur/adapters/cuda/kernel.cpp - // zero-sized buffers are expected to be null. - if (hArgValue == nullptr) { - hKernel->_args.emplace_back(nullptr); - return UR_RESULT_SUCCESS; - } - - hKernel->_args.emplace_back(hArgValue->_mem); - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urKernelSetSpecializationConstants( - ur_kernel_handle_t hKernel, uint32_t count, - const ur_specialization_constant_info_t *pSpecConstants) { - std::ignore = hKernel; - std::ignore = count; - std::ignore = pSpecConstants; - - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL urKernelGetNativeHandle( - ur_kernel_handle_t hKernel, ur_native_handle_t *phNativeKernel) { - std::ignore = hKernel; - std::ignore = phNativeKernel; - - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL urKernelCreateWithNativeHandle( - ur_native_handle_t hNativeKernel, ur_context_handle_t hContext, - ur_program_handle_t hProgram, - const ur_kernel_native_properties_t *pProperties, - ur_kernel_handle_t *phKernel) { - std::ignore = hNativeKernel; - std::ignore = hContext; - std::ignore = hProgram; - std::ignore = pProperties; - std::ignore = phKernel; - - DIE_NO_IMPLEMENTATION -} diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/kernel.hpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/kernel.hpp deleted file mode 100644 index fc0a611307122..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/kernel.hpp +++ /dev/null @@ -1,88 +0,0 @@ -//===--------------- kernel.hpp - Native CPU Adapter ----------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#pragma once - -#include "common.hpp" -#include "nativecpu_state.hpp" -#include - -namespace native_cpu { - -struct NativeCPUArgDesc { - void *MPtr; - - NativeCPUArgDesc(void *Ptr) : MPtr(Ptr){}; -}; - -} // namespace native_cpu - -using nativecpu_kernel_t = void(const native_cpu::NativeCPUArgDesc *, - native_cpu::state *); -using nativecpu_ptr_t = nativecpu_kernel_t *; -using nativecpu_task_t = std::function; - -struct local_arg_info_t { - uint32_t argIndex; - size_t argSize; - local_arg_info_t(uint32_t argIndex, size_t argSize) - : argIndex(argIndex), argSize(argSize) {} -}; - -struct ur_kernel_handle_t_ : RefCounted { - - ur_kernel_handle_t_(const char *name, nativecpu_task_t subhandler) - : _name{name}, _subhandler{subhandler} {} - - const char *_name; - nativecpu_task_t _subhandler; - std::vector _args; - std::vector _localArgInfo; - - // To be called before enqueing the kernel. - void handleLocalArgs() { - updateMemPool(); - size_t offset = 0; - for (auto &entry : _localArgInfo) { - _args[entry.argIndex].MPtr = - reinterpret_cast(_localMemPool) + offset; - // update offset in the memory pool - // Todo: update this offset computation when we have work-group - // level parallelism. - offset += entry.argSize; - } - } - - ~ur_kernel_handle_t_() { - if (_localMemPool) { - free(_localMemPool); - } - } - -private: - void updateMemPool() { - // compute requested size. - // Todo: currently we execute only one work-group at a time, so for each - // local arg we can allocate just 1 * argSize local arg. When we implement - // work-group level parallelism we should allocate N * argSize where N is - // the number of work groups being executed in parallel (e.g. number of - // threads in the thread pool). - size_t reqSize = 0; - for (auto &entry : _localArgInfo) { - reqSize += entry.argSize; - } - if (reqSize == 0 || reqSize == _localMemPoolSize) { - return; - } - // realloc handles nullptr case - _localMemPool = realloc(_localMemPool, reqSize); - _localMemPoolSize = reqSize; - } - void *_localMemPool = nullptr; - size_t _localMemPoolSize = 0; -}; diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/memory.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/memory.cpp deleted file mode 100644 index f00bdc8f2e21e..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/memory.cpp +++ /dev/null @@ -1,170 +0,0 @@ -//===-------------- memory.cpp - Native CPU Adapter -----------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "memory.hpp" -#include "common.hpp" -#include "ur_api.h" - -UR_APIEXPORT ur_result_t UR_APICALL urMemImageCreate( - ur_context_handle_t hContext, ur_mem_flags_t flags, - const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, - void *pHost, ur_mem_handle_t *phMem) { - std::ignore = hContext; - std::ignore = flags; - std::ignore = pImageFormat; - std::ignore = pImageDesc; - std::ignore = pHost; - std::ignore = phMem; - - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL urMemBufferCreate( - ur_context_handle_t hContext, ur_mem_flags_t flags, size_t size, - const ur_buffer_properties_t *pProperties, ur_mem_handle_t *phBuffer) { - - // TODO: add proper error checking and double check flag semantics - // TODO: support UR_MEM_FLAG_ALLOC_COPY_HOST_POINTER flag - - UR_ASSERT(phBuffer, UR_RESULT_ERROR_INVALID_NULL_POINTER); - - UR_ASSERT((flags & UR_MEM_FLAGS_MASK) == 0, - UR_RESULT_ERROR_INVALID_ENUMERATION); - if (flags & - (UR_MEM_FLAG_USE_HOST_POINTER | UR_MEM_FLAG_ALLOC_COPY_HOST_POINTER)) { - UR_ASSERT(pProperties && pProperties->pHost, - UR_RESULT_ERROR_INVALID_HOST_PTR); - } - - UR_ASSERT(size != 0, UR_RESULT_ERROR_INVALID_BUFFER_SIZE); - - const bool useHostPtr = flags & UR_MEM_FLAG_USE_HOST_POINTER; - const bool copyHostPtr = flags & UR_MEM_FLAG_USE_HOST_POINTER; - - ur_mem_handle_t_ *retMem; - - if (useHostPtr) { - retMem = new _ur_buffer(hContext, pProperties->pHost); - } else if (copyHostPtr) { - retMem = new _ur_buffer(hContext, pProperties->pHost, size); - } else { - retMem = new _ur_buffer(hContext, size); - } - - *phBuffer = retMem; - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urMemRetain(ur_mem_handle_t hMem) { - std::ignore = hMem; - - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL urMemRelease(ur_mem_handle_t hMem) { - UR_ASSERT(hMem, UR_RESULT_ERROR_INVALID_NULL_HANDLE); - - hMem->decrementRefCount(); - if (hMem->_refCount > 0) { - return UR_RESULT_SUCCESS; - } - - delete hMem; - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urMemBufferPartition( - ur_mem_handle_t hBuffer, ur_mem_flags_t flags, - ur_buffer_create_type_t bufferCreateType, const ur_buffer_region_t *pRegion, - ur_mem_handle_t *phMem) { - - std::ignore = bufferCreateType; - UR_ASSERT(hBuffer && !hBuffer->isImage() && - !(static_cast<_ur_buffer *>(hBuffer))->isSubBuffer(), - UR_RESULT_ERROR_INVALID_MEM_OBJECT); - - std::shared_lock Guard(hBuffer->Mutex); - - if (flags != UR_MEM_FLAG_READ_WRITE) { - die("urMemBufferPartition: NativeCPU implements only read-write buffer," - "no read-only or write-only yet."); - } - - try { - auto partitionedBuffer = new _ur_buffer(static_cast<_ur_buffer *>(hBuffer), - pRegion->origin, pRegion->size); - *phMem = reinterpret_cast(partitionedBuffer); - } catch (const std::bad_alloc &) { - return UR_RESULT_ERROR_OUT_OF_HOST_MEMORY; - } catch (...) { - return UR_RESULT_ERROR_UNKNOWN; - } - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urMemGetNativeHandle(ur_mem_handle_t hMem, ur_native_handle_t *phNativeMem) { - std::ignore = hMem; - std::ignore = phNativeMem; - - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL urMemBufferCreateWithNativeHandle( - ur_native_handle_t hNativeMem, ur_context_handle_t hContext, - const ur_mem_native_properties_t *pProperties, ur_mem_handle_t *phMem) { - std::ignore = hNativeMem; - std::ignore = hContext; - std::ignore = pProperties; - std::ignore = phMem; - - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL urMemImageCreateWithNativeHandle( - ur_native_handle_t hNativeMem, ur_context_handle_t hContext, - const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, - const ur_mem_native_properties_t *pProperties, ur_mem_handle_t *phMem) { - std::ignore = hNativeMem; - std::ignore = hContext; - std::ignore = pImageFormat; - std::ignore = pImageDesc; - std::ignore = pProperties; - std::ignore = phMem; - - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL urMemGetInfo(ur_mem_handle_t hMemory, - ur_mem_info_t propName, - size_t propSize, - void *pPropValue, - size_t *pPropSizeRet) { - std::ignore = hMemory; - std::ignore = propName; - std::ignore = propSize; - std::ignore = pPropValue; - std::ignore = pPropSizeRet; - - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL urMemImageGetInfo(ur_mem_handle_t hMemory, - ur_image_info_t propName, - size_t propSize, - void *pPropValue, - size_t *pPropSizeRet) { - std::ignore = hMemory; - std::ignore = propName; - std::ignore = propSize; - std::ignore = pPropValue; - std::ignore = pPropSizeRet; - - DIE_NO_IMPLEMENTATION -} diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/memory.hpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/memory.hpp deleted file mode 100644 index 056bdb50e2384..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/memory.hpp +++ /dev/null @@ -1,73 +0,0 @@ -//===-------------- memory.hpp - Native CPU Adapter -----------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#pragma once - -#include -#include -#include - -#include "common.hpp" -#include "context.hpp" - -struct ur_mem_handle_t_ : _ur_object { - ur_mem_handle_t_(size_t Size, bool _IsImage) - : _mem{static_cast(malloc(Size))}, _ownsMem{true}, - IsImage{_IsImage} {} - - ur_mem_handle_t_(void *HostPtr, size_t Size, bool _IsImage) - : _mem{static_cast(malloc(Size))}, _ownsMem{true}, - IsImage{_IsImage} { - memcpy(_mem, HostPtr, Size); - } - - ur_mem_handle_t_(void *HostPtr, bool _IsImage) - : _mem{static_cast(HostPtr)}, _ownsMem{false}, IsImage{_IsImage} { - } - - ~ur_mem_handle_t_() { - if (_ownsMem) { - free(_mem); - } - } - - void decrementRefCount() noexcept { _refCount--; } - - // Method to get type of the derived object (image or buffer) - bool isImage() const { return this->IsImage; } - - char *_mem; - bool _ownsMem; - std::atomic_uint32_t _refCount = {1}; - -private: - const bool IsImage; -}; - -struct _ur_buffer final : ur_mem_handle_t_ { - // Buffer constructor - _ur_buffer(ur_context_handle_t /* Context*/, void *HostPtr) - : ur_mem_handle_t_(HostPtr, false) {} - _ur_buffer(ur_context_handle_t /* Context*/, void *HostPtr, size_t Size) - : ur_mem_handle_t_(HostPtr, Size, false) {} - _ur_buffer(ur_context_handle_t /* Context*/, size_t Size) - : ur_mem_handle_t_(Size, false) {} - _ur_buffer(_ur_buffer *b, size_t Offset, size_t Size) - : ur_mem_handle_t_(b->_mem + Offset, false), SubBuffer(b) { - SubBuffer.Origin = Offset; - } - - bool isSubBuffer() const { return SubBuffer.Parent != nullptr; } - - struct BB { - BB(_ur_buffer *b) : Parent(b) {} - BB() : BB(nullptr) {} - _ur_buffer *const Parent; - size_t Origin; // only valid if Parent != nullptr - } SubBuffer; -}; diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/nativecpu_state.hpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/nativecpu_state.hpp deleted file mode 100644 index fc9002de239d0..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/nativecpu_state.hpp +++ /dev/null @@ -1,55 +0,0 @@ -//===-------------- nativecpu_state.hpp - SYCL Native CPU state -------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===-----------------------------------------------------------------===// -#pragma once -#include -namespace native_cpu { - -struct state { - size_t MGlobal_id[3]; - size_t MGlobal_range[3]; - size_t MWorkGroup_size[3]; - size_t MWorkGroup_id[3]; - size_t MLocal_id[3]; - size_t MNumGroups[3]; - size_t MGlobalOffset[3]; - state(size_t globalR0, size_t globalR1, size_t globalR2, size_t localR0, - size_t localR1, size_t localR2, size_t globalO0, size_t globalO1, - size_t globalO2) - : MGlobal_range{globalR0, globalR1, globalR2}, - MWorkGroup_size{localR0, localR1, localR2}, - MNumGroups{globalR0 / localR0, globalR1 / localR1, globalR2 / localR2}, - MGlobalOffset{globalO0, globalO1, globalO2} { - MGlobal_id[0] = 0; - MGlobal_id[1] = 0; - MGlobal_id[2] = 0; - MWorkGroup_id[0] = 0; - MWorkGroup_id[1] = 0; - MWorkGroup_id[2] = 0; - MLocal_id[0] = 0; - MLocal_id[1] = 0; - MLocal_id[2] = 0; - } - - void update(size_t group0, size_t group1, size_t group2, size_t local0, - size_t local1, size_t local2) { - MWorkGroup_id[0] = group0; - MWorkGroup_id[1] = group1; - MWorkGroup_id[2] = group2; - MLocal_id[0] = local0; - MLocal_id[1] = local1; - MLocal_id[2] = local2; - MGlobal_id[0] = - MWorkGroup_size[0] * MWorkGroup_id[0] + MLocal_id[0] + MGlobalOffset[0]; - MGlobal_id[1] = - MWorkGroup_size[1] * MWorkGroup_id[1] + MLocal_id[1] + MGlobalOffset[1]; - MGlobal_id[2] = - MWorkGroup_size[2] * MWorkGroup_id[2] + MLocal_id[2] + MGlobalOffset[2]; - } -}; - -} // namespace native_cpu diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/platform.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/platform.cpp deleted file mode 100644 index fd04c1f703522..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/platform.cpp +++ /dev/null @@ -1,115 +0,0 @@ -//===--------- platform.cpp - Native CPU Adapter --------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "platform.hpp" -#include "common.hpp" - -#include "ur/ur.hpp" -#include "ur_api.h" - -#include - -UR_APIEXPORT ur_result_t UR_APICALL -urPlatformGet(ur_adapter_handle_t *, uint32_t, uint32_t NumEntries, - ur_platform_handle_t *phPlatforms, uint32_t *pNumPlatforms) { - - UR_ASSERT(pNumPlatforms || phPlatforms, UR_RESULT_ERROR_INVALID_VALUE); - - if (pNumPlatforms) { - *pNumPlatforms = 1; - } - - if (NumEntries == 0) { - if (phPlatforms != nullptr) { - if (PrintTrace) { - std::cerr << "Invalid argument combination for urPlatformsGet\n"; - } - return UR_RESULT_ERROR_INVALID_VALUE; - } - return UR_RESULT_SUCCESS; - } - if (phPlatforms && NumEntries > 0) { - static ur_platform_handle_t_ ThePlatform; - *phPlatforms = &ThePlatform; - } - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetApiVersion( - ur_platform_handle_t hDriver, ur_api_version_t *pVersion) { - UR_ASSERT(hDriver, UR_RESULT_ERROR_INVALID_NULL_HANDLE); - UR_ASSERT(pVersion, UR_RESULT_ERROR_INVALID_NULL_POINTER); - - *pVersion = UR_API_VERSION_CURRENT; - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urPlatformGetInfo(ur_platform_handle_t hPlatform, ur_platform_info_t propName, - size_t propSize, void *pParamValue, size_t *pSizeRet) { - - if (hPlatform == nullptr) { - return UR_RESULT_ERROR_INVALID_PLATFORM; - } - UrReturnHelper ReturnValue(propSize, pParamValue, pSizeRet); - - switch (propName) { - case UR_PLATFORM_INFO_NAME: - return ReturnValue("SYCL_NATIVE_CPU"); - - case UR_PLATFORM_INFO_VENDOR_NAME: - return ReturnValue("tbd"); - - case UR_PLATFORM_INFO_VERSION: - return ReturnValue("0.1"); - - case UR_PLATFORM_INFO_PROFILE: - return ReturnValue("FULL_PROFILE"); - - case UR_PLATFORM_INFO_EXTENSIONS: - return ReturnValue(""); - - case UR_PLATFORM_INFO_BACKEND: - // TODO(alcpz): PR with this enum value at - // https://github.com/oneapi-src/unified-runtime - return ReturnValue(UR_PLATFORM_BACKEND_NATIVE_CPU); - default: - DIE_NO_IMPLEMENTATION; - } - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetBackendOption( - ur_platform_handle_t hPlatform, const char *pFrontendOption, - const char **ppPlatformOption) { - std::ignore = hPlatform; - std::ignore = pFrontendOption; - std::ignore = ppPlatformOption; - - CONTINUE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urPlatformCreateWithNativeHandle( - ur_native_handle_t hNativePlatform, - const ur_platform_native_properties_t *pProperties, - ur_platform_handle_t *phPlatform) { - std::ignore = hNativePlatform; - std::ignore = pProperties; - std::ignore = phPlatform; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetNativeHandle( - ur_platform_handle_t hPlatform, ur_native_handle_t *phNativePlatform) { - std::ignore = hPlatform; - std::ignore = phNativePlatform; - - DIE_NO_IMPLEMENTATION; -} diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/platform.hpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/platform.hpp deleted file mode 100644 index fde5869596acc..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/platform.hpp +++ /dev/null @@ -1,18 +0,0 @@ -//===--------- platform.hpp - Native CPU Adapter --------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#pragma once - -#include - -#include "common.hpp" -#include "device.hpp" - -struct ur_platform_handle_t_ { - ur_device_handle_t_ TheDevice{this}; -}; diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/program.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/program.cpp deleted file mode 100644 index 3ec60b0f497ae..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/program.cpp +++ /dev/null @@ -1,186 +0,0 @@ -//===--------- program.cpp - Native CPU Adapter ---------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "ur_api.h" - -#include "common.hpp" -#include "program.hpp" - -UR_APIEXPORT ur_result_t UR_APICALL -urProgramCreateWithIL(ur_context_handle_t hContext, const void *pIL, - size_t length, const ur_program_properties_t *pProperties, - ur_program_handle_t *phProgram) { - std::ignore = hContext; - std::ignore = pIL; - std::ignore = length; - std::ignore = pProperties; - std::ignore = phProgram; - - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL urProgramCreateWithBinary( - ur_context_handle_t hContext, ur_device_handle_t hDevice, size_t size, - const uint8_t *pBinary, const ur_program_properties_t *pProperties, - ur_program_handle_t *phProgram) { - std::ignore = size; - std::ignore = pProperties; - - UR_ASSERT(hContext, UR_RESULT_ERROR_INVALID_NULL_HANDLE); - UR_ASSERT(hDevice, UR_RESULT_ERROR_INVALID_NULL_HANDLE); - UR_ASSERT(phProgram, UR_RESULT_ERROR_INVALID_NULL_POINTER); - UR_ASSERT(pBinary != nullptr, UR_RESULT_ERROR_INVALID_NULL_POINTER); - - auto hProgram = new ur_program_handle_t_( - hContext, reinterpret_cast(pBinary)); - - const nativecpu_entry *nativecpu_it = - reinterpret_cast(pBinary); - while (nativecpu_it->kernel_ptr != nullptr) { - hProgram->_kernels.insert( - std::make_pair(nativecpu_it->kernelname, nativecpu_it->kernel_ptr)); - nativecpu_it++; - } - - *phProgram = hProgram; - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urProgramBuild(ur_context_handle_t hContext, - ur_program_handle_t hProgram, - const char *pOptions) { - std::ignore = hContext; - std::ignore = hProgram; - std::ignore = pOptions; - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urProgramCompile(ur_context_handle_t hContext, ur_program_handle_t hProgram, - const char *pOptions) { - std::ignore = hContext; - std::ignore = hProgram; - std::ignore = pOptions; - - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL -urProgramLink(ur_context_handle_t hContext, uint32_t count, - const ur_program_handle_t *phPrograms, const char *pOptions, - ur_program_handle_t *phProgram) { - std::ignore = hContext; - std::ignore = count; - std::ignore = phPrograms; - std::ignore = pOptions; - std::ignore = phProgram; - - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL -urProgramRetain(ur_program_handle_t hProgram) { - hProgram->incrementReferenceCount(); - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urProgramRelease(ur_program_handle_t hProgram) { - delete hProgram; - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urProgramGetFunctionPointer( - ur_device_handle_t hDevice, ur_program_handle_t hProgram, - const char *pFunctionName, void **ppFunctionPointer) { - std::ignore = hDevice; - std::ignore = hProgram; - std::ignore = pFunctionName; - std::ignore = ppFunctionPointer; - - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL -urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName, - size_t propSize, void *pPropValue, size_t *pPropSizeRet) { - UR_ASSERT(hProgram, UR_RESULT_ERROR_INVALID_NULL_HANDLE); - - UrReturnHelper returnValue(propSize, pPropValue, pPropSizeRet); - - switch (propName) { - case UR_PROGRAM_INFO_REFERENCE_COUNT: - return returnValue(hProgram->getReferenceCount()); - case UR_PROGRAM_INFO_CONTEXT: - return returnValue(nullptr); - case UR_PROGRAM_INFO_NUM_DEVICES: - return returnValue(1u); - case UR_PROGRAM_INFO_DEVICES: - return returnValue(hProgram->_ctx->_device); - case UR_PROGRAM_INFO_SOURCE: - return returnValue(nullptr); - case UR_PROGRAM_INFO_BINARY_SIZES: - return returnValue("foo"); - case UR_PROGRAM_INFO_BINARIES: - return returnValue("foo"); - case UR_PROGRAM_INFO_KERNEL_NAMES: { - return returnValue("foo"); - } - default: - break; - } - - return UR_RESULT_ERROR_INVALID_ENUMERATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urProgramGetBuildInfo(ur_program_handle_t hProgram, ur_device_handle_t hDevice, - ur_program_build_info_t propName, size_t propSize, - void *pPropValue, size_t *pPropSizeRet) { - std::ignore = hProgram; - std::ignore = hDevice; - std::ignore = propName; - std::ignore = propSize; - std::ignore = pPropValue; - std::ignore = pPropSizeRet; - - CONTINUE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL urProgramSetSpecializationConstants( - ur_program_handle_t hProgram, uint32_t count, - const ur_specialization_constant_info_t *pSpecConstants) { - std::ignore = hProgram; - std::ignore = count; - std::ignore = pSpecConstants; - - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL urProgramGetNativeHandle( - ur_program_handle_t hProgram, ur_native_handle_t *phNativeProgram) { - std::ignore = hProgram; - std::ignore = phNativeProgram; - - DIE_NO_IMPLEMENTATION -} - -UR_APIEXPORT ur_result_t UR_APICALL urProgramCreateWithNativeHandle( - ur_native_handle_t hNativeProgram, ur_context_handle_t hContext, - const ur_program_native_properties_t *pProperties, - ur_program_handle_t *phProgram) { - std::ignore = hNativeProgram; - std::ignore = hContext; - std::ignore = pProperties; - std::ignore = phProgram; - - DIE_NO_IMPLEMENTATION -} diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/program.hpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/program.hpp deleted file mode 100644 index b385589d6fb92..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/program.hpp +++ /dev/null @@ -1,40 +0,0 @@ -//===--------- program.hpp - Native CPU Adapter ---------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#pragma once - -#include - -#include "context.hpp" -#include - -struct ur_program_handle_t_ : RefCounted { - ur_program_handle_t_(ur_context_handle_t ctx, const unsigned char *pBinary) - : _ctx{ctx}, _ptr{pBinary} {} - - uint32_t getReferenceCount() const noexcept { return _refCount; } - - ur_context_handle_t _ctx; - const unsigned char *_ptr; - struct _compare { - bool operator()(char const *a, char const *b) const { - return std::strcmp(a, b) < 0; - } - }; - - std::map _kernels; -}; - -// The nativecpu_entry struct is also defined as LLVM-IR in the -// clang-offload-wrapper tool. The two definitions need to match, -// therefore any change to this struct needs to be reflected in the -// offload-wrapper. -struct nativecpu_entry { - const char *kernelname; - const unsigned char *kernel_ptr; -}; diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/queue.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/queue.cpp deleted file mode 100644 index b8cd6e461cc5e..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/queue.cpp +++ /dev/null @@ -1,86 +0,0 @@ -//===----------- queue.cpp - Native CPU Adapter ---------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "queue.hpp" -#include "common.hpp" - -#include "ur/ur.hpp" -#include "ur_api.h" - -UR_APIEXPORT ur_result_t UR_APICALL urQueueGetInfo(ur_queue_handle_t hQueue, - ur_queue_info_t propName, - size_t propSize, - void *pPropValue, - size_t *pPropSizeRet) { - std::ignore = hQueue; - std::ignore = propName; - std::ignore = propSize; - std::ignore = pPropValue; - std::ignore = pPropSizeRet; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urQueueCreate( - ur_context_handle_t hContext, ur_device_handle_t hDevice, - const ur_queue_properties_t *pProperties, ur_queue_handle_t *phQueue) { - std::ignore = hContext; - std::ignore = hDevice; - std::ignore = pProperties; - - auto Queue = new ur_queue_handle_t_(); - *phQueue = Queue; - - CONTINUE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urQueueRetain(ur_queue_handle_t hQueue) { - std::ignore = hQueue; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urQueueRelease(ur_queue_handle_t hQueue) { - delete hQueue; - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urQueueGetNativeHandle(ur_queue_handle_t hQueue, ur_queue_native_desc_t *pDesc, - ur_native_handle_t *phNativeQueue) { - std::ignore = hQueue; - std::ignore = pDesc; - std::ignore = phNativeQueue; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urQueueCreateWithNativeHandle( - ur_native_handle_t hNativeQueue, ur_context_handle_t hContext, - ur_device_handle_t hDevice, const ur_queue_native_properties_t *pProperties, - ur_queue_handle_t *phQueue) { - std::ignore = hNativeQueue; - std::ignore = hContext; - std::ignore = hDevice; - std::ignore = pProperties; - std::ignore = phQueue; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urQueueFinish(ur_queue_handle_t hQueue) { - std::ignore = hQueue; - // TODO: is this fine as no-op? - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urQueueFlush(ur_queue_handle_t hQueue) { - std::ignore = hQueue; - - DIE_NO_IMPLEMENTATION; -} diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/queue.hpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/queue.hpp deleted file mode 100644 index 8a99460152586..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/queue.hpp +++ /dev/null @@ -1,10 +0,0 @@ -//===----------- queue.hpp - Native CPU Adapter ---------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#pragma once - -struct ur_queue_handle_t_ {}; diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/sampler.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/sampler.cpp deleted file mode 100644 index 7f23b4e3adb9b..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/sampler.cpp +++ /dev/null @@ -1,67 +0,0 @@ -//===--------- sampler.cpp - NATIVE CPU Adapter ---------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "ur_api.h" - -#include "common.hpp" - -UR_APIEXPORT ur_result_t UR_APICALL -urSamplerCreate(ur_context_handle_t hContext, const ur_sampler_desc_t *pDesc, - ur_sampler_handle_t *phSampler) { - std::ignore = hContext; - std::ignore = pDesc; - std::ignore = phSampler; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urSamplerRetain(ur_sampler_handle_t hSampler) { - std::ignore = hSampler; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urSamplerRelease(ur_sampler_handle_t hSampler) { - std::ignore = hSampler; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urSamplerGetInfo(ur_sampler_handle_t hSampler, ur_sampler_info_t propName, - size_t propSize, void *pPropValue, size_t *pPropSizeRet) { - std::ignore = hSampler; - std::ignore = propName; - std::ignore = propSize; - std::ignore = pPropValue; - std::ignore = pPropSizeRet; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urSamplerGetNativeHandle( - ur_sampler_handle_t hSampler, ur_native_handle_t *phNativeSampler) { - std::ignore = hSampler; - std::ignore = phNativeSampler; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urSamplerCreateWithNativeHandle( - ur_native_handle_t hNativeSampler, ur_context_handle_t hContext, - const ur_sampler_native_properties_t *pProperties, - ur_sampler_handle_t *phSampler) { - std::ignore = hNativeSampler; - std::ignore = hContext; - std::ignore = pProperties; - std::ignore = phSampler; - - DIE_NO_IMPLEMENTATION; -} diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/ur_interface_loader.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/ur_interface_loader.cpp deleted file mode 100644 index abc52daead372..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/ur_interface_loader.cpp +++ /dev/null @@ -1,278 +0,0 @@ -//===----------- ur_interface_loader.cpp - Native CPU Plugin -------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include -#include - -namespace { - -// TODO - this is a duplicate of what is in the L0 plugin -// We should move this to somewhere common -ur_result_t validateProcInputs(ur_api_version_t version, void *pDdiTable) { - if (pDdiTable == nullptr) { - return UR_RESULT_ERROR_INVALID_NULL_POINTER; - } - // Pre 1.0 we enforce that loader and adapter must have the same version. - // Post 1.0 only a major version match should be required. - if (version != UR_API_VERSION_CURRENT) { - return UR_RESULT_ERROR_UNSUPPORTED_VERSION; - } - return UR_RESULT_SUCCESS; -} -} // namespace - -extern "C" { - -UR_DLLEXPORT ur_result_t UR_APICALL urGetPlatformProcAddrTable( - ur_api_version_t version, ur_platform_dditable_t *pDdiTable) { - auto result = validateProcInputs(version, pDdiTable); - if (UR_RESULT_SUCCESS != result) { - return result; - } - pDdiTable->pfnCreateWithNativeHandle = urPlatformCreateWithNativeHandle; - pDdiTable->pfnGet = urPlatformGet; - pDdiTable->pfnGetApiVersion = urPlatformGetApiVersion; - pDdiTable->pfnGetInfo = urPlatformGetInfo; - pDdiTable->pfnGetNativeHandle = urPlatformGetNativeHandle; - pDdiTable->pfnGetBackendOption = urPlatformGetBackendOption; - return UR_RESULT_SUCCESS; -} - -UR_DLLEXPORT ur_result_t UR_APICALL urGetContextProcAddrTable( - ur_api_version_t version, ur_context_dditable_t *pDdiTable) { - auto result = validateProcInputs(version, pDdiTable); - if (UR_RESULT_SUCCESS != result) { - return result; - } - pDdiTable->pfnCreate = urContextCreate; - pDdiTable->pfnCreateWithNativeHandle = urContextCreateWithNativeHandle; - pDdiTable->pfnGetInfo = urContextGetInfo; - pDdiTable->pfnGetNativeHandle = urContextGetNativeHandle; - pDdiTable->pfnRelease = urContextRelease; - pDdiTable->pfnRetain = urContextRetain; - pDdiTable->pfnSetExtendedDeleter = urContextSetExtendedDeleter; - return UR_RESULT_SUCCESS; -} - -UR_DLLEXPORT ur_result_t UR_APICALL urGetEventProcAddrTable( - ur_api_version_t version, ur_event_dditable_t *pDdiTable) { - auto result = validateProcInputs(version, pDdiTable); - if (UR_RESULT_SUCCESS != result) { - return result; - } - pDdiTable->pfnCreateWithNativeHandle = urEventCreateWithNativeHandle; - pDdiTable->pfnGetInfo = urEventGetInfo; - pDdiTable->pfnGetNativeHandle = urEventGetNativeHandle; - pDdiTable->pfnGetProfilingInfo = urEventGetProfilingInfo; - pDdiTable->pfnRelease = urEventRelease; - pDdiTable->pfnRetain = urEventRetain; - pDdiTable->pfnSetCallback = urEventSetCallback; - pDdiTable->pfnWait = urEventWait; - return UR_RESULT_SUCCESS; -} - -UR_DLLEXPORT ur_result_t UR_APICALL urGetProgramProcAddrTable( - ur_api_version_t version, ur_program_dditable_t *pDdiTable) { - auto result = validateProcInputs(version, pDdiTable); - if (UR_RESULT_SUCCESS != result) { - return result; - } - pDdiTable->pfnBuild = urProgramBuild; - pDdiTable->pfnCompile = urProgramCompile; - pDdiTable->pfnCreateWithBinary = urProgramCreateWithBinary; - pDdiTable->pfnCreateWithIL = urProgramCreateWithIL; - pDdiTable->pfnCreateWithNativeHandle = urProgramCreateWithNativeHandle; - pDdiTable->pfnGetBuildInfo = urProgramGetBuildInfo; - pDdiTable->pfnGetFunctionPointer = urProgramGetFunctionPointer; - pDdiTable->pfnGetInfo = urProgramGetInfo; - pDdiTable->pfnGetNativeHandle = urProgramGetNativeHandle; - pDdiTable->pfnLink = urProgramLink; - pDdiTable->pfnRelease = urProgramRelease; - pDdiTable->pfnRetain = urProgramRetain; - pDdiTable->pfnSetSpecializationConstants = - urProgramSetSpecializationConstants; - return UR_RESULT_SUCCESS; -} - -UR_DLLEXPORT ur_result_t UR_APICALL urGetKernelProcAddrTable( - ur_api_version_t version, ur_kernel_dditable_t *pDdiTable) { - auto result = validateProcInputs(version, pDdiTable); - if (UR_RESULT_SUCCESS != result) { - return result; - } - pDdiTable->pfnCreate = urKernelCreate; - pDdiTable->pfnCreateWithNativeHandle = urKernelCreateWithNativeHandle; - pDdiTable->pfnGetGroupInfo = urKernelGetGroupInfo; - pDdiTable->pfnGetInfo = urKernelGetInfo; - pDdiTable->pfnGetNativeHandle = urKernelGetNativeHandle; - pDdiTable->pfnGetSubGroupInfo = urKernelGetSubGroupInfo; - pDdiTable->pfnRelease = urKernelRelease; - pDdiTable->pfnRetain = urKernelRetain; - pDdiTable->pfnSetArgLocal = urKernelSetArgLocal; - pDdiTable->pfnSetArgMemObj = urKernelSetArgMemObj; - pDdiTable->pfnSetArgPointer = urKernelSetArgPointer; - pDdiTable->pfnSetArgSampler = urKernelSetArgSampler; - pDdiTable->pfnSetArgValue = urKernelSetArgValue; - pDdiTable->pfnSetExecInfo = urKernelSetExecInfo; - pDdiTable->pfnSetSpecializationConstants = urKernelSetSpecializationConstants; - return UR_RESULT_SUCCESS; -} - -UR_DLLEXPORT ur_result_t UR_APICALL urGetSamplerProcAddrTable( - ur_api_version_t version, ur_sampler_dditable_t *pDdiTable) { - auto result = validateProcInputs(version, pDdiTable); - if (UR_RESULT_SUCCESS != result) { - return result; - } - pDdiTable->pfnCreate = urSamplerCreate; - pDdiTable->pfnCreateWithNativeHandle = urSamplerCreateWithNativeHandle; - pDdiTable->pfnGetInfo = urSamplerGetInfo; - pDdiTable->pfnGetNativeHandle = urSamplerGetNativeHandle; - pDdiTable->pfnRelease = urSamplerRelease; - pDdiTable->pfnRetain = urSamplerRetain; - return UR_RESULT_SUCCESS; -} - -UR_DLLEXPORT ur_result_t UR_APICALL -urGetMemProcAddrTable(ur_api_version_t version, ur_mem_dditable_t *pDdiTable) { - auto result = validateProcInputs(version, pDdiTable); - if (UR_RESULT_SUCCESS != result) { - return result; - } - pDdiTable->pfnBufferCreate = urMemBufferCreate; - pDdiTable->pfnBufferPartition = urMemBufferPartition; - pDdiTable->pfnBufferCreateWithNativeHandle = - urMemBufferCreateWithNativeHandle; - pDdiTable->pfnImageCreateWithNativeHandle = urMemImageCreateWithNativeHandle; - pDdiTable->pfnGetInfo = urMemGetInfo; - pDdiTable->pfnGetNativeHandle = urMemGetNativeHandle; - pDdiTable->pfnImageCreate = urMemImageCreate; - pDdiTable->pfnImageGetInfo = urMemImageGetInfo; - pDdiTable->pfnRelease = urMemRelease; - pDdiTable->pfnRetain = urMemRetain; - return UR_RESULT_SUCCESS; -} - -UR_DLLEXPORT ur_result_t UR_APICALL urGetEnqueueProcAddrTable( - ur_api_version_t version, ur_enqueue_dditable_t *pDdiTable) { - auto result = validateProcInputs(version, pDdiTable); - if (UR_RESULT_SUCCESS != result) { - return result; - } - pDdiTable->pfnDeviceGlobalVariableRead = urEnqueueDeviceGlobalVariableRead; - pDdiTable->pfnDeviceGlobalVariableWrite = urEnqueueDeviceGlobalVariableWrite; - pDdiTable->pfnEventsWait = urEnqueueEventsWait; - pDdiTable->pfnEventsWaitWithBarrier = urEnqueueEventsWaitWithBarrier; - pDdiTable->pfnKernelLaunch = urEnqueueKernelLaunch; - pDdiTable->pfnMemBufferCopy = urEnqueueMemBufferCopy; - pDdiTable->pfnMemBufferCopyRect = urEnqueueMemBufferCopyRect; - pDdiTable->pfnMemBufferFill = urEnqueueMemBufferFill; - pDdiTable->pfnMemBufferMap = urEnqueueMemBufferMap; - pDdiTable->pfnMemBufferRead = urEnqueueMemBufferRead; - pDdiTable->pfnMemBufferReadRect = urEnqueueMemBufferReadRect; - pDdiTable->pfnMemBufferWrite = urEnqueueMemBufferWrite; - pDdiTable->pfnMemBufferWriteRect = urEnqueueMemBufferWriteRect; - pDdiTable->pfnMemImageCopy = urEnqueueMemImageCopy; - pDdiTable->pfnMemImageRead = urEnqueueMemImageRead; - pDdiTable->pfnMemImageWrite = urEnqueueMemImageWrite; - pDdiTable->pfnMemUnmap = urEnqueueMemUnmap; - pDdiTable->pfnUSMFill2D = urEnqueueUSMFill2D; - pDdiTable->pfnUSMFill = urEnqueueUSMFill; - pDdiTable->pfnUSMAdvise = urEnqueueUSMAdvise; - pDdiTable->pfnUSMMemcpy2D = urEnqueueUSMMemcpy2D; - pDdiTable->pfnUSMMemcpy = urEnqueueUSMMemcpy; - pDdiTable->pfnUSMPrefetch = urEnqueueUSMPrefetch; - pDdiTable->pfnReadHostPipe = urEnqueueReadHostPipe; - pDdiTable->pfnWriteHostPipe = urEnqueueWriteHostPipe; - return UR_RESULT_SUCCESS; -} - -UR_DLLEXPORT ur_result_t UR_APICALL urGetGlobalProcAddrTable( - ur_api_version_t version, ur_global_dditable_t *pDdiTable) { - auto result = validateProcInputs(version, pDdiTable); - if (UR_RESULT_SUCCESS != result) { - return result; - } - pDdiTable->pfnInit = urInit; - pDdiTable->pfnTearDown = urTearDown; - pDdiTable->pfnAdapterGet = urAdapterGet; - pDdiTable->pfnAdapterGetInfo = urAdapterGetInfo; - pDdiTable->pfnAdapterRelease = urAdapterRelease; - pDdiTable->pfnAdapterRetain = urAdapterRetain; - return UR_RESULT_SUCCESS; -} - -UR_DLLEXPORT ur_result_t UR_APICALL urGetQueueProcAddrTable( - ur_api_version_t version, ur_queue_dditable_t *pDdiTable) { - auto result = validateProcInputs(version, pDdiTable); - if (UR_RESULT_SUCCESS != result) { - return result; - } - pDdiTable->pfnCreate = urQueueCreate; - pDdiTable->pfnCreateWithNativeHandle = urQueueCreateWithNativeHandle; - pDdiTable->pfnFinish = urQueueFinish; - pDdiTable->pfnFlush = urQueueFlush; - pDdiTable->pfnGetInfo = urQueueGetInfo; - pDdiTable->pfnGetNativeHandle = urQueueGetNativeHandle; - pDdiTable->pfnRelease = urQueueRelease; - pDdiTable->pfnRetain = urQueueRetain; - return UR_RESULT_SUCCESS; -} - -UR_DLLEXPORT ur_result_t UR_APICALL -urGetUSMProcAddrTable(ur_api_version_t version, ur_usm_dditable_t *pDdiTable) { - auto result = validateProcInputs(version, pDdiTable); - if (UR_RESULT_SUCCESS != result) { - return result; - } - pDdiTable->pfnDeviceAlloc = urUSMDeviceAlloc; - pDdiTable->pfnFree = urUSMFree; - pDdiTable->pfnGetMemAllocInfo = urUSMGetMemAllocInfo; - pDdiTable->pfnHostAlloc = urUSMHostAlloc; - pDdiTable->pfnPoolCreate = urUSMPoolCreate; - pDdiTable->pfnPoolRetain = urUSMPoolRetain; - pDdiTable->pfnPoolRelease = urUSMPoolRelease; - pDdiTable->pfnPoolGetInfo = urUSMPoolGetInfo; - pDdiTable->pfnSharedAlloc = urUSMSharedAlloc; - return UR_RESULT_SUCCESS; -} - -UR_DLLEXPORT ur_result_t UR_APICALL urGetDeviceProcAddrTable( - ur_api_version_t version, ur_device_dditable_t *pDdiTable) { - auto result = validateProcInputs(version, pDdiTable); - if (UR_RESULT_SUCCESS != result) { - return result; - } - pDdiTable->pfnCreateWithNativeHandle = urDeviceCreateWithNativeHandle; - pDdiTable->pfnGet = urDeviceGet; - pDdiTable->pfnGetGlobalTimestamps = urDeviceGetGlobalTimestamps; - pDdiTable->pfnGetInfo = urDeviceGetInfo; - pDdiTable->pfnGetNativeHandle = urDeviceGetNativeHandle; - pDdiTable->pfnPartition = urDevicePartition; - pDdiTable->pfnRelease = urDeviceRelease; - pDdiTable->pfnRetain = urDeviceRetain; - pDdiTable->pfnSelectBinary = urDeviceSelectBinary; - return UR_RESULT_SUCCESS; -} - -// TODO: CommandBuffer - -UR_DLLEXPORT ur_result_t UR_APICALL urGetUsmP2PExpProcAddrTable( - ur_api_version_t version, ur_usm_p2p_exp_dditable_t *pDdiTable) { - auto retVal = validateProcInputs(version, pDdiTable); - if (UR_RESULT_SUCCESS != retVal) { - return retVal; - } - pDdiTable->pfnEnablePeerAccessExp = urUsmP2PEnablePeerAccessExp; - pDdiTable->pfnDisablePeerAccessExp = urUsmP2PDisablePeerAccessExp; - pDdiTable->pfnPeerAccessGetInfoExp = urUsmP2PPeerAccessGetInfoExp; - - return retVal; -} - -} // extern "C" diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/usm.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/usm.cpp deleted file mode 100644 index 478284501e335..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/usm.cpp +++ /dev/null @@ -1,139 +0,0 @@ -//===------------- usm.cpp - NATIVE CPU Adapter ---------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "ur_api.h" - -#include "common.hpp" - -UR_APIEXPORT ur_result_t UR_APICALL -urUSMHostAlloc(ur_context_handle_t hContext, const ur_usm_desc_t *pUSMDesc, - ur_usm_pool_handle_t pool, size_t size, void **ppMem) { - std::ignore = hContext; - std::ignore = pUSMDesc; - std::ignore = pool; - - UR_ASSERT(ppMem, UR_RESULT_ERROR_INVALID_NULL_POINTER); - // TODO: Check Max size when UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE is implemented - UR_ASSERT(size > 0, UR_RESULT_ERROR_INVALID_USM_SIZE); - - *ppMem = malloc(size); - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urUSMDeviceAlloc(ur_context_handle_t hContext, ur_device_handle_t hDevice, - const ur_usm_desc_t *pUSMDesc, ur_usm_pool_handle_t pool, - size_t size, void **ppMem) { - std::ignore = hContext; - std::ignore = hDevice; - std::ignore = pUSMDesc; - std::ignore = pool; - - UR_ASSERT(ppMem, UR_RESULT_ERROR_INVALID_NULL_POINTER); - // TODO: Check Max size when UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE is implemented - UR_ASSERT(size > 0, UR_RESULT_ERROR_INVALID_USM_SIZE); - - *ppMem = malloc(size); - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urUSMSharedAlloc(ur_context_handle_t hContext, ur_device_handle_t hDevice, - const ur_usm_desc_t *pUSMDesc, ur_usm_pool_handle_t pool, - size_t size, void **ppMem) { - std::ignore = hContext; - std::ignore = hDevice; - std::ignore = pUSMDesc; - std::ignore = pool; - - UR_ASSERT(ppMem, UR_RESULT_ERROR_INVALID_NULL_POINTER); - // TODO: Check Max size when UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE is implemented - UR_ASSERT(size > 0, UR_RESULT_ERROR_INVALID_USM_SIZE); - - *ppMem = malloc(size); - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL urUSMFree(ur_context_handle_t hContext, - void *pMem) { - std::ignore = hContext; - - UR_ASSERT(pMem, UR_RESULT_ERROR_INVALID_NULL_POINTER); - - free(pMem); - - return UR_RESULT_SUCCESS; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urUSMGetMemAllocInfo(ur_context_handle_t hContext, const void *pMem, - ur_usm_alloc_info_t propName, size_t propSize, - void *pPropValue, size_t *pPropSizeRet) { - std::ignore = hContext; - std::ignore = pMem; - std::ignore = propName; - std::ignore = propSize; - std::ignore = pPropValue; - std::ignore = pPropSizeRet; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urUSMPoolCreate(ur_context_handle_t hContext, ur_usm_pool_desc_t *pPoolDesc, - ur_usm_pool_handle_t *ppPool) { - std::ignore = hContext; - std::ignore = pPoolDesc; - std::ignore = ppPool; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urUSMPoolRetain(ur_usm_pool_handle_t pPool) { - std::ignore = pPool; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urUSMPoolRelease(ur_usm_pool_handle_t pPool) { - std::ignore = pPool; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urUSMPoolGetInfo(ur_usm_pool_handle_t hPool, ur_usm_pool_info_t propName, - size_t propSize, void *pPropValue, size_t *pPropSizeRet) { - std::ignore = hPool; - std::ignore = propName; - std::ignore = propSize; - std::ignore = pPropValue; - std::ignore = pPropSizeRet; - - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urUSMImportExp(ur_context_handle_t Context, - void *HostPtr, size_t Size) { - std::ignore = Context; - std::ignore = HostPtr; - std::ignore = Size; - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL urUSMReleaseExp(ur_context_handle_t Context, - void *HostPtr) { - std::ignore = Context; - std::ignore = HostPtr; - DIE_NO_IMPLEMENTATION; -} \ No newline at end of file diff --git a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/usm_p2p.cpp b/sycl/plugins/unified_runtime/ur/adapters/native_cpu/usm_p2p.cpp deleted file mode 100644 index 8171c84845174..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/native_cpu/usm_p2p.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===--------- usm_p2p.cpp - Native CPU Adapter ---------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "common.hpp" - -UR_APIEXPORT ur_result_t UR_APICALL -urUsmP2PEnablePeerAccessExp(ur_device_handle_t, ur_device_handle_t) { - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urUsmP2PDisablePeerAccessExp(ur_device_handle_t, ur_device_handle_t) { - DIE_NO_IMPLEMENTATION; -} - -UR_APIEXPORT ur_result_t UR_APICALL -urUsmP2PPeerAccessGetInfoExp(ur_device_handle_t, ur_device_handle_t, - ur_exp_peer_info_t, size_t, void *, size_t *) { - DIE_NO_IMPLEMENTATION; -} diff --git a/sycl/source/backend.cpp b/sycl/source/backend.cpp index b2cfa4e0465b1..82adf2f979bf9 100644 --- a/sycl/source/backend.cpp +++ b/sycl/source/backend.cpp @@ -174,10 +174,10 @@ make_kernel_bundle(pi_native_handle NativeHandle, const context &TargetContext, Plugin->call(PiProgram); std::vector ProgramDevices; - size_t NumDevices = 0; + uint32_t NumDevices = 0; Plugin->call( - PiProgram, PI_PROGRAM_INFO_NUM_DEVICES, sizeof(size_t), &NumDevices, + PiProgram, PI_PROGRAM_INFO_NUM_DEVICES, sizeof(NumDevices), &NumDevices, nullptr); ProgramDevices.resize(NumDevices); Plugin->call(PiProgram, PI_PROGRAM_INFO_DEVICES, diff --git a/sycl/source/detail/context_impl.cpp b/sycl/source/detail/context_impl.cpp index 3e8b13c40f9cc..fe41f1efe17d9 100644 --- a/sycl/source/detail/context_impl.cpp +++ b/sycl/source/detail/context_impl.cpp @@ -77,7 +77,7 @@ context_impl::context_impl(sycl::detail::pi::PiContext PiContext, MSupportBufferLocationByDevices(NotChecked) { std::vector DeviceIds; - size_t DevicesNum = 0; + uint32_t DevicesNum = 0; // TODO catch an exception and put it to list of asynchronous exceptions Plugin->call( MContext, PI_CONTEXT_INFO_NUM_DEVICES, sizeof(DevicesNum), &DevicesNum, diff --git a/sycl/source/detail/memory_manager.cpp b/sycl/source/detail/memory_manager.cpp index bf8483a47ce09..ae357a8f4fe5b 100644 --- a/sycl/source/detail/memory_manager.cpp +++ b/sycl/source/detail/memory_manager.cpp @@ -1518,10 +1518,20 @@ void MemoryManager::ext_oneapi_copyD2H_cmd_buffer( } if (1 == DimDst && 1 == DimSrc) { - Plugin->call( - CommandBuffer, sycl::detail::pi::cast(SrcMem), - SrcXOffBytes, SrcAccessRangeWidthBytes, DstMem + DstXOffBytes, - Deps.size(), Deps.data(), OutSyncPoint); + pi_result Result = + Plugin->call_nocheck( + CommandBuffer, + sycl::detail::pi::cast(SrcMem), + SrcXOffBytes, SrcAccessRangeWidthBytes, DstMem + DstXOffBytes, + Deps.size(), Deps.data(), OutSyncPoint); + + if (Result == PI_ERROR_INVALID_OPERATION) { + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Device-to-host buffer copy command not supported by graph backend"); + } else { + Plugin->checkPiResult(Result); + } } else { size_t BufferRowPitch = (1 == DimSrc) ? 0 : SrcSzWidthBytes; size_t BufferSlicePitch = @@ -1538,11 +1548,20 @@ void MemoryManager::ext_oneapi_copyD2H_cmd_buffer( SrcAccessRange[SrcPos.YTerm], SrcAccessRange[SrcPos.ZTerm]}; - Plugin->call( - CommandBuffer, sycl::detail::pi::cast(SrcMem), - &BufferOffset, &HostOffset, &RectRegion, BufferRowPitch, - BufferSlicePitch, HostRowPitch, HostSlicePitch, DstMem, Deps.size(), - Deps.data(), OutSyncPoint); + pi_result Result = + Plugin->call_nocheck( + CommandBuffer, + sycl::detail::pi::cast(SrcMem), + &BufferOffset, &HostOffset, &RectRegion, BufferRowPitch, + BufferSlicePitch, HostRowPitch, HostSlicePitch, DstMem, Deps.size(), + Deps.data(), OutSyncPoint); + if (Result == PI_ERROR_INVALID_OPERATION) { + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Device-to-host buffer copy command not supported by graph backend"); + } else { + Plugin->checkPiResult(Result); + } } } @@ -1576,10 +1595,20 @@ void MemoryManager::ext_oneapi_copyH2D_cmd_buffer( } if (1 == DimDst && 1 == DimSrc) { - Plugin->call( - CommandBuffer, sycl::detail::pi::cast(DstMem), - DstXOffBytes, DstAccessRangeWidthBytes, SrcMem + SrcXOffBytes, - Deps.size(), Deps.data(), OutSyncPoint); + pi_result Result = + Plugin->call_nocheck( + CommandBuffer, + sycl::detail::pi::cast(DstMem), + DstXOffBytes, DstAccessRangeWidthBytes, SrcMem + SrcXOffBytes, + Deps.size(), Deps.data(), OutSyncPoint); + + if (Result == PI_ERROR_INVALID_OPERATION) { + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Host-to-device buffer copy command not supported by graph backend"); + } else { + Plugin->checkPiResult(Result); + } } else { size_t BufferRowPitch = (1 == DimDst) ? 0 : DstSzWidthBytes; size_t BufferSlicePitch = @@ -1596,11 +1625,21 @@ void MemoryManager::ext_oneapi_copyH2D_cmd_buffer( DstAccessRange[DstPos.YTerm], DstAccessRange[DstPos.ZTerm]}; - Plugin->call( - CommandBuffer, sycl::detail::pi::cast(DstMem), - &BufferOffset, &HostOffset, &RectRegion, BufferRowPitch, - BufferSlicePitch, HostRowPitch, HostSlicePitch, SrcMem, Deps.size(), - Deps.data(), OutSyncPoint); + pi_result Result = + Plugin->call_nocheck( + CommandBuffer, + sycl::detail::pi::cast(DstMem), + &BufferOffset, &HostOffset, &RectRegion, BufferRowPitch, + BufferSlicePitch, HostRowPitch, HostSlicePitch, SrcMem, Deps.size(), + Deps.data(), OutSyncPoint); + + if (Result == PI_ERROR_INVALID_OPERATION) { + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Host-to-device buffer copy command not supported by graph backend"); + } else { + Plugin->checkPiResult(Result); + } } } @@ -1614,9 +1653,17 @@ void MemoryManager::ext_oneapi_copy_usm_cmd_buffer( PI_ERROR_INVALID_VALUE); const PluginPtr &Plugin = Context->getPlugin(); - Plugin->call( - CommandBuffer, DstMem, SrcMem, Len, Deps.size(), Deps.data(), - OutSyncPoint); + pi_result Result = + Plugin->call_nocheck( + CommandBuffer, DstMem, SrcMem, Len, Deps.size(), Deps.data(), + OutSyncPoint); + if (Result == PI_ERROR_INVALID_OPERATION) { + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "USM copy command not supported by graph backend"); + } else { + Plugin->checkPiResult(Result); + } } void MemoryManager::copy_image_bindless( diff --git a/sycl/test-e2e/Basic/alloc_pinned_host_memory.cpp b/sycl/test-e2e/Basic/alloc_pinned_host_memory.cpp index bee077f1ec872..0f525aca3f221 100644 --- a/sycl/test-e2e/Basic/alloc_pinned_host_memory.cpp +++ b/sycl/test-e2e/Basic/alloc_pinned_host_memory.cpp @@ -1,7 +1,7 @@ // REQUIRES: level_zero || cuda // RUN: %{build} -o %t2.out -// RUN: env SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t2.out %if ext_oneapi_level_zero %{ 2>&1 | FileCheck %s %} +// RUN: env SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t2.out %if ext_oneapi_level_zero %{ 2>&1 | FileCheck %s %} // RUN: %{run} %t2.out #include diff --git a/sycl/test-e2e/Basic/buffer/buffer_create.cpp b/sycl/test-e2e/Basic/buffer/buffer_create.cpp index 9f592258a53da..eda7f81d5f764 100644 --- a/sycl/test-e2e/Basic/buffer/buffer_create.cpp +++ b/sycl/test-e2e/Basic/buffer/buffer_create.cpp @@ -1,6 +1,6 @@ // REQUIRES: gpu,level_zero // RUN: %{build} -o %t.out -// RUN: env ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s // UNSUPPORTED: ze_debug #include diff --git a/sycl/test-e2e/Basic/report_code_loc.cpp b/sycl/test-e2e/Basic/report_code_loc.cpp index 38019e7b4f133..f7154f0032f54 100644 --- a/sycl/test-e2e/Basic/report_code_loc.cpp +++ b/sycl/test-e2e/Basic/report_code_loc.cpp @@ -2,7 +2,7 @@ * reported*/ // RUN: %{build} -o %t.out -// RUN: env ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s #include using namespace sycl; diff --git a/sycl/test-e2e/DiscardEvents/discard_events_l0_leak.cpp b/sycl/test-e2e/DiscardEvents/discard_events_l0_leak.cpp index 9292c863e3c1f..da9bc7d6f7a52 100644 --- a/sycl/test-e2e/DiscardEvents/discard_events_l0_leak.cpp +++ b/sycl/test-e2e/DiscardEvents/discard_events_l0_leak.cpp @@ -2,13 +2,13 @@ // // RUN: %{build} -o %t.out // -// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 ONEAPI_DEVICE_SELECTOR='level_zero:*' ZE_DEBUG=4 %{run} %t.out wait 2>&1 | FileCheck %s -// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 ONEAPI_DEVICE_SELECTOR='level_zero:*' ZE_DEBUG=4 %{run} %t.out nowait 2>&1 | FileCheck %s +// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 ONEAPI_DEVICE_SELECTOR='level_zero:*' UR_L0_LEAKS_DEBUG=1 %{run} %t.out wait 2>&1 | FileCheck %s +// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 ONEAPI_DEVICE_SELECTOR='level_zero:*' UR_L0_LEAKS_DEBUG=1 %{run} %t.out nowait 2>&1 | FileCheck %s // // CHECK-NOT: LEAK // // The test is to check that there are no leaks reported with the embedded -// ZE_DEBUG=4 testing capability. +// UR_L0_LEAKS_DEBUG=1 testing capability. // In addition to general leak checking, especially for discard_events, the test // checks that piKernelRelease to be executed for each kernel call, and // EventRelease for events, that are used for dependencies between diff --git a/sycl/test-e2e/Graph/Explicit/add_node_while_recording.cpp b/sycl/test-e2e/Graph/Explicit/add_node_while_recording.cpp index 8745a10e7ab97..352997bffac30 100644 --- a/sycl/test-e2e/Graph/Explicit/add_node_while_recording.cpp +++ b/sycl/test-e2e/Graph/Explicit/add_node_while_recording.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/add_nodes_after_finalize.cpp b/sycl/test-e2e/Graph/Explicit/add_nodes_after_finalize.cpp index d41484a285602..95a3b8bfbad07 100644 --- a/sycl/test-e2e/Graph/Explicit/add_nodes_after_finalize.cpp +++ b/sycl/test-e2e/Graph/Explicit/add_nodes_after_finalize.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/assume_buffer_outlives_graph_property.cpp b/sycl/test-e2e/Graph/Explicit/assume_buffer_outlives_graph_property.cpp index 91754164259e3..13317d586c0d1 100644 --- a/sycl/test-e2e/Graph/Explicit/assume_buffer_outlives_graph_property.cpp +++ b/sycl/test-e2e/Graph/Explicit/assume_buffer_outlives_graph_property.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/basic_buffer.cpp b/sycl/test-e2e/Graph/Explicit/basic_buffer.cpp index 60d83b985078d..70a191034f9ec 100644 --- a/sycl/test-e2e/Graph/Explicit/basic_buffer.cpp +++ b/sycl/test-e2e/Graph/Explicit/basic_buffer.cpp @@ -1,8 +1,8 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // diff --git a/sycl/test-e2e/Graph/Explicit/basic_usm.cpp b/sycl/test-e2e/Graph/Explicit/basic_usm.cpp index b6d765c60090e..3be134e1d0536 100644 --- a/sycl/test-e2e/Graph/Explicit/basic_usm.cpp +++ b/sycl/test-e2e/Graph/Explicit/basic_usm.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/basic_usm_host.cpp b/sycl/test-e2e/Graph/Explicit/basic_usm_host.cpp index ac4564ce5797f..3782479a94338 100644 --- a/sycl/test-e2e/Graph/Explicit/basic_usm_host.cpp +++ b/sycl/test-e2e/Graph/Explicit/basic_usm_host.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/basic_usm_mixed.cpp b/sycl/test-e2e/Graph/Explicit/basic_usm_mixed.cpp index 17a2827372667..c84fcff21fc1e 100644 --- a/sycl/test-e2e/Graph/Explicit/basic_usm_mixed.cpp +++ b/sycl/test-e2e/Graph/Explicit/basic_usm_mixed.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/basic_usm_shared.cpp b/sycl/test-e2e/Graph/Explicit/basic_usm_shared.cpp index 39843f07ff876..16755401b33da 100644 --- a/sycl/test-e2e/Graph/Explicit/basic_usm_shared.cpp +++ b/sycl/test-e2e/Graph/Explicit/basic_usm_shared.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/basic_usm_system.cpp b/sycl/test-e2e/Graph/Explicit/basic_usm_system.cpp index 2a8c69c2afca8..90bdc9bf5e536 100644 --- a/sycl/test-e2e/Graph/Explicit/basic_usm_system.cpp +++ b/sycl/test-e2e/Graph/Explicit/basic_usm_system.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/buffer_copy.cpp b/sycl/test-e2e/Graph/Explicit/buffer_copy.cpp index 09b6e47608e1e..f62d96bb3a1e5 100644 --- a/sycl/test-e2e/Graph/Explicit/buffer_copy.cpp +++ b/sycl/test-e2e/Graph/Explicit/buffer_copy.cpp @@ -1,8 +1,8 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // diff --git a/sycl/test-e2e/Graph/Explicit/buffer_copy_2d.cpp b/sycl/test-e2e/Graph/Explicit/buffer_copy_2d.cpp index 65084bfb186d0..2385d19ab93fa 100644 --- a/sycl/test-e2e/Graph/Explicit/buffer_copy_2d.cpp +++ b/sycl/test-e2e/Graph/Explicit/buffer_copy_2d.cpp @@ -1,8 +1,8 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // diff --git a/sycl/test-e2e/Graph/Explicit/buffer_copy_host2target.cpp b/sycl/test-e2e/Graph/Explicit/buffer_copy_host2target.cpp index c8f8f39804721..eb4c01fafaa21 100644 --- a/sycl/test-e2e/Graph/Explicit/buffer_copy_host2target.cpp +++ b/sycl/test-e2e/Graph/Explicit/buffer_copy_host2target.cpp @@ -1,13 +1,16 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // // TODO enable cuda once buffer issue investigated and fixed // UNSUPPORTED: cuda +// +// Host to device copy command not supported for OpenCL +// UNSUPPORTED: opencl #define GRAPH_E2E_EXPLICIT diff --git a/sycl/test-e2e/Graph/Explicit/buffer_copy_host2target_2d.cpp b/sycl/test-e2e/Graph/Explicit/buffer_copy_host2target_2d.cpp index da31f17c0c7dd..c18f8f70ac2bd 100644 --- a/sycl/test-e2e/Graph/Explicit/buffer_copy_host2target_2d.cpp +++ b/sycl/test-e2e/Graph/Explicit/buffer_copy_host2target_2d.cpp @@ -1,13 +1,16 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // // TODO enable cuda once buffer issue investigated and fixed // UNSUPPORTED: cuda +// +// Host to device copy command not supported for OpenCL +// UNSUPPORTED: opencl #define GRAPH_E2E_EXPLICIT diff --git a/sycl/test-e2e/Graph/Explicit/buffer_copy_host2target_offset.cpp b/sycl/test-e2e/Graph/Explicit/buffer_copy_host2target_offset.cpp index d29520d5ac9c5..acce309d6e966 100644 --- a/sycl/test-e2e/Graph/Explicit/buffer_copy_host2target_offset.cpp +++ b/sycl/test-e2e/Graph/Explicit/buffer_copy_host2target_offset.cpp @@ -1,13 +1,16 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // // TODO enable cuda once buffer issue investigated and fixed // UNSUPPORTED: cuda +// +// Host to device copy command not supported for OpenCL +// UNSUPPORTED: opencl #define GRAPH_E2E_EXPLICIT diff --git a/sycl/test-e2e/Graph/Explicit/buffer_copy_offsets.cpp b/sycl/test-e2e/Graph/Explicit/buffer_copy_offsets.cpp index 920828cac20d3..d91fdee779735 100644 --- a/sycl/test-e2e/Graph/Explicit/buffer_copy_offsets.cpp +++ b/sycl/test-e2e/Graph/Explicit/buffer_copy_offsets.cpp @@ -1,8 +1,8 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // diff --git a/sycl/test-e2e/Graph/Explicit/buffer_copy_target2host.cpp b/sycl/test-e2e/Graph/Explicit/buffer_copy_target2host.cpp index 9b5175567f9b8..34a0f4848f214 100644 --- a/sycl/test-e2e/Graph/Explicit/buffer_copy_target2host.cpp +++ b/sycl/test-e2e/Graph/Explicit/buffer_copy_target2host.cpp @@ -1,13 +1,16 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // // TODO enable cuda once buffer issue investigated and fixed // UNSUPPORTED: cuda +// +// Device to host copy command not supported for OpenCL +// UNSUPPORTED: opencl #define GRAPH_E2E_EXPLICIT diff --git a/sycl/test-e2e/Graph/Explicit/buffer_copy_target2host_2d.cpp b/sycl/test-e2e/Graph/Explicit/buffer_copy_target2host_2d.cpp index 09762d7b97897..2a5fb0d1b8ca0 100644 --- a/sycl/test-e2e/Graph/Explicit/buffer_copy_target2host_2d.cpp +++ b/sycl/test-e2e/Graph/Explicit/buffer_copy_target2host_2d.cpp @@ -1,13 +1,16 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // // TODO enable cuda once buffer issue investigated and fixed // UNSUPPORTED: cuda +// +// Device to host copy command not supported for OpenCL +// UNSUPPORTED: opencl #define GRAPH_E2E_EXPLICIT diff --git a/sycl/test-e2e/Graph/Explicit/buffer_copy_target2host_offset.cpp b/sycl/test-e2e/Graph/Explicit/buffer_copy_target2host_offset.cpp index 012b9df7dfe32..2182aead9b19c 100644 --- a/sycl/test-e2e/Graph/Explicit/buffer_copy_target2host_offset.cpp +++ b/sycl/test-e2e/Graph/Explicit/buffer_copy_target2host_offset.cpp @@ -1,13 +1,16 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // // TODO enable cuda once buffer issue investigated and fixed // UNSUPPORTED: cuda +// +// Device to host copy command not supported for OpenCL +// UNSUPPORTED: opencl #define GRAPH_E2E_EXPLICIT diff --git a/sycl/test-e2e/Graph/Explicit/buffer_ordering.cpp b/sycl/test-e2e/Graph/Explicit/buffer_ordering.cpp index 2c2edd374febc..4d60dd056b3a2 100644 --- a/sycl/test-e2e/Graph/Explicit/buffer_ordering.cpp +++ b/sycl/test-e2e/Graph/Explicit/buffer_ordering.cpp @@ -1,8 +1,8 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/cycle_error.cpp b/sycl/test-e2e/Graph/Explicit/cycle_error.cpp index bb0558c43f26e..07491e511c878 100644 --- a/sycl/test-e2e/Graph/Explicit/cycle_error.cpp +++ b/sycl/test-e2e/Graph/Explicit/cycle_error.cpp @@ -77,6 +77,14 @@ void CreateGraphWithCyclesTest(bool DisableCycleChecks) { } int main() { + { + queue Queue; + + if (!are_graphs_supported(Queue)) { + return 0; + } + } + // Test with cycle checks CreateGraphWithCyclesTest(false); // Test without cycle checks diff --git a/sycl/test-e2e/Graph/Explicit/depends_on.cpp b/sycl/test-e2e/Graph/Explicit/depends_on.cpp index 77e979f3edf4d..d8b2a195cfd16 100644 --- a/sycl/test-e2e/Graph/Explicit/depends_on.cpp +++ b/sycl/test-e2e/Graph/Explicit/depends_on.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/dotp_buffer_reduction.cpp b/sycl/test-e2e/Graph/Explicit/dotp_buffer_reduction.cpp index 9557bfd814240..5e21681436c46 100644 --- a/sycl/test-e2e/Graph/Explicit/dotp_buffer_reduction.cpp +++ b/sycl/test-e2e/Graph/Explicit/dotp_buffer_reduction.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/dotp_usm_reduction.cpp b/sycl/test-e2e/Graph/Explicit/dotp_usm_reduction.cpp index df66e5e9bb146..101961238f363 100644 --- a/sycl/test-e2e/Graph/Explicit/dotp_usm_reduction.cpp +++ b/sycl/test-e2e/Graph/Explicit/dotp_usm_reduction.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/double_buffer.cpp b/sycl/test-e2e/Graph/Explicit/double_buffer.cpp index 2468592c0f0cf..dee0673a6b1da 100644 --- a/sycl/test-e2e/Graph/Explicit/double_buffer.cpp +++ b/sycl/test-e2e/Graph/Explicit/double_buffer.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/empty_node.cpp b/sycl/test-e2e/Graph/Explicit/empty_node.cpp index 638ccbde77e18..45331ef79279e 100644 --- a/sycl/test-e2e/Graph/Explicit/empty_node.cpp +++ b/sycl/test-e2e/Graph/Explicit/empty_node.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/enqueue_ordering.cpp b/sycl/test-e2e/Graph/Explicit/enqueue_ordering.cpp index 198da9a7129de..869ff9afd9c67 100644 --- a/sycl/test-e2e/Graph/Explicit/enqueue_ordering.cpp +++ b/sycl/test-e2e/Graph/Explicit/enqueue_ordering.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/executable_graph_update.cpp b/sycl/test-e2e/Graph/Explicit/executable_graph_update.cpp index 9a56e18724d72..595c7ac9fdb28 100644 --- a/sycl/test-e2e/Graph/Explicit/executable_graph_update.cpp +++ b/sycl/test-e2e/Graph/Explicit/executable_graph_update.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/executable_graph_update_ordering.cpp b/sycl/test-e2e/Graph/Explicit/executable_graph_update_ordering.cpp index caed7820467dc..6cb1075422a13 100644 --- a/sycl/test-e2e/Graph/Explicit/executable_graph_update_ordering.cpp +++ b/sycl/test-e2e/Graph/Explicit/executable_graph_update_ordering.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK @@ -12,4 +12,4 @@ #define GRAPH_E2E_EXPLICIT -#include "../Inputs/executable_graph_update_ordering" +#include "../Inputs/executable_graph_update_ordering.cpp" diff --git a/sycl/test-e2e/Graph/Explicit/host_task.cpp b/sycl/test-e2e/Graph/Explicit/host_task.cpp index 3aff7e2807ee8..ef10a242d44ca 100644 --- a/sycl/test-e2e/Graph/Explicit/host_task.cpp +++ b/sycl/test-e2e/Graph/Explicit/host_task.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/multiple_exec_graphs.cpp b/sycl/test-e2e/Graph/Explicit/multiple_exec_graphs.cpp index 9de3fd735eee5..238ae9b8c0908 100644 --- a/sycl/test-e2e/Graph/Explicit/multiple_exec_graphs.cpp +++ b/sycl/test-e2e/Graph/Explicit/multiple_exec_graphs.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/multiple_kernel_bundles.cpp b/sycl/test-e2e/Graph/Explicit/multiple_kernel_bundles.cpp index 19a05d610e13f..2467be686e60b 100644 --- a/sycl/test-e2e/Graph/Explicit/multiple_kernel_bundles.cpp +++ b/sycl/test-e2e/Graph/Explicit/multiple_kernel_bundles.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/node_ordering.cpp b/sycl/test-e2e/Graph/Explicit/node_ordering.cpp index 6e3d965619c98..d7d7f0a1d7e7c 100644 --- a/sycl/test-e2e/Graph/Explicit/node_ordering.cpp +++ b/sycl/test-e2e/Graph/Explicit/node_ordering.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/queue_shortcuts.cpp b/sycl/test-e2e/Graph/Explicit/queue_shortcuts.cpp index 61d6ddad5a62b..297873046e770 100644 --- a/sycl/test-e2e/Graph/Explicit/queue_shortcuts.cpp +++ b/sycl/test-e2e/Graph/Explicit/queue_shortcuts.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/repeated_exec.cpp b/sycl/test-e2e/Graph/Explicit/repeated_exec.cpp index 495a5c3e7b2f7..233f0d24c755f 100644 --- a/sycl/test-e2e/Graph/Explicit/repeated_exec.cpp +++ b/sycl/test-e2e/Graph/Explicit/repeated_exec.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/single_node.cpp b/sycl/test-e2e/Graph/Explicit/single_node.cpp index 0fae78023b49d..ade35fa9fcf00 100644 --- a/sycl/test-e2e/Graph/Explicit/single_node.cpp +++ b/sycl/test-e2e/Graph/Explicit/single_node.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/spec_constants_handler_api.cpp b/sycl/test-e2e/Graph/Explicit/spec_constants_handler_api.cpp index 823786de3d694..1e3d49a13b5ac 100644 --- a/sycl/test-e2e/Graph/Explicit/spec_constants_handler_api.cpp +++ b/sycl/test-e2e/Graph/Explicit/spec_constants_handler_api.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/spec_constants_kernel_bundle_api.cpp b/sycl/test-e2e/Graph/Explicit/spec_constants_kernel_bundle_api.cpp index 3417dbc9754bd..d75ccdabd511f 100644 --- a/sycl/test-e2e/Graph/Explicit/spec_constants_kernel_bundle_api.cpp +++ b/sycl/test-e2e/Graph/Explicit/spec_constants_kernel_bundle_api.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/stream.cpp b/sycl/test-e2e/Graph/Explicit/stream.cpp index eaa55adafa302..5a65b78705aa5 100644 --- a/sycl/test-e2e/Graph/Explicit/stream.cpp +++ b/sycl/test-e2e/Graph/Explicit/stream.cpp @@ -1,7 +1,7 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out %GPU_CHECK_PLACEHOLDER -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out %GPU_CHECK_PLACEHOLDER 2>&1 | FileCheck %s %} +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out %GPU_CHECK_PLACEHOLDER 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/sub_graph.cpp b/sycl/test-e2e/Graph/Explicit/sub_graph.cpp index ff3a8c1b2eea9..30a6870f21926 100644 --- a/sycl/test-e2e/Graph/Explicit/sub_graph.cpp +++ b/sycl/test-e2e/Graph/Explicit/sub_graph.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/sub_graph_execute_without_parent.cpp b/sycl/test-e2e/Graph/Explicit/sub_graph_execute_without_parent.cpp index ad0badd14ed98..9a99647b550bc 100644 --- a/sycl/test-e2e/Graph/Explicit/sub_graph_execute_without_parent.cpp +++ b/sycl/test-e2e/Graph/Explicit/sub_graph_execute_without_parent.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/sub_graph_multiple_submission.cpp b/sycl/test-e2e/Graph/Explicit/sub_graph_multiple_submission.cpp index bc66115d8fa35..efe9a19caec39 100644 --- a/sycl/test-e2e/Graph/Explicit/sub_graph_multiple_submission.cpp +++ b/sycl/test-e2e/Graph/Explicit/sub_graph_multiple_submission.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/sub_graph_nested.cpp b/sycl/test-e2e/Graph/Explicit/sub_graph_nested.cpp index a1dc0e479da73..d9100b8a69c18 100644 --- a/sycl/test-e2e/Graph/Explicit/sub_graph_nested.cpp +++ b/sycl/test-e2e/Graph/Explicit/sub_graph_nested.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/sub_graph_reduction.cpp b/sycl/test-e2e/Graph/Explicit/sub_graph_reduction.cpp index 97e437cbc0f53..da3629cc6a5d2 100644 --- a/sycl/test-e2e/Graph/Explicit/sub_graph_reduction.cpp +++ b/sycl/test-e2e/Graph/Explicit/sub_graph_reduction.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/sub_graph_two_parent_graphs.cpp b/sycl/test-e2e/Graph/Explicit/sub_graph_two_parent_graphs.cpp index 7847981a86577..2e6a77486f123 100644 --- a/sycl/test-e2e/Graph/Explicit/sub_graph_two_parent_graphs.cpp +++ b/sycl/test-e2e/Graph/Explicit/sub_graph_two_parent_graphs.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/temp_buffer_reinterpret.cpp b/sycl/test-e2e/Graph/Explicit/temp_buffer_reinterpret.cpp index c8fd1d803266c..505bb5601c1fe 100644 --- a/sycl/test-e2e/Graph/Explicit/temp_buffer_reinterpret.cpp +++ b/sycl/test-e2e/Graph/Explicit/temp_buffer_reinterpret.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/usm_copy.cpp b/sycl/test-e2e/Graph/Explicit/usm_copy.cpp index 6025d1429ae84..b990e7bb4255f 100644 --- a/sycl/test-e2e/Graph/Explicit/usm_copy.cpp +++ b/sycl/test-e2e/Graph/Explicit/usm_copy.cpp @@ -1,10 +1,13 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK +// +// USM copy command not supported for OpenCL +// UNSUPPORTED: opencl #define GRAPH_E2E_EXPLICIT diff --git a/sycl/test-e2e/Graph/Explicit/usm_fill.cpp b/sycl/test-e2e/Graph/Explicit/usm_fill.cpp index 0605004c6b113..f47096ab4840e 100644 --- a/sycl/test-e2e/Graph/Explicit/usm_fill.cpp +++ b/sycl/test-e2e/Graph/Explicit/usm_fill.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/usm_fill_host.cpp b/sycl/test-e2e/Graph/Explicit/usm_fill_host.cpp index e1fdd8a40fbd9..384761fb7957c 100644 --- a/sycl/test-e2e/Graph/Explicit/usm_fill_host.cpp +++ b/sycl/test-e2e/Graph/Explicit/usm_fill_host.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Explicit/usm_fill_shared.cpp b/sycl/test-e2e/Graph/Explicit/usm_fill_shared.cpp index 064dc20273548..017b12d031db2 100644 --- a/sycl/test-e2e/Graph/Explicit/usm_fill_shared.cpp +++ b/sycl/test-e2e/Graph/Explicit/usm_fill_shared.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Inputs/buffer_ordering.cpp b/sycl/test-e2e/Graph/Inputs/buffer_ordering.cpp index e317857f43fe6..8ce71bc8e6f6a 100644 --- a/sycl/test-e2e/Graph/Inputs/buffer_ordering.cpp +++ b/sycl/test-e2e/Graph/Inputs/buffer_ordering.cpp @@ -12,7 +12,6 @@ #include "../graph_common.hpp" int main() { - queue Queue{{sycl::ext::intel::property::queue::no_immediate_command_list{}}}; const size_t N = 10; diff --git a/sycl/test-e2e/Graph/RecordReplay/add_nodes_after_finalize.cpp b/sycl/test-e2e/Graph/RecordReplay/add_nodes_after_finalize.cpp index 711a7c0838a1b..503964b84d4f6 100644 --- a/sycl/test-e2e/Graph/RecordReplay/add_nodes_after_finalize.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/add_nodes_after_finalize.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // diff --git a/sycl/test-e2e/Graph/RecordReplay/after_use.cpp b/sycl/test-e2e/Graph/RecordReplay/after_use.cpp index 01cc5aa51a1a6..8a3ae7624b077 100644 --- a/sycl/test-e2e/Graph/RecordReplay/after_use.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/after_use.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/assume_buffer_outlives_graph_property.cpp b/sycl/test-e2e/Graph/RecordReplay/assume_buffer_outlives_graph_property.cpp index 5a561a0835cb6..a2e7d9f5a725f 100644 --- a/sycl/test-e2e/Graph/RecordReplay/assume_buffer_outlives_graph_property.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/assume_buffer_outlives_graph_property.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/barrier_with_work.cpp b/sycl/test-e2e/Graph/RecordReplay/barrier_with_work.cpp index d88706474430f..2adcdc26558a2 100644 --- a/sycl/test-e2e/Graph/RecordReplay/barrier_with_work.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/barrier_with_work.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/basic_buffer.cpp b/sycl/test-e2e/Graph/RecordReplay/basic_buffer.cpp index aeee4b6f4cf2b..8b2dc746379e4 100644 --- a/sycl/test-e2e/Graph/RecordReplay/basic_buffer.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/basic_buffer.cpp @@ -1,8 +1,8 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // diff --git a/sycl/test-e2e/Graph/RecordReplay/basic_usm.cpp b/sycl/test-e2e/Graph/RecordReplay/basic_usm.cpp index 988e22b75d049..d3a6645b0e838 100644 --- a/sycl/test-e2e/Graph/RecordReplay/basic_usm.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/basic_usm.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/basic_usm_host.cpp b/sycl/test-e2e/Graph/RecordReplay/basic_usm_host.cpp index d60dc0f454242..7f9a32a8f0f91 100644 --- a/sycl/test-e2e/Graph/RecordReplay/basic_usm_host.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/basic_usm_host.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/basic_usm_mixed.cpp b/sycl/test-e2e/Graph/RecordReplay/basic_usm_mixed.cpp index 4645f079cd004..fd8dd9f529c7d 100644 --- a/sycl/test-e2e/Graph/RecordReplay/basic_usm_mixed.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/basic_usm_mixed.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/basic_usm_shared.cpp b/sycl/test-e2e/Graph/RecordReplay/basic_usm_shared.cpp index 51747fa00f7a6..9cbeec1d94e97 100644 --- a/sycl/test-e2e/Graph/RecordReplay/basic_usm_shared.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/basic_usm_shared.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/basic_usm_system.cpp b/sycl/test-e2e/Graph/RecordReplay/basic_usm_system.cpp index 360cb915f757e..ef6898f8a4bc5 100644 --- a/sycl/test-e2e/Graph/RecordReplay/basic_usm_system.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/basic_usm_system.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/buffer_copy.cpp b/sycl/test-e2e/Graph/RecordReplay/buffer_copy.cpp index b78ee6d160395..232a1f55dbd2d 100644 --- a/sycl/test-e2e/Graph/RecordReplay/buffer_copy.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/buffer_copy.cpp @@ -1,8 +1,8 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // diff --git a/sycl/test-e2e/Graph/RecordReplay/buffer_copy_2d.cpp b/sycl/test-e2e/Graph/RecordReplay/buffer_copy_2d.cpp index f72ed81b5856a..f5987adab5076 100644 --- a/sycl/test-e2e/Graph/RecordReplay/buffer_copy_2d.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/buffer_copy_2d.cpp @@ -1,8 +1,8 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // diff --git a/sycl/test-e2e/Graph/RecordReplay/buffer_copy_host2target.cpp b/sycl/test-e2e/Graph/RecordReplay/buffer_copy_host2target.cpp index b72759f0a4067..d362e4c89094c 100644 --- a/sycl/test-e2e/Graph/RecordReplay/buffer_copy_host2target.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/buffer_copy_host2target.cpp @@ -1,13 +1,16 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // // TODO enable cuda once buffer issue investigated and fixed // UNSUPPORTED: cuda +// +// Host to device copy command not supported for OpenCL +// UNSUPPORTED: opencl #define GRAPH_E2E_RECORD_REPLAY diff --git a/sycl/test-e2e/Graph/RecordReplay/buffer_copy_host2target_2d.cpp b/sycl/test-e2e/Graph/RecordReplay/buffer_copy_host2target_2d.cpp index 5af65c7a679a4..e0a84c3ecec4a 100644 --- a/sycl/test-e2e/Graph/RecordReplay/buffer_copy_host2target_2d.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/buffer_copy_host2target_2d.cpp @@ -1,13 +1,16 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // // TODO enable cuda once buffer issue investigated and fixed // UNSUPPORTED: cuda +// +// Host to device copy command not supported for OpenCL +// UNSUPPORTED: opencl #define GRAPH_E2E_RECORD_REPLAY diff --git a/sycl/test-e2e/Graph/RecordReplay/buffer_copy_host2target_offset.cpp b/sycl/test-e2e/Graph/RecordReplay/buffer_copy_host2target_offset.cpp index da446a0d11085..7adb73d7f33dd 100644 --- a/sycl/test-e2e/Graph/RecordReplay/buffer_copy_host2target_offset.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/buffer_copy_host2target_offset.cpp @@ -1,13 +1,16 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // // TODO enable cuda once buffer issue investigated and fixed // UNSUPPORTED: cuda +// +// Host to device copy command not supported for OpenCL +// UNSUPPORTED: opencl #define GRAPH_E2E_RECORD_REPLAY diff --git a/sycl/test-e2e/Graph/RecordReplay/buffer_copy_offsets.cpp b/sycl/test-e2e/Graph/RecordReplay/buffer_copy_offsets.cpp index 75fab329068cb..f70a3826d99ad 100644 --- a/sycl/test-e2e/Graph/RecordReplay/buffer_copy_offsets.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/buffer_copy_offsets.cpp @@ -1,8 +1,8 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // diff --git a/sycl/test-e2e/Graph/RecordReplay/buffer_copy_target2host.cpp b/sycl/test-e2e/Graph/RecordReplay/buffer_copy_target2host.cpp index bc5889d6c4f6b..0eb88e692f889 100644 --- a/sycl/test-e2e/Graph/RecordReplay/buffer_copy_target2host.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/buffer_copy_target2host.cpp @@ -1,13 +1,16 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // // TODO enable cuda once buffer issue investigated and fixed // UNSUPPORTED: cuda +// +// Device to host copy command not supported for OpenCL +// UNSUPPORTED: opencl #define GRAPH_E2E_RECORD_REPLAY diff --git a/sycl/test-e2e/Graph/RecordReplay/buffer_copy_target2host_2d.cpp b/sycl/test-e2e/Graph/RecordReplay/buffer_copy_target2host_2d.cpp index 46091b899edcb..6430d23a2a6d4 100644 --- a/sycl/test-e2e/Graph/RecordReplay/buffer_copy_target2host_2d.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/buffer_copy_target2host_2d.cpp @@ -1,13 +1,16 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // // TODO enable cuda once buffer issue investigated and fixed // UNSUPPORTED: cuda +// +// Device to host copy command not supported for OpenCL +// UNSUPPORTED: opencl #define GRAPH_E2E_RECORD_REPLAY diff --git a/sycl/test-e2e/Graph/RecordReplay/buffer_copy_target2host_offset.cpp b/sycl/test-e2e/Graph/RecordReplay/buffer_copy_target2host_offset.cpp index 72b1f5772ffca..c4dea077d9b21 100644 --- a/sycl/test-e2e/Graph/RecordReplay/buffer_copy_target2host_offset.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/buffer_copy_target2host_offset.cpp @@ -1,13 +1,16 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // // TODO enable cuda once buffer issue investigated and fixed // UNSUPPORTED: cuda +// +// Device to host copy command not supported for OpenCL +// UNSUPPORTED: opencl #define GRAPH_E2E_RECORD_REPLAY diff --git a/sycl/test-e2e/Graph/RecordReplay/buffer_ordering.cpp b/sycl/test-e2e/Graph/RecordReplay/buffer_ordering.cpp index 9910cc82d6e6b..53ae0c972c954 100644 --- a/sycl/test-e2e/Graph/RecordReplay/buffer_ordering.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/buffer_ordering.cpp @@ -1,8 +1,8 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/concurrent_queue.cpp b/sycl/test-e2e/Graph/RecordReplay/concurrent_queue.cpp index b48ce2f65df57..175d992cda888 100644 --- a/sycl/test-e2e/Graph/RecordReplay/concurrent_queue.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/concurrent_queue.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/dotp_buffer_reduction.cpp b/sycl/test-e2e/Graph/RecordReplay/dotp_buffer_reduction.cpp index 8a3de62784020..38e61acb16ff4 100644 --- a/sycl/test-e2e/Graph/RecordReplay/dotp_buffer_reduction.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/dotp_buffer_reduction.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/dotp_in_order.cpp b/sycl/test-e2e/Graph/RecordReplay/dotp_in_order.cpp index 505a8716dab1f..d59c78913e99e 100644 --- a/sycl/test-e2e/Graph/RecordReplay/dotp_in_order.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/dotp_in_order.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/dotp_in_order_with_empty_nodes.cpp b/sycl/test-e2e/Graph/RecordReplay/dotp_in_order_with_empty_nodes.cpp index 20aae12d3b2e8..4705ef8d80200 100644 --- a/sycl/test-e2e/Graph/RecordReplay/dotp_in_order_with_empty_nodes.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/dotp_in_order_with_empty_nodes.cpp @@ -1,14 +1,14 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // Tests a dotp operation using device USM and an in-order queue with empty // nodes. The second run is to check that there are no leaks reported with the -// embedded ZE_DEBUG=4 testing capability. +// embedded UR_L0_LEAKS_DEBUG=1 testing capability. #include "../graph_common.hpp" diff --git a/sycl/test-e2e/Graph/RecordReplay/dotp_multiple_queues.cpp b/sycl/test-e2e/Graph/RecordReplay/dotp_multiple_queues.cpp index 08d2655d2e29c..5dd93647d96e8 100644 --- a/sycl/test-e2e/Graph/RecordReplay/dotp_multiple_queues.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/dotp_multiple_queues.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK @@ -11,7 +11,6 @@ #include "../graph_common.hpp" int main() { - property_list Properties{ property::queue::in_order{}, sycl::ext::intel::property::queue::no_immediate_command_list{}}; diff --git a/sycl/test-e2e/Graph/RecordReplay/dotp_usm_reduction.cpp b/sycl/test-e2e/Graph/RecordReplay/dotp_usm_reduction.cpp index c16582dd20f84..c665e44dae053 100644 --- a/sycl/test-e2e/Graph/RecordReplay/dotp_usm_reduction.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/dotp_usm_reduction.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/double_buffer.cpp b/sycl/test-e2e/Graph/RecordReplay/double_buffer.cpp index 5eeb2207ec788..fe4d1f72ae01f 100644 --- a/sycl/test-e2e/Graph/RecordReplay/double_buffer.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/double_buffer.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/empty_node.cpp b/sycl/test-e2e/Graph/RecordReplay/empty_node.cpp index 95cf1baa62835..d470b9b85b864 100644 --- a/sycl/test-e2e/Graph/RecordReplay/empty_node.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/empty_node.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/executable_graph_update.cpp b/sycl/test-e2e/Graph/RecordReplay/executable_graph_update.cpp index 59759b2eb6c75..62ece9d1bbfa2 100644 --- a/sycl/test-e2e/Graph/RecordReplay/executable_graph_update.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/executable_graph_update.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/executable_graph_update_ordering.cpp b/sycl/test-e2e/Graph/RecordReplay/executable_graph_update_ordering.cpp index 9e429f7d06a22..59fdfae68277b 100644 --- a/sycl/test-e2e/Graph/RecordReplay/executable_graph_update_ordering.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/executable_graph_update_ordering.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK @@ -12,4 +12,4 @@ #define GRAPH_E2E_RECORD_REPLAY -#include "../Inputs/executable_graph_update_ordering" +#include "../Inputs/executable_graph_update_ordering.cpp" diff --git a/sycl/test-e2e/Graph/RecordReplay/finalize_while_recording.cpp b/sycl/test-e2e/Graph/RecordReplay/finalize_while_recording.cpp index b681ac07ac365..885b779dbb8e0 100644 --- a/sycl/test-e2e/Graph/RecordReplay/finalize_while_recording.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/finalize_while_recording.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/host_task.cpp b/sycl/test-e2e/Graph/RecordReplay/host_task.cpp index a8c6bd2d6678a..72f3d47a88377 100644 --- a/sycl/test-e2e/Graph/RecordReplay/host_task.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/host_task.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/multiple_exec_graphs.cpp b/sycl/test-e2e/Graph/RecordReplay/multiple_exec_graphs.cpp index 1a6754619f7d0..716e2d08a29e0 100644 --- a/sycl/test-e2e/Graph/RecordReplay/multiple_exec_graphs.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/multiple_exec_graphs.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/multiple_kernel_bundles.cpp b/sycl/test-e2e/Graph/RecordReplay/multiple_kernel_bundles.cpp index 0d9030ebbae86..a6426eb11224f 100644 --- a/sycl/test-e2e/Graph/RecordReplay/multiple_kernel_bundles.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/multiple_kernel_bundles.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/queue_shortcuts.cpp b/sycl/test-e2e/Graph/RecordReplay/queue_shortcuts.cpp index 423fc47a3fe1a..73eef857ceba6 100644 --- a/sycl/test-e2e/Graph/RecordReplay/queue_shortcuts.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/queue_shortcuts.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/repeated_exec.cpp b/sycl/test-e2e/Graph/RecordReplay/repeated_exec.cpp index 4e5f0d35dbdd5..e21cebdcf46ad 100644 --- a/sycl/test-e2e/Graph/RecordReplay/repeated_exec.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/repeated_exec.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/return_values.cpp b/sycl/test-e2e/Graph/RecordReplay/return_values.cpp index 7804ae8377935..49f8677d27c19 100644 --- a/sycl/test-e2e/Graph/RecordReplay/return_values.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/return_values.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/spec_constants_handler_api.cpp b/sycl/test-e2e/Graph/RecordReplay/spec_constants_handler_api.cpp index c602e6e7d2808..3a5745f3ff6ad 100644 --- a/sycl/test-e2e/Graph/RecordReplay/spec_constants_handler_api.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/spec_constants_handler_api.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/spec_constants_kernel_bundle_api.cpp b/sycl/test-e2e/Graph/RecordReplay/spec_constants_kernel_bundle_api.cpp index da0ed273e102b..60c8d6cf802c6 100644 --- a/sycl/test-e2e/Graph/RecordReplay/spec_constants_kernel_bundle_api.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/spec_constants_kernel_bundle_api.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/stream.cpp b/sycl/test-e2e/Graph/RecordReplay/stream.cpp index d395b624d5055..f235af598b169 100644 --- a/sycl/test-e2e/Graph/RecordReplay/stream.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/stream.cpp @@ -1,7 +1,7 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out %GPU_CHECK_PLACEHOLDER -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out %GPU_CHECK_PLACEHOLDER 2>&1 | FileCheck %s %} +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out %GPU_CHECK_PLACEHOLDER 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/sub_graph.cpp b/sycl/test-e2e/Graph/RecordReplay/sub_graph.cpp index 11f89afad5f20..1339aab5afb37 100644 --- a/sycl/test-e2e/Graph/RecordReplay/sub_graph.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/sub_graph.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/sub_graph_execute_without_parent.cpp b/sycl/test-e2e/Graph/RecordReplay/sub_graph_execute_without_parent.cpp index afa6ec38574a4..f1129c72272e1 100644 --- a/sycl/test-e2e/Graph/RecordReplay/sub_graph_execute_without_parent.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/sub_graph_execute_without_parent.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/sub_graph_in_order.cpp b/sycl/test-e2e/Graph/RecordReplay/sub_graph_in_order.cpp index 9bc0d33b92f19..e446b55f5eaf5 100644 --- a/sycl/test-e2e/Graph/RecordReplay/sub_graph_in_order.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/sub_graph_in_order.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/sub_graph_multiple_submission.cpp b/sycl/test-e2e/Graph/RecordReplay/sub_graph_multiple_submission.cpp index 767cf279b7c06..0097eeed050b1 100644 --- a/sycl/test-e2e/Graph/RecordReplay/sub_graph_multiple_submission.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/sub_graph_multiple_submission.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/sub_graph_nested.cpp b/sycl/test-e2e/Graph/RecordReplay/sub_graph_nested.cpp index 75865f6f08697..0a853add87ee7 100644 --- a/sycl/test-e2e/Graph/RecordReplay/sub_graph_nested.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/sub_graph_nested.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/sub_graph_reduction.cpp b/sycl/test-e2e/Graph/RecordReplay/sub_graph_reduction.cpp index 358a906035569..5316d58a54662 100644 --- a/sycl/test-e2e/Graph/RecordReplay/sub_graph_reduction.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/sub_graph_reduction.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/sub_graph_two_parent_graphs.cpp b/sycl/test-e2e/Graph/RecordReplay/sub_graph_two_parent_graphs.cpp index 382d1ab67fb18..a41cceec98f42 100644 --- a/sycl/test-e2e/Graph/RecordReplay/sub_graph_two_parent_graphs.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/sub_graph_two_parent_graphs.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/temp_buffer.cpp b/sycl/test-e2e/Graph/RecordReplay/temp_buffer.cpp index 97aa3e8366872..ac59361faee13 100644 --- a/sycl/test-e2e/Graph/RecordReplay/temp_buffer.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/temp_buffer.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/temp_buffer_reinterpret.cpp b/sycl/test-e2e/Graph/RecordReplay/temp_buffer_reinterpret.cpp index 1a124ae49d3b3..ec388df6ff054 100644 --- a/sycl/test-e2e/Graph/RecordReplay/temp_buffer_reinterpret.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/temp_buffer_reinterpret.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/temp_scope.cpp b/sycl/test-e2e/Graph/RecordReplay/temp_scope.cpp index dfad2e35a664b..717e617a6707d 100644 --- a/sycl/test-e2e/Graph/RecordReplay/temp_scope.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/temp_scope.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/usm_copy.cpp b/sycl/test-e2e/Graph/RecordReplay/usm_copy.cpp index b9ddfb58189ce..b70317550454a 100644 --- a/sycl/test-e2e/Graph/RecordReplay/usm_copy.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/usm_copy.cpp @@ -1,10 +1,13 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK +// +// USM copy command not supported for OpenCL +// UNSUPPORTED: opencl #define GRAPH_E2E_RECORD_REPLAY diff --git a/sycl/test-e2e/Graph/RecordReplay/usm_copy_in_order.cpp b/sycl/test-e2e/Graph/RecordReplay/usm_copy_in_order.cpp index 2a1d45a6494b0..8856dd2ec569d 100644 --- a/sycl/test-e2e/Graph/RecordReplay/usm_copy_in_order.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/usm_copy_in_order.cpp @@ -1,10 +1,13 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK +// +// USM copy command not supported for OpenCL +// UNSUPPORTED: opencl // Tests memcpy operation using device USM and an in-order queue. diff --git a/sycl/test-e2e/Graph/RecordReplay/usm_fill.cpp b/sycl/test-e2e/Graph/RecordReplay/usm_fill.cpp index 4b48ef5fb4b5f..0a3fb6acf1c5d 100644 --- a/sycl/test-e2e/Graph/RecordReplay/usm_fill.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/usm_fill.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/usm_fill_host.cpp b/sycl/test-e2e/Graph/RecordReplay/usm_fill_host.cpp index ce53c03a22b53..0647555fbb47e 100644 --- a/sycl/test-e2e/Graph/RecordReplay/usm_fill_host.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/usm_fill_host.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/usm_fill_shared.cpp b/sycl/test-e2e/Graph/RecordReplay/usm_fill_shared.cpp index 9b99e85c634ca..6b2a33b200984 100644 --- a/sycl/test-e2e/Graph/RecordReplay/usm_fill_shared.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/usm_fill_shared.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/RecordReplay/valid_no_end.cpp b/sycl/test-e2e/Graph/RecordReplay/valid_no_end.cpp index ae6847b9c8a88..6c712c665d70e 100644 --- a/sycl/test-e2e/Graph/RecordReplay/valid_no_end.cpp +++ b/sycl/test-e2e/Graph/RecordReplay/valid_no_end.cpp @@ -1,8 +1,8 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// Extra run to check for leaks in Level Zero using ZE_DEBUG -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/Threading/submit.cpp b/sycl/test-e2e/Graph/Threading/submit.cpp index 33ba51988ac2b..75856e5fc7044 100644 --- a/sycl/test-e2e/Graph/Threading/submit.cpp +++ b/sycl/test-e2e/Graph/Threading/submit.cpp @@ -1,13 +1,13 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build_pthread_inc} -o %t.out // RUN: %{run} %t.out -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // Test submitting a graph in a threaded situation. // The second run is to check that there are no leaks reported with the embedded -// ZE_DEBUG=4 testing capability. +// UR_L0_LEAKS_DEBUG=1 testing capability. // Note that we do not check the outputs becuse multiple concurrent executions // is indeterministic (and depends on the backend command management). diff --git a/sycl/test-e2e/Graph/device_query.cpp b/sycl/test-e2e/Graph/device_query.cpp index d9fbe99a16e2d..db0eb5b6f8610 100644 --- a/sycl/test-e2e/Graph/device_query.cpp +++ b/sycl/test-e2e/Graph/device_query.cpp @@ -1,4 +1,3 @@ -// REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out @@ -19,6 +18,11 @@ int main() { if ((Backend == backend::ext_oneapi_level_zero) || (Backend == backend::ext_oneapi_cuda)) { assert(SupportsGraphs == exp_ext::graph_support_level::native); + } else if (Backend == backend::opencl) { + // OpenCL backend support is conditional on the cl_khr_command_buffer + // extension being available + assert(SupportsGraphs == exp_ext::graph_support_level::native || + SupportsGraphs == exp_ext::graph_support_level::unsupported); } else { assert(SupportsGraphs == exp_ext::graph_support_level::unsupported); } diff --git a/sycl/test-e2e/Graph/immediate_command_list_error.cpp b/sycl/test-e2e/Graph/immediate_command_list_error.cpp index bad3fac48007c..a966202c2e45d 100644 --- a/sycl/test-e2e/Graph/immediate_command_list_error.cpp +++ b/sycl/test-e2e/Graph/immediate_command_list_error.cpp @@ -1,7 +1,7 @@ // REQUIRES: level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Graph/submission_while_executing.cpp b/sycl/test-e2e/Graph/submission_while_executing.cpp index 1cad91e6bab45..1ccb2e31714c3 100644 --- a/sycl/test-e2e/Graph/submission_while_executing.cpp +++ b/sycl/test-e2e/Graph/submission_while_executing.cpp @@ -1,13 +1,13 @@ // REQUIRES: cuda || level_zero, gpu // RUN: %{build} -o %t.out // RUN: %{run} %t.out -// RUN: %if ext_oneapi_level_zero %{env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s %} +// RUN: %if ext_oneapi_level_zero %{env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s %} // // CHECK-NOT: LEAK // Test calling queue::submit(graph) while the previous submission of graph has // not been completed. The second run is to check that there are no leaks -// reported with the embedded ZE_DEBUG=4 testing capability. +// reported with the embedded UR_L0_LEAKS_DEBUG=1 testing capability. #include "graph_common.hpp" diff --git a/sycl/test-e2e/KernelAndProgram/level-zero-static-link-flow.cpp b/sycl/test-e2e/KernelAndProgram/level-zero-static-link-flow.cpp index 3446ef91a7189..f904f62b0d825 100644 --- a/sycl/test-e2e/KernelAndProgram/level-zero-static-link-flow.cpp +++ b/sycl/test-e2e/KernelAndProgram/level-zero-static-link-flow.cpp @@ -1,7 +1,7 @@ // REQUIRES: level_zero // UNSUPPORTED: ze_debug // RUN: %{build} -o %t.out -// RUN: env SYCL_PI_TRACE=-1 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env SYCL_PI_TRACE=-1 UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s // //==--- level-zero-static-link-flow.cpp.cpp - Check L0 static link flow --==// // diff --git a/sycl/test-e2e/Plugin/interop-level-zero-buffer-ownership.cpp b/sycl/test-e2e/Plugin/interop-level-zero-buffer-ownership.cpp index 664a1c87e3271..877c54870f3ad 100644 --- a/sycl/test-e2e/Plugin/interop-level-zero-buffer-ownership.cpp +++ b/sycl/test-e2e/Plugin/interop-level-zero-buffer-ownership.cpp @@ -3,7 +3,7 @@ // account direct calls to L0 API. // UNSUPPORTED: ze_debug // RUN: %{build} %level_zero_options -o %t.out -// RUN: env SYCL_PI_LEVEL_ZERO_DISABLE_USM_ALLOCATOR=1 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env SYCL_PI_LEVEL_ZERO_DISABLE_USM_ALLOCATOR=1 UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s // Test for Level Zero buffer interop API. // Check the following cases: @@ -13,7 +13,7 @@ // "transfer" ownership is specified. // NOTE: SYCL RT will see unbalanced count of alloc/free, -// so this test will fail with ZE_DEBUG=4. +// so this test will fail with UR_L0_LEAKS_DEBUG=1. // Keep ownership // CHECK: zeMemFree diff --git a/sycl/test-e2e/Plugin/interop-level-zero-buffer.cpp b/sycl/test-e2e/Plugin/interop-level-zero-buffer.cpp index 92ed9ef8720e4..4829f8f651633 100644 --- a/sycl/test-e2e/Plugin/interop-level-zero-buffer.cpp +++ b/sycl/test-e2e/Plugin/interop-level-zero-buffer.cpp @@ -3,7 +3,7 @@ // account direct calls to L0 API. // UNSUPPORTED: ze_debug // RUN: %{build} %level_zero_options -o %t.out -// RUN: env ZE_DEBUG=1 %{run} %t.out +// RUN: env UR_L0_DEBUG=1 %{run} %t.out // Test interoperability buffer for the Level Zer backend diff --git a/sycl/test-e2e/Plugin/interop-level-zero-image-ownership.cpp b/sycl/test-e2e/Plugin/interop-level-zero-image-ownership.cpp index de48bdade67f4..d53d97c89972d 100644 --- a/sycl/test-e2e/Plugin/interop-level-zero-image-ownership.cpp +++ b/sycl/test-e2e/Plugin/interop-level-zero-image-ownership.cpp @@ -8,7 +8,7 @@ // UNSUPPORTED: O0 // RUN: %{build} %level_zero_options -o %t.out -// RUN: env ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s // This test verifies that ownership is working correctly. // If ownership is ::transfer then the ~image destructor will end up calling diff --git a/sycl/test-e2e/Plugin/level-zero-event-leak.cpp b/sycl/test-e2e/Plugin/level-zero-event-leak.cpp index c05bcbbc3eed4..064aaf8d17ae5 100644 --- a/sycl/test-e2e/Plugin/level-zero-event-leak.cpp +++ b/sycl/test-e2e/Plugin/level-zero-event-leak.cpp @@ -1,20 +1,20 @@ // REQUIRES: level_zero, level_zero_dev_kit // // RUN: %{build} %level_zero_options -o %t.out -// RUN: env ZE_DEBUG=4 %{run} %t.out wait 2>&1 | FileCheck %s -// RUN: env ZE_DEBUG=4 %{run} %t.out nowait 2>&1 | FileCheck %s +// RUN: env UR_L0_LEAKS_DEBUG=1 %{run} %t.out wait 2>&1 | FileCheck %s +// RUN: env UR_L0_LEAKS_DEBUG=1 %{run} %t.out nowait 2>&1 | FileCheck %s // // RUN: %{build} %level_zero_options -DCHECK_INORDER -o %t.inorder.out -// RUN: env ZE_DEBUG=4 %{run} %t.inorder.out wait 2>&1 | FileCheck %s -// RUN: env ZE_DEBUG=4 %{run} %t.inorder.out nowait 2>&1 | FileCheck %s +// RUN: env UR_L0_LEAKS_DEBUG=1 %{run} %t.inorder.out wait 2>&1 | FileCheck %s +// RUN: env UR_L0_LEAKS_DEBUG=1 %{run} %t.inorder.out nowait 2>&1 | FileCheck %s // // CHECK-NOT: LEAK // The test is to check that there are no leaks reported with the embedded -// ZE_DEBUG=4 testing capability. Example of a leak reported is this: +// UR_L0_LEAKS_DEBUG=1 testing capability. Example of a leak reported is this: // // clang-format off -// ZE_DEBUG=4: check balance of create/destroy calls +// Check balance of create/destroy calls // ---------------------------------------------------------- // zeContextCreate = 1 \---> zeContextDestroy = 1 // zeCommandQueueCreate = 1 \---> zeCommandQueueDestroy = 0 ---> LEAK = 1 diff --git a/sycl/test-e2e/Plugin/level_zero_barrier_optimization.cpp b/sycl/test-e2e/Plugin/level_zero_barrier_optimization.cpp index a77e15007b7c4..5df66e474535f 100644 --- a/sycl/test-e2e/Plugin/level_zero_barrier_optimization.cpp +++ b/sycl/test-e2e/Plugin/level_zero_barrier_optimization.cpp @@ -1,6 +1,6 @@ // REQUIRES: level_zero // RUN: %{build} -o %t.out -// RUN: env SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s // Test to check that we don't insert unnecessary L0 commands for // queue::ext_oneapi_submit_barrier() when we have in-order queue. @@ -10,6 +10,8 @@ int main() { sycl::queue Q1({sycl::property::queue::in_order{}}); sycl::queue Q2({sycl::property::queue::in_order{}}); + sycl::queue Q3({sycl::property::queue::in_order{}, + sycl::property::queue::enable_profiling{}}); // Test case 1 - events in the barrier's waitlist are from different queues. std::cout << "Test1" << std::endl; @@ -126,5 +128,30 @@ int main() { assert(Event11.get_info() == sycl::info::event_command_status::complete); + // Test case 6 - submit barrier after queue sync with profiling enabled, i.e. + // last event = nullptr. + std::cout << "Test3" << std::endl; + auto Event12 = Q3.submit( + [&](sycl::handler &cgh) { cgh.single_task([]() {}); }); + auto Event13 = Q3.submit( + [&](sycl::handler &cgh) { cgh.single_task([]() {}); }); + Q3.wait(); + + // CHECK: Test3 + // CHECK: ---> piEnqueueEventsWaitWithBarrier( + // CHECK: ZE ---> zeEventCreate + // CHECK-NOT: ZE ---> zeCommandListAppendWaitOnEvents + // CHECK-NOT: ZE ---> zeCommandListAppendSignalEvent + // CHECK: ZE ---> zeCommandListAppendBarrier + // CHECK: ) ---> pi_result : PI_SUCCESS + auto BarrierEvent6 = Q3.ext_oneapi_submit_barrier({Event12, Event13}); + BarrierEvent6.wait(); + + // Check that kernel events are completed after waiting for barrier event. + assert(Event12.get_info() == + sycl::info::event_command_status::complete); + assert(Event13.get_info() == + sycl::info::event_command_status::complete); + return 0; } diff --git a/sycl/test-e2e/Plugin/level_zero_batch_barrier.cpp b/sycl/test-e2e/Plugin/level_zero_batch_barrier.cpp index a80a35849f78f..996438969b918 100644 --- a/sycl/test-e2e/Plugin/level_zero_batch_barrier.cpp +++ b/sycl/test-e2e/Plugin/level_zero_batch_barrier.cpp @@ -1,7 +1,7 @@ // REQUIRES: gpu, level_zero, level_zero_dev_kit // RUN: %{build} %level_zero_options -o %t.out -// RUN: env SYCL_PI_TRACE=2 ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env SYCL_PI_TRACE=2 UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{run} %t.out 2>&1 | FileCheck %s // Test that the wait with a barrier is fully batched, i.e. it doesn't cause // extra submissions. diff --git a/sycl/test-e2e/Plugin/level_zero_batch_event_status.cpp b/sycl/test-e2e/Plugin/level_zero_batch_event_status.cpp index f19362ee5d717..76890edaea93d 100644 --- a/sycl/test-e2e/Plugin/level_zero_batch_event_status.cpp +++ b/sycl/test-e2e/Plugin/level_zero_batch_event_status.cpp @@ -4,7 +4,7 @@ // RUN: %{build} -o %t.out // Set batching to 4 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s // level_zero_batch_test.cpp // diff --git a/sycl/test-e2e/Plugin/level_zero_batch_test.cpp b/sycl/test-e2e/Plugin/level_zero_batch_test.cpp index b7a5fafba837b..4c5e23002692c 100644 --- a/sycl/test-e2e/Plugin/level_zero_batch_test.cpp +++ b/sycl/test-e2e/Plugin/level_zero_batch_test.cpp @@ -7,69 +7,69 @@ // To test batching on out-of-order queue: // Set batching to 4 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.ooo.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB4 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.ooo.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB4 %s // Set batching to 1 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=1 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.ooo.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB1 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=1 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.ooo.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB1 %s // Set batching to 3 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=3 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.ooo.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB3 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=3 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.ooo.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB3 %s // Set batching to 5 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=5 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.ooo.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB5 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=5 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.ooo.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB5 %s // Set batching to 7 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=7 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.ooo.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB7 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=7 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.ooo.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB7 %s // Set batching to 8 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=8 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.ooo.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB8 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=8 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.ooo.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB8 %s // Set batching to 9 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=9 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.ooo.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB9 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=9 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.ooo.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB9 %s // To test batching on in-order queue: // Set batching to 4 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.ino.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB4 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.ino.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB4 %s // Set batching to 1 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=1 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.ino.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB1 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=1 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.ino.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB1 %s // Set batching to 3 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=3 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.ino.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB3 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=3 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.ino.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB3 %s // Set batching to 5 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=5 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.ino.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB5 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=5 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.ino.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB5 %s // Set batching to 7 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=7 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.ino.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB7 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=7 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.ino.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB7 %s // Set batching to 8 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=8 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.ino.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB8 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=8 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.ino.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB8 %s // Set batching to 9 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=9 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.ino.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB9 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=9 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.ino.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB9 %s // To test batching on in-order queue with discard_events: // Set batching to 4 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.discard_events.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB4 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.discard_events.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB4 %s // Set batching to 1 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=1 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.discard_events.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB1 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=1 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.discard_events.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB1 %s // Set batching to 3 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=3 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.discard_events.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB3 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=3 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.discard_events.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB3 %s // Set batching to 5 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=5 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.discard_events.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB5 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=5 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.discard_events.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB5 %s // Set batching to 7 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=7 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.discard_events.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB7 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=7 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.discard_events.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB7 %s // Set batching to 8 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=8 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.discard_events.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB8 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=8 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.discard_events.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB8 %s // Set batching to 9 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=9 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.discard_events.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB9 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=9 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.discard_events.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB9 %s // level_zero_batch_test.cpp // diff --git a/sycl/test-e2e/Plugin/level_zero_batch_test_copy_with_compute.cpp b/sycl/test-e2e/Plugin/level_zero_batch_test_copy_with_compute.cpp index fa1d8ff3e2c27..6c46a6d181401 100644 --- a/sycl/test-e2e/Plugin/level_zero_batch_test_copy_with_compute.cpp +++ b/sycl/test-e2e/Plugin/level_zero_batch_test_copy_with_compute.cpp @@ -4,25 +4,25 @@ // RUN: %{build} -o %t.out // Set batching to 4 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB4 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB4 %s // Set batching to 1 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=1 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB1 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=1 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB1 %s // Set batching to 3 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=3 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB3 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=3 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB3 %s // Set batching to 5 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=5 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB5 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=5 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB5 %s // Set batching to 7 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=7 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB7 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=7 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB7 %s // Set batching to 8 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=8 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB8 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=8 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB8 %s // Set batching to 9 explicitly -// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=9 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB9 %s +// RUN: env SYCL_PI_LEVEL_ZERO_BATCH_SIZE=9 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CKALL,CKB9 %s // level_zero_batch_test_copy_with_compute.cpp // diff --git a/sycl/test-e2e/Plugin/level_zero_device_scope_events.cpp b/sycl/test-e2e/Plugin/level_zero_device_scope_events.cpp index 82b5cb62b7f38..c7603c038645f 100644 --- a/sycl/test-e2e/Plugin/level_zero_device_scope_events.cpp +++ b/sycl/test-e2e/Plugin/level_zero_device_scope_events.cpp @@ -1,8 +1,8 @@ // REQUIRES: gpu, level_zero // RUN: %{build} -o %t.out -// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=1 SYCL_PI_TRACE=-1 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=MODE1 %s -// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_TRACE=-1 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=MODE2 %s +// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=1 SYCL_PI_TRACE=-1 UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=MODE1 %s +// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_TRACE=-1 UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=MODE2 %s // UNSUPPORTED: ze_debug // Checks that with L0 device-scope events enabled the only host-visible L0 diff --git a/sycl/test-e2e/Plugin/level_zero_dynamic_batch_test.cpp b/sycl/test-e2e/Plugin/level_zero_dynamic_batch_test.cpp index 2c75e86d188bb..5018efe969c6a 100644 --- a/sycl/test-e2e/Plugin/level_zero_dynamic_batch_test.cpp +++ b/sycl/test-e2e/Plugin/level_zero_dynamic_batch_test.cpp @@ -6,9 +6,9 @@ // RUN: %{build} -DUSING_DISCARD_EVENTS -o %t.discard_events.out // Check that dynamic batching raises/lowers batch size -// RUN: env SYCL_PI_TRACE=2 ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{run} %t.ooo.out 2>&1 | FileCheck --check-prefixes=CKALL,CKDYN %s -// RUN: env SYCL_PI_TRACE=2 ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{run} %t.ino.out 2>&1 | FileCheck --check-prefixes=CKALL,CKDYN %s -// RUN: env SYCL_PI_TRACE=2 ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{run} %t.discard_events.out 2>&1 | FileCheck --check-prefixes=CKALL,CKDYN %s +// RUN: env SYCL_PI_TRACE=2 UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{run} %t.ooo.out 2>&1 | FileCheck --check-prefixes=CKALL,CKDYN %s +// RUN: env SYCL_PI_TRACE=2 UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{run} %t.ino.out 2>&1 | FileCheck --check-prefixes=CKALL,CKDYN %s +// RUN: env SYCL_PI_TRACE=2 UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{run} %t.discard_events.out 2>&1 | FileCheck --check-prefixes=CKALL,CKDYN %s // level_zero_dynamic_batch_test.cpp // diff --git a/sycl/test-e2e/Plugin/level_zero_eager_init.cpp b/sycl/test-e2e/Plugin/level_zero_eager_init.cpp index 49f3f6b6bc0b9..8909f081e5a33 100644 --- a/sycl/test-e2e/Plugin/level_zero_eager_init.cpp +++ b/sycl/test-e2e/Plugin/level_zero_eager_init.cpp @@ -1,7 +1,7 @@ // REQUIRES: level_zero, level_zero_dev_kit // RUN: %{build} %level_zero_options -o %t.out -// RUN: env ZE_DEBUG=1 SYCL_EAGER_INIT=1 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env UR_L0_DEBUG=1 SYCL_EAGER_INIT=1 %{run} %t.out 2>&1 | FileCheck %s // // The test is to check that under SYCL_EAGER_INIT=1 there is no calls to // heavy L0 initialization in the hot reportable path. diff --git a/sycl/test-e2e/Plugin/level_zero_events_caching.cpp b/sycl/test-e2e/Plugin/level_zero_events_caching.cpp index 48baf1eff6ba1..de9f3427e14bb 100644 --- a/sycl/test-e2e/Plugin/level_zero_events_caching.cpp +++ b/sycl/test-e2e/Plugin/level_zero_events_caching.cpp @@ -1,9 +1,9 @@ // REQUIRES: gpu, level_zero // RUN: %{build} -o %t.out -// RUN: env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CACHING-ENABLED %s -// RUN: env SYCL_PI_LEVEL_ZERO_DISABLE_EVENTS_CACHING=0 ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CACHING-ENABLED %s -// RUN: env SYCL_PI_LEVEL_ZERO_DISABLE_EVENTS_CACHING=1 ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CACHING-DISABLED %s +// RUN: env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CACHING-ENABLED %s +// RUN: env SYCL_PI_LEVEL_ZERO_DISABLE_EVENTS_CACHING=0 UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CACHING-ENABLED %s +// RUN: env SYCL_PI_LEVEL_ZERO_DISABLE_EVENTS_CACHING=1 UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CACHING-DISABLED %s // With events caching we should be reusing them and 9 should be enough. // Might require more than one if previous one hasn't been released by the time diff --git a/sycl/test-e2e/Plugin/level_zero_events_caching_leak.cpp b/sycl/test-e2e/Plugin/level_zero_events_caching_leak.cpp index 72335434f0deb..bedf9a968500e 100644 --- a/sycl/test-e2e/Plugin/level_zero_events_caching_leak.cpp +++ b/sycl/test-e2e/Plugin/level_zero_events_caching_leak.cpp @@ -1,8 +1,8 @@ // REQUIRES: gpu, level_zero // RUN: %{build} -o %t.out -// RUN: env ZE_MAX_NUMBER_OF_EVENTS_PER_EVENT_POOL=4 ZE_DEBUG=4 %{run} %t.out -// RUN: env SYCL_PI_LEVEL_ZERO_DISABLE_EVENTS_CACHING=1 ZE_MAX_NUMBER_OF_EVENTS_PER_EVENT_POOL=4 ZE_DEBUG=4 %{run} %t.out +// RUN: env ZE_MAX_NUMBER_OF_EVENTS_PER_EVENT_POOL=4 UR_L0_LEAKS_DEBUG=1 %{run} %t.out +// RUN: env SYCL_PI_LEVEL_ZERO_DISABLE_EVENTS_CACHING=1 ZE_MAX_NUMBER_OF_EVENTS_PER_EVENT_POOL=4 UR_L0_LEAKS_DEBUG=1 %{run} %t.out // Check that events and pools are not leaked when event caching is // enabled/disabled. diff --git a/sycl/test-e2e/Plugin/level_zero_ext_intel_cslice.cpp b/sycl/test-e2e/Plugin/level_zero_ext_intel_cslice.cpp index df64ec0a1bd46..25a97c4e26238 100644 --- a/sycl/test-e2e/Plugin/level_zero_ext_intel_cslice.cpp +++ b/sycl/test-e2e/Plugin/level_zero_ext_intel_cslice.cpp @@ -3,18 +3,18 @@ // RUN: %{build} -o %t.out -// RUN: env ZEX_NUMBER_OF_CCS=0:4 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-PVC +// RUN: env ZEX_NUMBER_OF_CCS=0:4 UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-PVC // RUN: env SYCL_PI_LEVEL_ZERO_EXPOSE_CSLICE_IN_AFFINITY_PARTITIONING=1 \ -// RUN: ZEX_NUMBER_OF_CCS=0:4 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-PVC +// RUN: ZEX_NUMBER_OF_CCS=0:4 UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-PVC // Same, but without using immediate commandlists: // RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 ZEX_NUMBER_OF_CCS=0:4 \ -// RUN: ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-PVC +// RUN: UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-PVC // RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_LEVEL_ZERO_EXPOSE_CSLICE_IN_AFFINITY_PARTITIONING=1 \ -// RUN: ZEX_NUMBER_OF_CCS=0:4 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-PVC +// RUN: ZEX_NUMBER_OF_CCS=0:4 UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-PVC #include @@ -135,7 +135,7 @@ void test_pvc(device &d) { } } else { // Make FileCheck pass. - std::cout << "Fake ZE_DEBUG output for FileCheck:" << std::endl; + std::cout << "Fake UR_L0_DEBUG output for FileCheck:" << std::endl; // clang-format off std::cout << "[getZeQueue]: create queue ordinal = 0, index = 0 (round robin in [0, 0])" << std::endl; std::cout << "[getZeQueue]: create queue ordinal = 0, index = 1 (round robin in [1, 1])" << std::endl; diff --git a/sycl/test-e2e/Plugin/level_zero_ext_intel_queue_index.cpp b/sycl/test-e2e/Plugin/level_zero_ext_intel_queue_index.cpp index bea0defd1d984..e04f280a8e986 100644 --- a/sycl/test-e2e/Plugin/level_zero_ext_intel_queue_index.cpp +++ b/sycl/test-e2e/Plugin/level_zero_ext_intel_queue_index.cpp @@ -1,10 +1,10 @@ // REQUIRES: aspect-ext_intel_device_id // REQUIRES: level_zero // RUN: %{build} -o %t.out -// RUN: env ZEX_NUMBER_OF_CCS=0:4 env ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-PVC +// RUN: env ZEX_NUMBER_OF_CCS=0:4 env UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-PVC // // Same with Immediate CommandLists -// RUN: env SYCL_PI_LEVEL_ZERO_EXPOSE_CSLICE_IN_AFFINITY_PARTITIONING=1 env ZEX_NUMBER_OF_CCS=0:4 env ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-PVC +// RUN: env SYCL_PI_LEVEL_ZERO_EXPOSE_CSLICE_IN_AFFINITY_PARTITIONING=1 env ZEX_NUMBER_OF_CCS=0:4 env UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-PVC #include @@ -85,7 +85,7 @@ void test_pvc(device &d) { } } else { // Make FileCheck pass. - std::cout << "Fake ZE_DEBUG output for FileCheck:" << std::endl; + std::cout << "Fake UR_L0_DEBUG output for FileCheck:" << std::endl; // clang-format off std::cout << "[getZeQueue]: create queue ordinal = 0, index = 0 (round robin in [0, 0])" << std::endl; std::cout << "[getZeQueue]: create queue ordinal = 0, index = 2 (round robin in [2, 2])" << std::endl; diff --git a/sycl/test-e2e/Plugin/level_zero_imm_cmdlist.cpp b/sycl/test-e2e/Plugin/level_zero_imm_cmdlist.cpp index 6dd1b0fefd99a..dfa89afbae598 100644 --- a/sycl/test-e2e/Plugin/level_zero_imm_cmdlist.cpp +++ b/sycl/test-e2e/Plugin/level_zero_imm_cmdlist.cpp @@ -1,7 +1,7 @@ // REQUIRES: linux, gpu-intel-pvc, level_zero, level_zero_dev_kit // // RUN: %{build} %level_zero_options -o %t.out -// RUN: env ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s // // CHECK-NOT: zeCommandListCreate( // CHECK: zeCommandListCreateImmediate( diff --git a/sycl/test-e2e/Plugin/level_zero_imm_cmdlist_per_thread.cpp b/sycl/test-e2e/Plugin/level_zero_imm_cmdlist_per_thread.cpp index e21e8c225d2cf..d0bf1cff9676e 100644 --- a/sycl/test-e2e/Plugin/level_zero_imm_cmdlist_per_thread.cpp +++ b/sycl/test-e2e/Plugin/level_zero_imm_cmdlist_per_thread.cpp @@ -4,8 +4,8 @@ // UNSUPPORTED: windows // RUN: %{build} %level_zero_options %threads_lib -o %t.out -// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE=0 ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CHECK-ONE-CMDLIST %s -// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=2 SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE=0 ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CHECK-PER-THREAD-CMDLIST %s +// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE=0 UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CHECK-ONE-CMDLIST %s +// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=2 SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE=0 UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=CHECK-PER-THREAD-CMDLIST %s // The test checks that immediate commandlists are created per-thread. // One immediate commandlist is created for device init, the rest for the queue. diff --git a/sycl/test-e2e/Plugin/level_zero_memory_fill.cpp b/sycl/test-e2e/Plugin/level_zero_memory_fill.cpp index 41115549e588b..25d678cb64c78 100644 --- a/sycl/test-e2e/Plugin/level_zero_memory_fill.cpp +++ b/sycl/test-e2e/Plugin/level_zero_memory_fill.cpp @@ -1,7 +1,7 @@ // REQUIRES: gpu, level_zero, level_zero_dev_kit // RUN: %{build} %level_zero_options -o %t.out -// RUN: env ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE_FOR_FILL=0 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE_FOR_FILL=0 %{run} %t.out 2>&1 | FileCheck %s // Check that the fill operation is using compute (0 ordinal) engine. // diff --git a/sycl/test-e2e/Plugin/level_zero_queue_create.cpp b/sycl/test-e2e/Plugin/level_zero_queue_create.cpp index 9e9b09e371fc6..955ee9d8224c0 100644 --- a/sycl/test-e2e/Plugin/level_zero_queue_create.cpp +++ b/sycl/test-e2e/Plugin/level_zero_queue_create.cpp @@ -1,11 +1,11 @@ // REQUIRES: level_zero, level_zero_dev_kit // RUN: %{build} %level_zero_options -o %t.out -// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s // // CHECK: zeCommandQueueCreate = 1 \---> zeCommandQueueDestroy = 1 // The test is to check that there is only a single level zero queue created -// with the embedded ZE_DEBUG=4 testing capability. +// with the embedded UR_L0_LEAKS_DEBUG=1 testing capability. // #include diff --git a/sycl/test-e2e/Plugin/level_zero_queue_priority.cpp b/sycl/test-e2e/Plugin/level_zero_queue_priority.cpp index e0fd1cebed901..8586d283c0390 100644 --- a/sycl/test-e2e/Plugin/level_zero_queue_priority.cpp +++ b/sycl/test-e2e/Plugin/level_zero_queue_priority.cpp @@ -1,7 +1,7 @@ // REQUIRES: gpu, level_zero, level_zero_dev_kit // RUN: %{build} %level_zero_options -o %t.out -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-STD -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-IMM +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-STD +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-IMM // // Check that queue priority is passed to Level Zero runtime // This is the last value in the ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC diff --git a/sycl/test-e2e/Plugin/level_zero_queue_profiling.cpp b/sycl/test-e2e/Plugin/level_zero_queue_profiling.cpp index d2153901fdafb..78e7a8ef72855 100644 --- a/sycl/test-e2e/Plugin/level_zero_queue_profiling.cpp +++ b/sycl/test-e2e/Plugin/level_zero_queue_profiling.cpp @@ -2,8 +2,8 @@ // UNSUPPORTED: ze_debug // RUN: %{build} -o %t.out -// RUN: env ZE_DEBUG=-1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=WITHOUT %s -// RUN: env ZE_DEBUG=-1 %{run} %t.out profile 2>&1 | FileCheck --check-prefixes=WITH %s +// RUN: env UR_L0_DEBUG=-1 UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=WITHOUT %s +// RUN: env UR_L0_DEBUG=-1 UR_L0_LEAKS_DEBUG=1 %{run} %t.out profile 2>&1 | FileCheck --check-prefixes=WITH %s // Test case adapted from the SYCL version of Rodinia benchmark hotspot. diff --git a/sycl/test-e2e/Plugin/level_zero_sub_sub_device.cpp b/sycl/test-e2e/Plugin/level_zero_sub_sub_device.cpp index 344ed361767dc..60287e71cee85 100644 --- a/sycl/test-e2e/Plugin/level_zero_sub_sub_device.cpp +++ b/sycl/test-e2e/Plugin/level_zero_sub_sub_device.cpp @@ -1,7 +1,7 @@ // REQUIRES: gpu-intel-pvc, level_zero // RUN: %{build} %level_zero_options -o %t.out -// RUN: env ZE_DEBUG=1 env ZEX_NUMBER_OF_CCS=0:4 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env UR_L0_DEBUG=1 env ZEX_NUMBER_OF_CCS=0:4 %{run} %t.out 2>&1 | FileCheck %s // RUN: env ZEX_NUMBER_OF_CCS=0:4 %{run} %t.out // Check that queues created on sub-sub-devices are going to specific compute diff --git a/sycl/test-e2e/Plugin/level_zero_usm_device_read_only.cpp b/sycl/test-e2e/Plugin/level_zero_usm_device_read_only.cpp index 86318eb225e57..8003a0109f1e3 100644 --- a/sycl/test-e2e/Plugin/level_zero_usm_device_read_only.cpp +++ b/sycl/test-e2e/Plugin/level_zero_usm_device_read_only.cpp @@ -2,7 +2,7 @@ // UNSUPPORTED: ze_debug // RUN: %{build} -o %t.out -// RUN: env SYCL_PI_TRACE=2 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s // Test that "device_read_only" shared USM allocations are pooled. diff --git a/sycl/test-e2e/Plugin/level_zero_usm_residency.cpp b/sycl/test-e2e/Plugin/level_zero_usm_residency.cpp index f21d87be5a54b..77a0cf8419933 100644 --- a/sycl/test-e2e/Plugin/level_zero_usm_residency.cpp +++ b/sycl/test-e2e/Plugin/level_zero_usm_residency.cpp @@ -4,10 +4,10 @@ // XFAIL: gpu-intel-dg2 // RUN: %{build} %level_zero_options -o %t.out -// RUN: env SYCL_PI_TRACE=-1 ZE_DEBUG=-1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=DEVICE %s -// RUN: env SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0x001 SYCL_PI_TRACE=-1 ZE_DEBUG=-1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=DEVICE %s -// RUN: env SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0x010 SYCL_PI_TRACE=-1 ZE_DEBUG=-1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=SHARED %s -// RUN: env SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0x100 SYCL_PI_TRACE=-1 ZE_DEBUG=-1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=HOST %s +// RUN: env SYCL_PI_TRACE=-1 UR_L0_DEBUG=-1 UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=DEVICE %s +// RUN: env SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0x001 SYCL_PI_TRACE=-1 UR_L0_DEBUG=-1 UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=DEVICE %s +// RUN: env SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0x010 SYCL_PI_TRACE=-1 UR_L0_DEBUG=-1 UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=SHARED %s +// RUN: env SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0x100 SYCL_PI_TRACE=-1 UR_L0_DEBUG=-1 UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck --check-prefixes=HOST %s // Test that USM is made resident at allocation as requested. diff --git a/sycl/test-e2e/Plugin/queue_submit_mode.cpp b/sycl/test-e2e/Plugin/queue_submit_mode.cpp index f89854d7df2ce..3c4fcdb6ebe0a 100644 --- a/sycl/test-e2e/Plugin/queue_submit_mode.cpp +++ b/sycl/test-e2e/Plugin/queue_submit_mode.cpp @@ -1,7 +1,7 @@ // REQUIRES: gpu, level_zero // RUN: %{build} %level_zero_options -o %t.out -// RUN: env ZE_DEBUG=4 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{run} %t.out 0 2>&1 | FileCheck %s --check-prefixes=CHECK-STD -// RUN: env ZE_DEBUG=4 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{run} %t.out 1 2>&1 | FileCheck %s --check-prefixes=CHECK-IMM +// RUN: env UR_L0_LEAKS_DEBUG=1 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{run} %t.out 0 2>&1 | FileCheck %s --check-prefixes=CHECK-STD +// RUN: env UR_L0_LEAKS_DEBUG=1 SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{run} %t.out 1 2>&1 | FileCheck %s --check-prefixes=CHECK-IMM // // Check that queue submission mode is honored when creating queue. // diff --git a/sycl/test-e2e/Properties/cache_config.cpp b/sycl/test-e2e/Properties/cache_config.cpp index 5734b61bfa99d..100ad1d67f0d1 100644 --- a/sycl/test-e2e/Properties/cache_config.cpp +++ b/sycl/test-e2e/Properties/cache_config.cpp @@ -6,7 +6,7 @@ // UNSUPPORTED: gpu-intel-gen9 && windows // RUN: %{build} -o %t.out -// RUN: env ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env UR_L0_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s #include #include diff --git a/sycl/test-e2e/Regression/reduction_resource_leak_dw.cpp b/sycl/test-e2e/Regression/reduction_resource_leak_dw.cpp index a2ea458752c03..8d5c018173fa9 100644 --- a/sycl/test-e2e/Regression/reduction_resource_leak_dw.cpp +++ b/sycl/test-e2e/Regression/reduction_resource_leak_dw.cpp @@ -2,7 +2,7 @@ // XFAIL: windows // // RUN: %{build} %level_zero_options -o %t.out -// RUN: env ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/Regression/reduction_resource_leak_usm.cpp b/sycl/test-e2e/Regression/reduction_resource_leak_usm.cpp index 6ca0af29b97eb..c5a98de8dc520 100644 --- a/sycl/test-e2e/Regression/reduction_resource_leak_usm.cpp +++ b/sycl/test-e2e/Regression/reduction_resource_leak_usm.cpp @@ -1,9 +1,9 @@ // REQUIRES: level_zero, level_zero_dev_kit -// TODO: ZE_DEBUG=4 produces no output on Windows. Enable when fixed. +// TODO: UR_L0_LEAKS_DEBUG=1 produces no output on Windows. Enable when fixed. // UNSUPPORTED: windows // // RUN: %{build} %level_zero_options -o %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR="level_zero:*" ZE_DEBUG=4 %{run} %t.out 2>&1 | FileCheck %s +// RUN: env ONEAPI_DEVICE_SELECTOR="level_zero:*" UR_L0_LEAKS_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s // // CHECK-NOT: LEAK diff --git a/sycl/test-e2e/USM/usm_leak_check.cpp b/sycl/test-e2e/USM/usm_leak_check.cpp index 976e7fd6c5e48..68b60c434a90c 100644 --- a/sycl/test-e2e/USM/usm_leak_check.cpp +++ b/sycl/test-e2e/USM/usm_leak_check.cpp @@ -5,9 +5,9 @@ // RUN: %{build} -o %t.out -// RUN: env ZE_DEBUG=4 %{run} %t.out u 2>&1 | FileCheck %s --check-prefix CHECK-USM -// RUN: env ZE_DEBUG=4 %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-SMALL-BUF -// RUN: env ZE_DEBUG=4 %{run} %t.out l 2>&1 | FileCheck %s --check-prefix CHECK-LARGE-BUF +// RUN: env UR_L0_LEAKS_DEBUG=1 %{run} %t.out u 2>&1 | FileCheck %s --check-prefix CHECK-USM +// RUN: env UR_L0_LEAKS_DEBUG=1 %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-SMALL-BUF +// RUN: env UR_L0_LEAKS_DEBUG=1 %{run} %t.out l 2>&1 | FileCheck %s --check-prefix CHECK-LARGE-BUF #include using namespace sycl; diff --git a/sycl/test-e2e/USM/usm_pooling.cpp b/sycl/test-e2e/USM/usm_pooling.cpp index bd81f7673b575..ecb5a5eab7200 100644 --- a/sycl/test-e2e/USM/usm_pooling.cpp +++ b/sycl/test-e2e/USM/usm_pooling.cpp @@ -4,29 +4,29 @@ // Allocate 2 items of 2MB. Free 2. Allocate 3 more of 2MB. // With no pooling: 1,2,3,4,5 allocs lead to ZE call. -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_DISABLE_USM_ALLOCATOR=1 %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-NOPOOL -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_DISABLE_USM_ALLOCATOR=1 %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-NOPOOL -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_DISABLE_USM_ALLOCATOR=1 %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-NOPOOL +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_DISABLE_USM_ALLOCATOR=1 %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-NOPOOL +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_DISABLE_USM_ALLOCATOR=1 %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-NOPOOL +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_DISABLE_USM_ALLOCATOR=1 %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-NOPOOL // With pooling enabled and MaxPooolable=1MB: 1,2,3,4,5 allocs lead to ZE call. -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;1M,4,64K" %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-12345 -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;1M,4,64K" %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-12345 -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;1M,4,64K" %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-12345 +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;1M,4,64K" %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-12345 +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;1M,4,64K" %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-12345 +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;1M,4,64K" %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-12345 // With pooling enabled and capacity=1: 1,2,4,5 allocs lead to ZE call. -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,1,64K" %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-1245 -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,1,64K" %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-1245 -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,1,64K" %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-1245 +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,1,64K" %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-1245 +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,1,64K" %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-1245 +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,1,64K" %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-1245 // With pooling enabled and MaxPoolSize=2MB: 1,2,4,5 allocs lead to ZE call. -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";2M;2M,4,64K" %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-1245 -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";2M;2M,4,64K" %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-1245 -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";2M;2M,4,64K" %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-1245 +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";2M;2M,4,64K" %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-1245 +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";2M;2M,4,64K" %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-1245 +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";2M;2M,4,64K" %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-1245 // With pooling enabled and SlabMinSize of 4 MB: 1,5 allocs lead to ZE call. -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,4,4M" %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-15 -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,4,4M" %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-15 -// RUN: env ZE_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,4,4M" %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-15 +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,4,4M" %{run} %t.out h 2>&1 | FileCheck %s --check-prefix CHECK-15 +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,4,4M" %{run} %t.out d 2>&1 | FileCheck %s --check-prefix CHECK-15 +// RUN: env UR_L0_DEBUG=1 SYCL_PI_LEVEL_ZERO_USM_RESIDENT=0 SYCL_PI_LEVEL_ZERO_USM_ALLOCATOR=";;2M,4,4M" %{run} %t.out s 2>&1 | FileCheck %s --check-prefix CHECK-15 #include "CL/sycl.hpp" #include using namespace sycl; diff --git a/sycl/test-e2e/format.py b/sycl/test-e2e/format.py index 0ebe12bc63de8..0823bd78c12ce 100644 --- a/sycl/test-e2e/format.py +++ b/sycl/test-e2e/format.py @@ -164,8 +164,11 @@ def get_extra_env(sycl_devices): # so that device might still be accessible to some of the tests yet # we won't set the environment variable below for such scenario. extra_env = [] - if 'ext_oneapi_level_zero:gpu' in sycl_devices and litConfig.params.get('ze_debug'): - extra_env.append('ZE_DEBUG={}'.format(test.config.ze_debug)) + if 'ext_oneapi_level_zero:gpu' in sycl_devices and litConfig.params.get('ur_l0_debug'): + extra_env.append('UR_L0_DEBUG={}'.format(test.config.ur_l0_debug)) + + if 'ext_oneapi_level_zero:gpu' in sycl_devices and litConfig.params.get('ur_l0_leaks_debug'): + extra_env.append('UR_L0_LEAKS_DEBUG={}'.format(test.config.ur_l0_leaks_debug)) if 'ext_oneapi_cuda:gpu' in sycl_devices: extra_env.append('SYCL_PI_CUDA_ENABLE_IMAGE_SUPPORT=1') diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index f98917d437f6d..ef8407dbbdfe8 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -135,10 +135,15 @@ if lit_config.params.get('matrix-fp16', False): config.available_features.add('matrix-fp16') -#support for LIT parameter ze_debug -if lit_config.params.get('ze_debug'): - config.ze_debug = lit_config.params.get('ze_debug') - lit_config.note("ZE_DEBUG: "+config.ze_debug) +#support for LIT parameter ur_l0_debug +if lit_config.params.get('ur_l0_debug'): + config.ur_l0_debug = lit_config.params.get('ur_l0_debug') + lit_config.note("UR_L0_DEBUG: "+config.ur_l0_debug) + +#support for LIT parameter ur_l0_leaks_debug +if lit_config.params.get('ur_l0_leaks_debug'): + config.ur_l0_leaks_debug = lit_config.params.get('ur_l0_leaks_debug') + lit_config.note("UR_L0_LEAKS_DEBUG: "+config.ur_l0_leaks_debug) # Make sure that any dynamic checks below are done in the build directory and # not where the sources are located. This is important for the in-tree