diff --git a/sycl/unittests/Extensions/DeviceGlobal.cpp b/sycl/unittests/Extensions/DeviceGlobal.cpp index 1ba9e07b68c5b..222970aa1d959 100644 --- a/sycl/unittests/Extensions/DeviceGlobal.cpp +++ b/sycl/unittests/Extensions/DeviceGlobal.cpp @@ -11,8 +11,8 @@ #include "detail/context_impl.hpp" #include "detail/kernel_program_cache.hpp" +#include #include -#include #include #include @@ -53,7 +53,7 @@ struct KernelInfo } // namespace _V1 } // namespace sycl -static sycl::unittest::UrImage generateDeviceGlobalImage() { +static sycl::unittest::MockDeviceImage generateDeviceGlobalImage() { using namespace sycl::unittest; // Call device global map initializer explicitly to mimic the integration @@ -61,21 +61,21 @@ static sycl::unittest::UrImage generateDeviceGlobalImage() { sycl::detail::device_global_map::add(&DeviceGlobal, DeviceGlobalName); // Insert remaining device global info into the binary. - UrPropertySet PropSet; - UrProperty DevGlobInfo = + MockPropertySet PropSet; + MockProperty DevGlobInfo = makeDeviceGlobalInfo(DeviceGlobalName, sizeof(int) * 2, 0); PropSet.insert(__SYCL_PROPERTY_SET_SYCL_DEVICE_GLOBALS, - std::vector{std::move(DevGlobInfo)}); + std::vector{std::move(DevGlobInfo)}); - std::vector Entries = + std::vector Entries = makeEmptyKernels({DeviceGlobalTestKernelName}); - UrImage Img(std::move(Entries), std::move(PropSet)); + MockDeviceImage Img(std::move(Entries), std::move(PropSet)); return Img; } -static sycl::unittest::UrImage generateDeviceGlobalImgScopeImage() { +static sycl::unittest::MockDeviceImage generateDeviceGlobalImgScopeImage() { using namespace sycl::unittest; // Call device global map initializer explicitly to mimic the integration @@ -84,24 +84,24 @@ static sycl::unittest::UrImage generateDeviceGlobalImgScopeImage() { DeviceGlobalImgScopeName); // Insert remaining device global info into the binary. - UrPropertySet PropSet; - UrProperty DevGlobInfo = + MockPropertySet PropSet; + MockProperty DevGlobInfo = makeDeviceGlobalInfo(DeviceGlobalImgScopeName, sizeof(int) * 2, 1); PropSet.insert(__SYCL_PROPERTY_SET_SYCL_DEVICE_GLOBALS, - std::vector{std::move(DevGlobInfo)}); + std::vector{std::move(DevGlobInfo)}); - std::vector Entries = + std::vector Entries = makeEmptyKernels({DeviceGlobalImgScopeTestKernelName}); - UrImage Img(std::move(Entries), std::move(PropSet)); + MockDeviceImage Img(std::move(Entries), std::move(PropSet)); return Img; } namespace { -sycl::unittest::UrImage Imgs[] = {generateDeviceGlobalImage(), - generateDeviceGlobalImgScopeImage()}; -sycl::unittest::UrImageArray<2> ImgArray{Imgs}; +sycl::unittest::MockDeviceImage Imgs[] = {generateDeviceGlobalImage(), + generateDeviceGlobalImgScopeImage()}; +sycl::unittest::MockDeviceImageArray<2> ImgArray{Imgs}; // Trackers. thread_local DeviceGlobalElemType MockDeviceGlobalMem; diff --git a/sycl/unittests/Extensions/USMMemcpy2D.cpp b/sycl/unittests/Extensions/USMMemcpy2D.cpp index 8264b7c27ed69..880ed9bd69385 100644 --- a/sycl/unittests/Extensions/USMMemcpy2D.cpp +++ b/sycl/unittests/Extensions/USMMemcpy2D.cpp @@ -10,8 +10,8 @@ #include +#include #include -#include #include #include @@ -126,10 +126,10 @@ struct KernelInfo> } // namespace sycl namespace { -sycl::unittest::UrImage Imgs[] = {sycl::unittest::generateDefaultImage( +sycl::unittest::MockDeviceImage Imgs[] = {sycl::unittest::generateDefaultImage( {USMFillHelperKernelNameLong, USMFillHelperKernelNameChar, USMMemcpyHelperKernelNameLong, USMMemcpyHelperKernelNameChar})}; -sycl::unittest::UrImageArray<1> ImgArray{Imgs}; +sycl::unittest::MockDeviceImageArray<1> ImgArray{Imgs}; ur_context_info_t LastMemopsQuery = UR_CONTEXT_INFO_NUM_DEVICES; diff --git a/sycl/unittests/Extensions/VirtualFunctions/RuntimeLinking.cpp b/sycl/unittests/Extensions/VirtualFunctions/RuntimeLinking.cpp index 0ec39f12e4506..61e0c5f5f32a5 100644 --- a/sycl/unittests/Extensions/VirtualFunctions/RuntimeLinking.cpp +++ b/sycl/unittests/Extensions/VirtualFunctions/RuntimeLinking.cpp @@ -2,9 +2,9 @@ #include "ur_mock_helpers.hpp" #include +#include #include #include -#include #include #include @@ -46,11 +46,11 @@ KERNEL_INFO(KernelG) } // namespace _V1 } // namespace sycl -static sycl::unittest::UrImage +static sycl::unittest::MockDeviceImage generateImage(std::initializer_list KernelNames, const std::string &VFSets, bool UsesVFSets, unsigned char Magic) { - sycl::unittest::UrPropertySet PropSet; - std::vector Props; + sycl::unittest::MockPropertySet PropSet; + std::vector Props; uint64_t PropSize = VFSets.size(); std::vector Storage(/* bytes for size */ 8 + PropSize + /* null terminator */ 1); @@ -61,18 +61,18 @@ generateImage(std::initializer_list KernelNames, Storage.back() = '\0'; const std::string PropName = UsesVFSets ? "uses-virtual-functions-set" : "virtual-functions-set"; - sycl::unittest::UrProperty Prop(PropName, Storage, - SYCL_PROPERTY_TYPE_BYTE_ARRAY); + sycl::unittest::MockProperty Prop(PropName, Storage, + SYCL_PROPERTY_TYPE_BYTE_ARRAY); Props.push_back(Prop); PropSet.insert(__SYCL_PROPERTY_SET_SYCL_VIRTUAL_FUNCTIONS, std::move(Props)); std::vector Bin{Magic}; - std::vector Entries = + std::vector Entries = sycl::unittest::makeEmptyKernels(KernelNames); - sycl::unittest::UrImage Img{ + sycl::unittest::MockDeviceImage Img{ SYCL_DEVICE_BINARY_TYPE_SPIRV, // Format __SYCL_DEVICE_BINARY_TARGET_SPIRV64, // DeviceTargetSpec "", // Compile options @@ -103,7 +103,7 @@ static constexpr unsigned PROGRAM_F1 = 53; // Device images with no entires are ignored by SYCL RT during registration. // Therefore, we have to provide some kernel names to make the test work, even // if we don't really have them/use them. -static sycl::unittest::UrImage Imgs[] = { +static sycl::unittest::MockDeviceImage Imgs[] = { generateImage({"KernelA"}, "set-a", /* uses vf set */ true, PROGRAM_A), generateImage({"DummyKernel0"}, "set-a", /* provides vf set */ false, PROGRAM_A0), @@ -131,7 +131,7 @@ static sycl::unittest::UrImage Imgs[] = { generateImage({"KernelG"}, "set-f", /* uses vf set */ true, PROGRAM_F1)}; // Registers mock devices images in the SYCL RT -static sycl::unittest::UrImageArray<15> ImgArray{Imgs}; +static sycl::unittest::MockDeviceImageArray<15> ImgArray{Imgs}; TEST(VirtualFunctions, SingleKernelUsesSingleVFSet) { sycl::unittest::UrMock<> Mock; diff --git a/sycl/unittests/Extensions/WorkGroupMemoryBackendArgument.cpp b/sycl/unittests/Extensions/WorkGroupMemoryBackendArgument.cpp index 7ddb1ee28310b..701fd6bfa1466 100644 --- a/sycl/unittests/Extensions/WorkGroupMemoryBackendArgument.cpp +++ b/sycl/unittests/Extensions/WorkGroupMemoryBackendArgument.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// #include -#include +#include #include #include @@ -38,9 +38,9 @@ template <> struct KernelInfo { } // namespace _V1 } // namespace sycl -static sycl::unittest::UrImage Img = +static sycl::unittest::MockDeviceImage Img = sycl::unittest::generateDefaultImage({"WorkGroupMemoryKernel"}); -static sycl::unittest::UrImageArray<1> ImgArray{&Img}; +static sycl::unittest::MockDeviceImageArray<1> ImgArray{&Img}; static int urKernelSetArgLocalCalls = 0; inline ur_result_t redefined_urKernelSetArgLocal(void *) { diff --git a/sycl/unittests/SYCL2020/IsCompatible.cpp b/sycl/unittests/SYCL2020/IsCompatible.cpp index 12f54a42d3f99..7a791afe301e2 100644 --- a/sycl/unittests/SYCL2020/IsCompatible.cpp +++ b/sycl/unittests/SYCL2020/IsCompatible.cpp @@ -1,7 +1,7 @@ #include +#include #include -#include #include #include @@ -22,22 +22,22 @@ MOCK_INTEGRATION_HEADER(TestKernelCPUValidReqdWGSize3D) MOCK_INTEGRATION_HEADER(TestKernelGPU) MOCK_INTEGRATION_HEADER(TestKernelACC) -static sycl::unittest::UrImage +static sycl::unittest::MockDeviceImage generateDefaultImage(std::initializer_list KernelNames, const std::vector &Aspects, const std::vector &ReqdWGSize = {}) { using namespace sycl::unittest; - UrPropertySet PropSet; + MockPropertySet PropSet; addDeviceRequirementsProps(PropSet, Aspects, ReqdWGSize); - std::vector Entries = makeEmptyKernels(KernelNames); + std::vector Entries = makeEmptyKernels(KernelNames); - UrImage Img(std::move(Entries), std::move(PropSet)); + MockDeviceImage Img(std::move(Entries), std::move(PropSet)); return Img; } -static sycl::unittest::UrImage Imgs[7] = { +static sycl::unittest::MockDeviceImage Imgs[7] = { // Images for validating checks based on max_work_group_size + aspects generateDefaultImage({"TestKernelCPU"}, {sycl::aspect::cpu}, {32}), // 32 <= 256 (OK) @@ -56,7 +56,7 @@ static sycl::unittest::UrImage Imgs[7] = { generateDefaultImage({"TestKernelGPU"}, {sycl::aspect::gpu}), generateDefaultImage({"TestKernelACC"}, {sycl::aspect::accelerator})}; -static sycl::unittest::UrImageArray<7> ImgArray{Imgs}; +static sycl::unittest::MockDeviceImageArray<7> ImgArray{Imgs}; static ur_result_t redefinedDeviceGetInfoCPU(void *pParams) { auto params = *static_cast(pParams); diff --git a/sycl/unittests/SYCL2020/KernelBundle.cpp b/sycl/unittests/SYCL2020/KernelBundle.cpp index b028e0e6e388e..5ffe4ecbc341a 100644 --- a/sycl/unittests/SYCL2020/KernelBundle.cpp +++ b/sycl/unittests/SYCL2020/KernelBundle.cpp @@ -10,8 +10,8 @@ #include #include +#include #include -#include #include #include @@ -24,33 +24,33 @@ MOCK_INTEGRATION_HEADER(TestKernel) MOCK_INTEGRATION_HEADER(TestKernelExeOnly) MOCK_INTEGRATION_HEADER(TestKernelWithAspects) -static sycl::unittest::UrImage +static sycl::unittest::MockDeviceImage generateDefaultImage(std::initializer_list KernelNames, sycl_device_binary_type BinaryType, const char *DeviceTargetSpec, const std::vector &Aspects = {}) { using namespace sycl::unittest; - UrPropertySet PropSet; + MockPropertySet PropSet; if (!Aspects.empty()) addDeviceRequirementsProps(PropSet, Aspects); std::vector Bin{0, 1, 2, 3, 4, 5}; // Random data - std::vector Entries = makeEmptyKernels(KernelNames); + std::vector Entries = makeEmptyKernels(KernelNames); - UrImage Img{BinaryType, // Format - DeviceTargetSpec, - "", // Compile options - "", // Link options - std::move(Bin), - std::move(Entries), - std::move(PropSet)}; + MockDeviceImage Img{BinaryType, // Format + DeviceTargetSpec, + "", // Compile options + "", // Link options + std::move(Bin), + std::move(Entries), + std::move(PropSet)}; return Img; } -static sycl::unittest::UrImage Imgs[] = { +static sycl::unittest::MockDeviceImage Imgs[] = { generateDefaultImage({"TestKernel"}, SYCL_DEVICE_BINARY_TYPE_SPIRV, __SYCL_DEVICE_BINARY_TARGET_SPIRV64), generateDefaultImage({"TestKernelExeOnly"}, SYCL_DEVICE_BINARY_TYPE_NATIVE, @@ -61,7 +61,7 @@ static sycl::unittest::UrImage Imgs[] = { generateDefaultImage( {"TestKernelWithAspects"}, SYCL_DEVICE_BINARY_TYPE_NATIVE, __SYCL_DEVICE_BINARY_TARGET_SPIRV64, {sycl::aspect::gpu})}; -static sycl::unittest::UrImageArray ImgArray{Imgs}; +static sycl::unittest::MockDeviceImageArray ImgArray{Imgs}; static ur_result_t redefinedDeviceGetInfoCPU(void *pParams) { auto params = *static_cast(pParams); diff --git a/sycl/unittests/SYCL2020/KernelBundleStateFiltering.cpp b/sycl/unittests/SYCL2020/KernelBundleStateFiltering.cpp index e74a190698689..23610892d041b 100644 --- a/sycl/unittests/SYCL2020/KernelBundleStateFiltering.cpp +++ b/sycl/unittests/SYCL2020/KernelBundleStateFiltering.cpp @@ -10,8 +10,8 @@ #include #include +#include #include -#include #include #include @@ -35,26 +35,26 @@ MOCK_INTEGRATION_HEADER(KernelE) namespace { std::set TrackedImages; -sycl::unittest::UrImage +sycl::unittest::MockDeviceImage generateDefaultImage(std::initializer_list KernelNames, sycl_device_binary_type BinaryType, const char *DeviceTargetSpec) { using namespace sycl::unittest; - UrPropertySet PropSet; + MockPropertySet PropSet; static unsigned char NImage = 0; std::vector Bin{NImage++}; - std::vector Entries = makeEmptyKernels(KernelNames); + std::vector Entries = makeEmptyKernels(KernelNames); - UrImage Img{BinaryType, // Format - DeviceTargetSpec, - "", // Compile options - "", // Link options - std::move(Bin), - std::move(Entries), - std::move(PropSet)}; + MockDeviceImage Img{BinaryType, // Format + DeviceTargetSpec, + "", // Compile options + "", // Link options + std::move(Bin), + std::move(Entries), + std::move(PropSet)}; const void *BinaryPtr = Img.getBinaryPtr(); TrackedImages.insert(BinaryPtr); @@ -69,7 +69,7 @@ generateDefaultImage(std::initializer_list KernelNames, // Image 5: input, KernelE // Image 6: exe, KernelE // Image 7: exe. KernelE -sycl::unittest::UrImage Imgs[] = { +sycl::unittest::MockDeviceImage Imgs[] = { generateDefaultImage({"KernelA", "KernelB"}, SYCL_DEVICE_BINARY_TYPE_SPIRV, __SYCL_DEVICE_BINARY_TARGET_SPIRV64), generateDefaultImage({"KernelA"}, SYCL_DEVICE_BINARY_TYPE_NATIVE, @@ -87,7 +87,7 @@ sycl::unittest::UrImage Imgs[] = { generateDefaultImage({"KernelE"}, SYCL_DEVICE_BINARY_TYPE_NATIVE, __SYCL_DEVICE_BINARY_TARGET_SPIRV64_X86_64)}; -sycl::unittest::UrImageArray ImgArray{Imgs}; +sycl::unittest::MockDeviceImageArray ImgArray{Imgs}; std::vector UsedImageIndices; void redefinedUrProgramCreateCommon(const void *bin) { diff --git a/sycl/unittests/SYCL2020/KernelID.cpp b/sycl/unittests/SYCL2020/KernelID.cpp index 87f01caf2a878..6cb4a0a316d42 100644 --- a/sycl/unittests/SYCL2020/KernelID.cpp +++ b/sycl/unittests/SYCL2020/KernelID.cpp @@ -8,8 +8,8 @@ #include +#include #include -#include #include #include @@ -47,13 +47,13 @@ struct KernelInfo : public unittest::MockKernelInfoBase { } // namespace _V1 } // namespace sycl -static sycl::unittest::UrImage Imgs[2] = { +static sycl::unittest::MockDeviceImage Imgs[2] = { sycl::unittest::generateDefaultImage( {"KernelID_TestKernel1", "KernelID_TestKernel3"}), sycl::unittest::generateDefaultImage( {"KernelID_TestKernel2", "_ZTSN2cl4sycl6detail23__sycl_service_kernel__14ServiceKernel1"})}; -static sycl::unittest::UrImageArray<2> ImgArray{Imgs}; +static sycl::unittest::MockDeviceImageArray<2> ImgArray{Imgs}; TEST(KernelID, AllProgramKernelIds) { std::vector AllKernelIDs = sycl::get_kernel_ids(); diff --git a/sycl/unittests/SYCL2020/SpecializationConstant.cpp b/sycl/unittests/SYCL2020/SpecializationConstant.cpp index a0bcc5f9c7ef2..01dd78a6795bf 100644 --- a/sycl/unittests/SYCL2020/SpecializationConstant.cpp +++ b/sycl/unittests/SYCL2020/SpecializationConstant.cpp @@ -11,8 +11,8 @@ #include #include +#include #include -#include #include #include @@ -37,25 +37,26 @@ template <> const char *get_spec_constant_symbolic_ID() { } // namespace _V1 } // namespace sycl -static sycl::unittest::UrImage generateImageWithSpecConsts() { +static sycl::unittest::MockDeviceImage generateImageWithSpecConsts() { using namespace sycl::unittest; std::vector SpecConstData; - UrProperty SC1 = makeSpecConstant(SpecConstData, "SC1", {0}, {0}, {42}); - UrProperty SC2 = makeSpecConstant(SpecConstData, "SC2", {1}, {0}, {8}); + MockProperty SC1 = + makeSpecConstant(SpecConstData, "SC1", {0}, {0}, {42}); + MockProperty SC2 = makeSpecConstant(SpecConstData, "SC2", {1}, {0}, {8}); - UrPropertySet PropSet; + MockPropertySet PropSet; addSpecConstants({SC1, SC2}, std::move(SpecConstData), PropSet); - std::vector Entries = + std::vector Entries = makeEmptyKernels({"SpecializationConstant_TestKernel"}); - UrImage Img(std::move(Entries), std::move(PropSet)); + MockDeviceImage Img(std::move(Entries), std::move(PropSet)); return Img; } -static sycl::unittest::UrImage Img = generateImageWithSpecConsts(); -static sycl::unittest::UrImageArray<1> ImgArray{&Img}; +static sycl::unittest::MockDeviceImage Img = generateImageWithSpecConsts(); +static sycl::unittest::MockDeviceImageArray<1> ImgArray{&Img}; TEST(SpecializationConstant, DefaultValuesAreSet) { sycl::unittest::UrMock<> Mock; diff --git a/sycl/unittests/assert/assert.cpp b/sycl/unittests/assert/assert.cpp index 0e69d5c510845..b45996238358f 100644 --- a/sycl/unittests/assert/assert.cpp +++ b/sycl/unittests/assert/assert.cpp @@ -28,8 +28,8 @@ #include #include +#include #include -#include #include #include @@ -73,42 +73,42 @@ struct KernelInfo<::sycl::detail::__sycl_service_kernel__::AssertInfoCopier> } // namespace _V1 } // namespace sycl -static sycl::unittest::UrImage generateDefaultImage() { +static sycl::unittest::MockDeviceImage generateDefaultImage() { using namespace sycl::unittest; static const std::string KernelName = "TestKernel"; static const std::string CopierKernelName = "_ZTSN2cl4sycl6detail23__sycl_service_kernel__16AssertInfoCopierE"; - UrPropertySet PropSet; + MockPropertySet PropSet; setKernelUsesAssert({KernelName}, PropSet); - std::vector Entries = makeEmptyKernels({KernelName}); + std::vector Entries = makeEmptyKernels({KernelName}); - UrImage Img(std::move(Entries), std::move(PropSet)); + MockDeviceImage Img(std::move(Entries), std::move(PropSet)); return Img; } -static sycl::unittest::UrImage generateCopierKernelImage() { +static sycl::unittest::MockDeviceImage generateCopierKernelImage() { using namespace sycl::unittest; static const std::string CopierKernelName = "_ZTSN2cl4sycl6detail23__sycl_service_kernel__16AssertInfoCopierE"; - UrPropertySet PropSet; + MockPropertySet PropSet; - std::vector Entries = makeEmptyKernels({CopierKernelName}); + std::vector Entries = makeEmptyKernels({CopierKernelName}); - UrImage Img(std::move(Entries), std::move(PropSet)); + MockDeviceImage Img(std::move(Entries), std::move(PropSet)); return Img; } -sycl::unittest::UrImage Imgs[] = {generateDefaultImage(), - generateCopierKernelImage()}; -sycl::unittest::UrImageArray<2> ImgArray{Imgs}; +sycl::unittest::MockDeviceImage Imgs[] = {generateDefaultImage(), + generateCopierKernelImage()}; +sycl::unittest::MockDeviceImageArray<2> ImgArray{Imgs}; struct AssertHappened { int Flag = 0; diff --git a/sycl/unittests/buffer/KernelArgMemObj.cpp b/sycl/unittests/buffer/KernelArgMemObj.cpp index ba9b9c9b1001e..2dd1eabfca9a1 100644 --- a/sycl/unittests/buffer/KernelArgMemObj.cpp +++ b/sycl/unittests/buffer/KernelArgMemObj.cpp @@ -8,8 +8,8 @@ #include +#include #include -#include #include class TestKernelWithMemObj; @@ -33,9 +33,9 @@ struct KernelInfo : public unittest::MockKernelInfoBase { } // namespace _V1 } // namespace sycl -static sycl::unittest::UrImage Img = +static sycl::unittest::MockDeviceImage Img = sycl::unittest::generateDefaultImage({"TestKernelWithMemObj"}); -static sycl::unittest::UrImageArray<1> ImgArray{&Img}; +static sycl::unittest::MockDeviceImageArray<1> ImgArray{&Img}; using namespace sycl; diff --git a/sycl/unittests/helpers/UrImage.hpp b/sycl/unittests/helpers/MockDeviceImage.hpp similarity index 73% rename from sycl/unittests/helpers/UrImage.hpp rename to sycl/unittests/helpers/MockDeviceImage.hpp index 14a14ae701527..0b6379dcd858e 100644 --- a/sycl/unittests/helpers/UrImage.hpp +++ b/sycl/unittests/helpers/MockDeviceImage.hpp @@ -1,10 +1,15 @@ -//==------------- UrImage.hpp --- UR mock image unit testing library -------==// +//==------------------------ MockDeviceImage.hpp ---------------------------==// // // 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 // //===----------------------------------------------------------------------===// +// +// Collection of helper classes which allow to mock device images in unit-tests +// that are provided by the SYCL compiler in regular flow. +// +//===----------------------------------------------------------------------===// #pragma once @@ -12,7 +17,6 @@ #include #include #include -#include #include @@ -21,31 +25,31 @@ inline namespace _V1 { namespace unittest { using namespace sycl::detail; -/// Convinience wrapper around _ur_device_binary_property_struct. -class UrProperty { +/// Convinience wrapper around _sycl_device_binary_property_struct. +class MockProperty { public: using NativeType = _sycl_device_binary_property_struct; - /// Constructs a UR property. + /// Constructs a property. /// /// \param Name is a property name. /// \param Data is a vector of raw property value bytes. - /// \param Type is one of ur_property_type values. - UrProperty(const std::string &Name, std::vector Data, uint32_t Type) + /// \param Type is one of sycl_property_type values. + MockProperty(const std::string &Name, std::vector Data, uint32_t Type) : MName(Name), MData(std::move(Data)), MType(Type) { updateNativeType(); } NativeType convertToNativeType() const { return MNative; } - UrProperty(const UrProperty &Src) { + MockProperty(const MockProperty &Src) { MName = Src.MName; MData = Src.MData; MType = Src.MType; updateNativeType(); } - UrProperty &operator=(const UrProperty &Src) { + MockProperty &operator=(const MockProperty &Src) { MName = Src.MName; MData = Src.MData; MType = Src.MType; @@ -70,23 +74,24 @@ class UrProperty { NativeType MNative; }; -/// Convinience wrapper for _ur_offload_entry_struct. -class UrOffloadEntry { +/// Convinience wrapper for _sycl_offload_entry_struct. +class MockOffloadEntry { public: using NativeType = _sycl_offload_entry_struct; - UrOffloadEntry(const std::string &Name, std::vector Data, int32_t Flags) + MockOffloadEntry(const std::string &Name, std::vector Data, + int32_t Flags) : MName(Name), MData(std::move(Data)), MFlags(Flags) { updateNativeType(); } - UrOffloadEntry(const UrOffloadEntry &Src) { + MockOffloadEntry(const MockOffloadEntry &Src) { MName = Src.MName; MData = Src.MData; MFlags = Src.MFlags; updateNativeType(); } - UrOffloadEntry &operator=(const UrOffloadEntry &Src) { + MockOffloadEntry &operator=(const MockOffloadEntry &Src) { MName = Src.MName; MData = Src.MData; MFlags = Src.MFlags; @@ -154,9 +159,9 @@ template LifetimeExtender(std::vector) -> LifetimeExtender; } // namespace internal /// Convenience wrapper for sycl_device_binary_property_set. -class UrPropertySet { +class MockPropertySet { public: - UrPropertySet() { + MockPropertySet() { // Most of unit-tests are statically linked with SYCL RT. On Linux and Mac // systems that causes incorrect RT installation directory detection, which // prevents proper loading of fallback libraries. See intel/llvm#6945 @@ -173,7 +178,7 @@ class UrPropertySet { // Name doesn't matter here, it is not used by RT // Value must be an all-zero 32-bit mask, which would mean that no fallback // libraries are needed to be loaded. - UrProperty DeviceLibReqMask("", Data, SYCL_PROPERTY_TYPE_UINT32); + MockProperty DeviceLibReqMask("", Data, SYCL_PROPERTY_TYPE_UINT32); insert(__SYCL_PROPERTY_SET_DEVICELIB_REQ_MASK, std::move(DeviceLibReqMask)); } @@ -181,15 +186,16 @@ class UrPropertySet { /// /// \param Name is a property name. See ur.hpp for list of known names. /// \param Prop is a property value. - void insert(const std::string &Name, UrProperty &&Props) { + void insert(const std::string &Name, MockProperty &&Props) { insert(Name, internal::LifetimeExtender{std::vector{std::move(Props)}}); } /// Adds a new array of properties to the set. /// - /// \param Name is a property array name. See ur.hpp for list of known names. + /// \param Name is a property array name. See compiler.hpp for list of known + /// names. /// \param Props is an array of property values. - void insert(const std::string &Name, std::vector &&Props) { + void insert(const std::string &Name, std::vector &&Props) { insert(Name, internal::LifetimeExtender{std::move(Props)}); } @@ -211,7 +217,7 @@ class UrPropertySet { /// \param Name is a property array name. See ur.hpp for list of known names. /// \param Props is an array of property values. void insert(const std::string &Name, - internal::LifetimeExtender Props) { + internal::LifetimeExtender Props) { MNames.push_back(Name); MMockProperties.push_back(std::move(Props)); MProperties.push_back(_sycl_device_binary_property_set_struct{ @@ -220,21 +226,22 @@ class UrPropertySet { } std::vector MNames; - std::vector> MMockProperties; + std::vector> MMockProperties; std::vector<_sycl_device_binary_property_set_struct> MProperties; }; -/// Convenience wrapper around UR internal structures, that manages UR binary +/// Convenience wrapper around internal structures, that manages binary /// image data lifecycle. -class UrImage { +class MockDeviceImage { private: /// Constructs an arbitrary device image. - UrImage(uint16_t Version, uint8_t Kind, uint8_t Format, - const std::string &DeviceTargetSpec, - const std::string &CompileOptions, const std::string &LinkOptions, - std::vector &&Manifest, std::vector &&Binary, - internal::LifetimeExtender OffloadEntries, - UrPropertySet PropertySet) + MockDeviceImage(uint16_t Version, uint8_t Kind, uint8_t Format, + const std::string &DeviceTargetSpec, + const std::string &CompileOptions, + const std::string &LinkOptions, std::vector &&Manifest, + std::vector &&Binary, + internal::LifetimeExtender OffloadEntries, + MockPropertySet PropertySet) : MVersion(Version), MKind(Kind), MFormat(Format), MDeviceTargetSpec(DeviceTargetSpec), MCompileOptions(CompileOptions), MLinkOptions(LinkOptions), MManifest(std::move(Manifest)), @@ -243,37 +250,39 @@ class UrImage { public: /// Constructs an arbitrary device image. - UrImage(uint16_t Version, uint8_t Kind, uint8_t Format, - const std::string &DeviceTargetSpec, - const std::string &CompileOptions, const std::string &LinkOptions, - std::vector &&Manifest, std::vector &&Binary, - std::vector &&OffloadEntries, - UrPropertySet PropertySet) - : UrImage(Version, Kind, Format, DeviceTargetSpec, CompileOptions, - LinkOptions, std::move(Manifest), std::move(Binary), - internal::LifetimeExtender(std::move(OffloadEntries)), - std::move(PropertySet)) {} - - /// Constructs a SYCL device image of the latest version. - UrImage(uint8_t Format, const std::string &DeviceTargetSpec, - const std::string &CompileOptions, const std::string &LinkOptions, - std::vector &&Binary, - std::vector &&OffloadEntries, - UrPropertySet PropertySet) - : UrImage(SYCL_DEVICE_BINARY_VERSION, - SYCL_DEVICE_BINARY_OFFLOAD_KIND_SYCL, Format, DeviceTargetSpec, - CompileOptions, LinkOptions, {}, std::move(Binary), - internal::LifetimeExtender(std::move(OffloadEntries)), - std::move(PropertySet)) {} + MockDeviceImage(uint16_t Version, uint8_t Kind, uint8_t Format, + const std::string &DeviceTargetSpec, + const std::string &CompileOptions, + const std::string &LinkOptions, std::vector &&Manifest, + std::vector &&Binary, + std::vector &&OffloadEntries, + MockPropertySet PropertySet) + : MockDeviceImage(Version, Kind, Format, DeviceTargetSpec, CompileOptions, + LinkOptions, std::move(Manifest), std::move(Binary), + internal::LifetimeExtender(std::move(OffloadEntries)), + std::move(PropertySet)) {} + + MockDeviceImage(uint8_t Format, const std::string &DeviceTargetSpec, + const std::string &CompileOptions, + const std::string &LinkOptions, + std::vector &&Binary, + std::vector &&OffloadEntries, + MockPropertySet PropertySet) + : MockDeviceImage(SYCL_DEVICE_BINARY_VERSION, + SYCL_DEVICE_BINARY_OFFLOAD_KIND_SYCL, Format, + DeviceTargetSpec, CompileOptions, LinkOptions, {}, + std::move(Binary), + internal::LifetimeExtender(std::move(OffloadEntries)), + std::move(PropertySet)) {} /// Constructs a mock SYCL device image with: /// - the latest version /// - SPIR-V format /// - empty compile and link options /// - placeholder binary data - UrImage(std::vector &&OffloadEntries, - UrPropertySet PropertySet) - : UrImage( + MockDeviceImage(std::vector &&OffloadEntries, + MockPropertySet PropertySet) + : MockDeviceImage( SYCL_DEVICE_BINARY_VERSION, SYCL_DEVICE_BINARY_OFFLOAD_KIND_SYCL, SYCL_DEVICE_BINARY_TYPE_SPIRV, __SYCL_DEVICE_BINARY_TARGET_SPIRV64, "", "", {}, std::vector{1, 2, 3, 4, 5}, @@ -286,8 +295,8 @@ class UrImage { /// - empty compile and link options /// - placeholder binary data /// - no properties - UrImage(std::vector &&OffloadEntries) - : UrImage(std::move(OffloadEntries), {}) {} + MockDeviceImage(std::vector &&OffloadEntries) + : MockDeviceImage(std::move(OffloadEntries), {}) {} sycl_device_binary_struct convertToNativeType() { return sycl_device_binary_struct{ @@ -318,17 +327,17 @@ class UrImage { std::string MLinkOptions; std::vector MManifest; std::vector MBinary; - internal::LifetimeExtender MOffloadEntries; - UrPropertySet MPropertySet; + internal::LifetimeExtender MOffloadEntries; + MockPropertySet MPropertySet; }; /// Convenience wrapper around sycl_device_binaries_struct, that manages mock /// device images' lifecycle. -template class UrImageArray { +template class MockDeviceImageArray { public: static constexpr size_t NumberOfImages = __NumberOfImages; - UrImageArray(UrImage *Imgs) { + MockDeviceImageArray(MockDeviceImage *Imgs) { for (size_t Idx = 0; Idx < NumberOfImages; ++Idx) MNativeImages[Idx] = Imgs[Idx].convertToNativeType(); @@ -343,7 +352,7 @@ template class UrImageArray { __sycl_register_lib(&MAllBinaries); } - ~UrImageArray() { __sycl_unregister_lib(&MAllBinaries); } + ~MockDeviceImageArray() { __sycl_unregister_lib(&MAllBinaries); } private: sycl_device_binary_struct MNativeImages[NumberOfImages]; @@ -375,11 +384,11 @@ template /// \param Offsets is a list of offsets inside composite spec constant. /// \param DefaultValues is a tuple of default values for composite spec const. template -inline UrProperty makeSpecConstant(std::vector &ValData, - const std::string &Name, - std::initializer_list IDs, - std::initializer_list Offsets, - std::tuple DefaultValues) { +inline MockProperty makeSpecConstant(std::vector &ValData, + const std::string &Name, + std::initializer_list IDs, + std::initializer_list Offsets, + std::tuple DefaultValues) { const size_t PropByteArraySize = sizeof...(T) * sizeof(uint32_t) * 3; std::vector DescData; DescData.resize(8 + PropByteArraySize); @@ -427,15 +436,15 @@ inline UrProperty makeSpecConstant(std::vector &ValData, iterate_tuple(FillData, DefaultValues); - UrProperty Prop{Name, DescData, SYCL_PROPERTY_TYPE_BYTE_ARRAY}; + MockProperty Prop{Name, DescData, SYCL_PROPERTY_TYPE_BYTE_ARRAY}; return Prop; } /// Utility function to mark kernel as the one using assert inline void setKernelUsesAssert(const std::vector &Names, - UrPropertySet &Set) { - std::vector Value; + MockPropertySet &Set) { + std::vector Value; for (const std::string &N : Names) Value.push_back({N, {0, 0, 0, 0}, SYCL_PROPERTY_TYPE_UINT32}); Set.insert(__SYCL_PROPERTY_SET_SYCL_ASSERT_USED, std::move(Value)); @@ -444,32 +453,33 @@ inline void setKernelUsesAssert(const std::vector &Names, /// Utility function to add specialization constants to property set. /// /// This function overrides the default spec constant values. -inline void addSpecConstants(std::vector &&SpecConstants, - std::vector ValData, UrPropertySet &Props) { +inline void addSpecConstants(std::vector &&SpecConstants, + std::vector ValData, + MockPropertySet &Props) { Props.insert(__SYCL_PROPERTY_SET_SPEC_CONST_MAP, std::move(SpecConstants)); - UrProperty Prop{"all", std::move(ValData), SYCL_PROPERTY_TYPE_BYTE_ARRAY}; + MockProperty Prop{"all", std::move(ValData), SYCL_PROPERTY_TYPE_BYTE_ARRAY}; Props.insert(__SYCL_PROPERTY_SET_SPEC_CONST_DEFAULT_VALUES_MAP, std::move(Prop)); } /// Utility function to add ESIMD kernel flag to property set. -inline void addESIMDFlag(UrPropertySet &Props) { +inline void addESIMDFlag(MockPropertySet &Props) { std::vector ValData(sizeof(uint32_t)); ValData[0] = 1; - UrProperty Prop{"isEsimdImage", ValData, SYCL_PROPERTY_TYPE_UINT32}; + MockProperty Prop{"isEsimdImage", ValData, SYCL_PROPERTY_TYPE_UINT32}; Props.insert(__SYCL_PROPERTY_SET_SYCL_MISC_PROP, std::move(Prop)); } /// Utility function to generate offload entries for kernels without arguments. -inline std::vector +inline std::vector makeEmptyKernels(std::initializer_list KernelNames) { - std::vector Entries; + std::vector Entries; for (const auto &Name : KernelNames) { - UrOffloadEntry E{Name, {}, 0}; + MockOffloadEntry E{Name, {}, 0}; Entries.push_back(std::move(E)); } return Entries; @@ -480,7 +490,7 @@ makeEmptyKernels(std::initializer_list KernelNames) { /// \param Name is a property name. /// \param NumArgs is a total number of arguments of a kernel. /// \param ElimArgMask is a bit mask of eliminated kernel arguments IDs. -inline UrProperty +inline MockProperty makeKernelParamOptInfo(const std::string &Name, const size_t NumArgs, const std::vector &ElimArgMask) { const size_t BYTES_FOR_SIZE = 8; @@ -492,7 +502,7 @@ makeKernelParamOptInfo(const std::string &Name, const size_t NumArgs, std::uninitialized_copy(ElimArgMask.begin(), ElimArgMask.end(), DescData.data() + BYTES_FOR_SIZE); - UrProperty Prop{Name, DescData, SYCL_PROPERTY_TYPE_BYTE_ARRAY}; + MockProperty Prop{Name, DescData, SYCL_PROPERTY_TYPE_BYTE_ARRAY}; return Prop; } @@ -503,9 +513,9 @@ makeKernelParamOptInfo(const std::string &Name, const size_t NumArgs, /// \param TypeSize is the size of the underlying type in the device global. /// \param DeviceImageScoped is whether the device global was device image scope /// decorated. -inline UrProperty makeDeviceGlobalInfo(const std::string &Name, - const uint32_t TypeSize, - const std::uint32_t DeviceImageScoped) { +inline MockProperty +makeDeviceGlobalInfo(const std::string &Name, const uint32_t TypeSize, + const std::uint32_t DeviceImageScoped) { constexpr size_t BYTES_FOR_SIZE = 8; const std::uint64_t BytesForArgs = 2 * sizeof(std::uint32_t); std::vector DescData; @@ -515,7 +525,7 @@ inline UrProperty makeDeviceGlobalInfo(const std::string &Name, std::memcpy(DescData.data() + BYTES_FOR_SIZE + sizeof(TypeSize), &DeviceImageScoped, sizeof(DeviceImageScoped)); - UrProperty Prop{Name, DescData, SYCL_PROPERTY_TYPE_BYTE_ARRAY}; + MockProperty Prop{Name, DescData, SYCL_PROPERTY_TYPE_BYTE_ARRAY}; return Prop; } @@ -525,8 +535,8 @@ inline UrProperty makeDeviceGlobalInfo(const std::string &Name, /// \param Name is the name of the hostpipe name. /// \param TypeSize is the size of the underlying type in the hostpipe. /// decorated. -inline UrProperty makeHostPipeInfo(const std::string &Name, - const uint32_t TypeSize) { +inline MockProperty makeHostPipeInfo(const std::string &Name, + const uint32_t TypeSize) { constexpr size_t BYTES_FOR_SIZE = 8; const std::uint64_t BytesForArgs = sizeof(std::uint32_t); std::vector DescData; @@ -534,13 +544,13 @@ inline UrProperty makeHostPipeInfo(const std::string &Name, std::memcpy(DescData.data(), &BytesForArgs, sizeof(BytesForArgs)); std::memcpy(DescData.data() + BYTES_FOR_SIZE, &TypeSize, sizeof(TypeSize)); - UrProperty Prop{Name, DescData, SYCL_PROPERTY_TYPE_BYTE_ARRAY}; + MockProperty Prop{Name, DescData, SYCL_PROPERTY_TYPE_BYTE_ARRAY}; return Prop; } /// Utility function to add aspects to property set. -inline UrProperty makeAspectsProp(const std::vector &Aspects) { +inline MockProperty makeAspectsProp(const std::vector &Aspects) { const size_t BYTES_FOR_SIZE = 8; std::vector ValData(BYTES_FOR_SIZE + Aspects.size() * sizeof(sycl::aspect)); @@ -553,7 +563,7 @@ inline UrProperty makeAspectsProp(const std::vector &Aspects) { return {"aspects", ValData, SYCL_PROPERTY_TYPE_BYTE_ARRAY}; } -inline UrProperty makeReqdWGSizeProp(const std::vector &ReqdWGSize) { +inline MockProperty makeReqdWGSizeProp(const std::vector &ReqdWGSize) { const size_t BYTES_FOR_SIZE = 8; std::vector ValData(BYTES_FOR_SIZE + ReqdWGSize.size() * sizeof(int)); uint64_t ValDataSize = ValData.size(); @@ -567,18 +577,18 @@ inline UrProperty makeReqdWGSizeProp(const std::vector &ReqdWGSize) { } inline void -addDeviceRequirementsProps(UrPropertySet &Props, +addDeviceRequirementsProps(MockPropertySet &Props, const std::vector &Aspects, const std::vector &ReqdWGSize = {}) { - std::vector Value{makeAspectsProp(Aspects)}; + std::vector Value{makeAspectsProp(Aspects)}; if (!ReqdWGSize.empty()) Value.push_back(makeReqdWGSizeProp(ReqdWGSize)); Props.insert(__SYCL_PROPERTY_SET_SYCL_DEVICE_REQUIREMENTS, std::move(Value)); } -inline UrImage +inline MockDeviceImage generateDefaultImage(std::initializer_list KernelNames) { - UrPropertySet PropSet; + MockPropertySet PropSet; std::string Combined; for (auto it = KernelNames.begin(); it != KernelNames.end(); ++it) { @@ -589,15 +599,15 @@ generateDefaultImage(std::initializer_list KernelNames) { std::vector Bin(Combined.begin(), Combined.end()); Bin.push_back(0); - std::vector Entries = makeEmptyKernels(KernelNames); + std::vector Entries = makeEmptyKernels(KernelNames); - UrImage Img{SYCL_DEVICE_BINARY_TYPE_SPIRV, // Format - __SYCL_DEVICE_BINARY_TARGET_SPIRV64, // DeviceTargetSpec - "", // Compile options - "", // Link options - std::move(Bin), - std::move(Entries), - std::move(PropSet)}; + MockDeviceImage Img{SYCL_DEVICE_BINARY_TYPE_SPIRV, // Format + __SYCL_DEVICE_BINARY_TARGET_SPIRV64, // DeviceTargetSpec + "", // Compile options + "", // Link options + std::move(Bin), + std::move(Entries), + std::move(PropSet)}; return Img; } diff --git a/sycl/unittests/helpers/TestKernel.hpp b/sycl/unittests/helpers/TestKernel.hpp index cea2acba20db5..722a6e825a55f 100644 --- a/sycl/unittests/helpers/TestKernel.hpp +++ b/sycl/unittests/helpers/TestKernel.hpp @@ -8,8 +8,8 @@ #pragma once +#include "MockDeviceImage.hpp" #include "MockKernelInfo.hpp" -#include "UrImage.hpp" template class TestKernel; @@ -33,6 +33,6 @@ struct KernelInfo> } // namespace _V1 } // namespace sycl -static sycl::unittest::UrImage Img = +static sycl::unittest::MockDeviceImage Img = sycl::unittest::generateDefaultImage({"TestKernel"}); -static sycl::unittest::UrImageArray<1> ImgArray{&Img}; +static sycl::unittest::MockDeviceImageArray<1> ImgArray{&Img}; diff --git a/sycl/unittests/kernel-and-program/Cache.cpp b/sycl/unittests/kernel-and-program/Cache.cpp index 3d2323c3d4964..92f76e7f097f1 100644 --- a/sycl/unittests/kernel-and-program/Cache.cpp +++ b/sycl/unittests/kernel-and-program/Cache.cpp @@ -14,8 +14,8 @@ #include "detail/context_impl.hpp" #include "detail/kernel_program_cache.hpp" #include "sycl/detail/ur.hpp" +#include #include -#include #include #include @@ -50,25 +50,26 @@ template <> const char *get_spec_constant_symbolic_ID() { } // namespace _V1 } // namespace sycl -static sycl::unittest::UrImage generateDefaultImage() { +static sycl::unittest::MockDeviceImage generateDefaultImage() { using namespace sycl::unittest; std::vector SpecConstData; - UrProperty SC1 = makeSpecConstant(SpecConstData, "SC1", {0}, {0}, {42}); + MockProperty SC1 = + makeSpecConstant(SpecConstData, "SC1", {0}, {0}, {42}); - UrPropertySet PropSet; + MockPropertySet PropSet; addSpecConstants({SC1}, std::move(SpecConstData), PropSet); - std::vector Entries = + std::vector Entries = makeEmptyKernels({"CacheTestKernel", "CacheTestKernel2"}); - UrImage Img(std::move(Entries), std::move(PropSet)); + MockDeviceImage Img(std::move(Entries), std::move(PropSet)); return Img; } -static sycl::unittest::UrImage Img = generateDefaultImage(); -static sycl::unittest::UrImageArray<1> ImgArray{&Img}; +static sycl::unittest::MockDeviceImage Img = generateDefaultImage(); +static sycl::unittest::MockDeviceImageArray<1> ImgArray{&Img}; struct TestCtx { ur_context_handle_t context; diff --git a/sycl/unittests/kernel-and-program/KernelBuildOptions.cpp b/sycl/unittests/kernel-and-program/KernelBuildOptions.cpp index fdf1ff1e32746..2cf52e27cd648 100644 --- a/sycl/unittests/kernel-and-program/KernelBuildOptions.cpp +++ b/sycl/unittests/kernel-and-program/KernelBuildOptions.cpp @@ -11,8 +11,8 @@ #define __SYCL_INTERNAL_API #endif +#include #include -#include #include #include @@ -71,28 +71,29 @@ static void setupCommonMockAPIs(sycl::unittest::UrMock<> &Mock) { &redefinedProgramBuild); } -static sycl::unittest::UrImage generateDefaultImage() { +static sycl::unittest::MockDeviceImage generateDefaultImage() { using namespace sycl::unittest; - UrPropertySet PropSet; + MockPropertySet PropSet; addESIMDFlag(PropSet); std::vector Bin{0, 1, 2, 3, 4, 5}; // Random data - std::vector Entries = makeEmptyKernels({"BuildOptsTestKernel"}); + std::vector Entries = + makeEmptyKernels({"BuildOptsTestKernel"}); - UrImage Img{SYCL_DEVICE_BINARY_TYPE_SPIRV, // Format - __SYCL_DEVICE_BINARY_TARGET_SPIRV64, // DeviceTargetSpec - "-compile-img", // Compile options - "-link-img", // Link options - std::move(Bin), - std::move(Entries), - std::move(PropSet)}; + MockDeviceImage Img{SYCL_DEVICE_BINARY_TYPE_SPIRV, // Format + __SYCL_DEVICE_BINARY_TARGET_SPIRV64, // DeviceTargetSpec + "-compile-img", // Compile options + "-link-img", // Link options + std::move(Bin), + std::move(Entries), + std::move(PropSet)}; return Img; } -sycl::unittest::UrImage Img = generateDefaultImage(); -sycl::unittest::UrImageArray<1> ImgArray{&Img}; +sycl::unittest::MockDeviceImage Img = generateDefaultImage(); +sycl::unittest::MockDeviceImageArray<1> ImgArray{&Img}; TEST(KernelBuildOptions, KernelBundleBasic) { sycl::unittest::UrMock<> Mock; diff --git a/sycl/unittests/kernel-and-program/MultipleDevsCache.cpp b/sycl/unittests/kernel-and-program/MultipleDevsCache.cpp index ee394eef0a1c7..6a635c90b7965 100644 --- a/sycl/unittests/kernel-and-program/MultipleDevsCache.cpp +++ b/sycl/unittests/kernel-and-program/MultipleDevsCache.cpp @@ -11,8 +11,8 @@ #include "detail/context_impl.hpp" #include "detail/kernel_bundle_impl.hpp" #include "detail/kernel_program_cache.hpp" +#include #include -#include #include #include @@ -29,9 +29,9 @@ MOCK_INTEGRATION_HEADER(MultipleDevsCacheTestKernel) static constexpr uint32_t NumDevices = 3; -static sycl::unittest::UrImage Img = +static sycl::unittest::MockDeviceImage Img = sycl::unittest::generateDefaultImage({"MultipleDevsCacheTestKernel"}); -static sycl::unittest::UrImageArray<1> ImgArray{&Img}; +static sycl::unittest::MockDeviceImageArray<1> ImgArray{&Img}; static ur_result_t redefinedDeviceGetAfter(void *pParams) { auto params = *static_cast(pParams); diff --git a/sycl/unittests/kernel-and-program/OutOfResources.cpp b/sycl/unittests/kernel-and-program/OutOfResources.cpp index b0b6e877ebe77..ed2ed0cd9f42d 100644 --- a/sycl/unittests/kernel-and-program/OutOfResources.cpp +++ b/sycl/unittests/kernel-and-program/OutOfResources.cpp @@ -11,8 +11,8 @@ #include "detail/context_impl.hpp" #include "detail/kernel_bundle_impl.hpp" #include "detail/kernel_program_cache.hpp" +#include #include -#include #include #include @@ -27,11 +27,11 @@ class OutOfResourcesKernel2; MOCK_INTEGRATION_HEADER(OutOfResourcesKernel1) MOCK_INTEGRATION_HEADER(OutOfResourcesKernel2) -static sycl::unittest::UrImage Img[2] = { +static sycl::unittest::MockDeviceImage Img[2] = { sycl::unittest::generateDefaultImage({"OutOfResourcesKernel1"}), sycl::unittest::generateDefaultImage({"OutOfResourcesKernel2"})}; -static sycl::unittest::UrImageArray<2> ImgArray{Img}; +static sycl::unittest::MockDeviceImageArray<2> ImgArray{Img}; static int nProgramCreate = 0; static volatile bool outOfResourcesToggle = false; diff --git a/sycl/unittests/pipes/host_pipe_registration.cpp b/sycl/unittests/pipes/host_pipe_registration.cpp index 69dd04a4b969f..c821ddf4e09e9 100644 --- a/sycl/unittests/pipes/host_pipe_registration.cpp +++ b/sycl/unittests/pipes/host_pipe_registration.cpp @@ -12,8 +12,8 @@ #include #include #include +#include #include -#include #include #include @@ -29,21 +29,21 @@ class PipeID; using Pipe = sycl::ext::intel::experimental::pipe; -static sycl::unittest::UrImage generateDefaultImage() { +static sycl::unittest::MockDeviceImage generateDefaultImage() { using namespace sycl::unittest; sycl::detail::host_pipe_map::add(Pipe::get_host_ptr(), "test_host_pipe_unique_id"); - UrPropertySet PropSet; - UrProperty HostPipeInfo = + MockPropertySet PropSet; + MockProperty HostPipeInfo = makeHostPipeInfo("test_host_pipe_unique_id", sizeof(int)); PropSet.insert(__SYCL_PROPERTY_SET_SYCL_HOST_PIPES, - std::vector{std::move(HostPipeInfo)}); + std::vector{std::move(HostPipeInfo)}); - std::vector Entries = makeEmptyKernels({"TestKernel"}); + std::vector Entries = makeEmptyKernels({"TestKernel"}); - UrImage Img(std::move(Entries), std::move(PropSet)); + MockDeviceImage Img(std::move(Entries), std::move(PropSet)); return Img; } @@ -115,8 +115,8 @@ class PipeTest : public ::testing::Test { queue q; }; -static sycl::unittest::UrImage Img = generateDefaultImage(); -static sycl::unittest::UrImageArray<1> ImgArray{&Img}; +static sycl::unittest::MockDeviceImage Img = generateDefaultImage(); +static sycl::unittest::MockDeviceImageArray<1> ImgArray{&Img}; TEST_F(PipeTest, Basic) { // Fake extension diff --git a/sycl/unittests/program_manager/CompileTarget.cpp b/sycl/unittests/program_manager/CompileTarget.cpp index 39f8d64499c7f..4d0bfaae055c1 100644 --- a/sycl/unittests/program_manager/CompileTarget.cpp +++ b/sycl/unittests/program_manager/CompileTarget.cpp @@ -8,8 +8,8 @@ #define SYCL2020_DISABLE_DEPRECATION_WARNINGS +#include #include -#include #include #include @@ -19,14 +19,14 @@ using namespace sycl; namespace sycl { inline namespace _V1 { namespace unittest { -static inline UrImage +static inline MockDeviceImage generateImageWithCompileTarget(std::string KernelName, std::string CompileTarget) { std::vector Data(8 + CompileTarget.size()); std::copy(CompileTarget.begin(), CompileTarget.end(), Data.data() + 8); - UrProperty CompileTargetProperty("compile_target", Data, - SYCL_PROPERTY_TYPE_BYTE_ARRAY); - UrPropertySet PropSet; + MockProperty CompileTargetProperty("compile_target", Data, + SYCL_PROPERTY_TYPE_BYTE_ARRAY); + MockPropertySet PropSet; PropSet.insert(__SYCL_PROPERTY_SET_SYCL_DEVICE_REQUIREMENTS, std::move(CompileTargetProperty)); @@ -34,19 +34,19 @@ generateImageWithCompileTarget(std::string KernelName, // Null terminate the data so it can be interpreted as c string. Bin.push_back(0); - std::vector Entries = makeEmptyKernels({KernelName}); + std::vector Entries = makeEmptyKernels({KernelName}); auto DeviceTargetSpec = CompileTarget == "spir64_x86_64" ? __SYCL_DEVICE_BINARY_TARGET_SPIRV64_X86_64 : __SYCL_DEVICE_BINARY_TARGET_SPIRV64_GEN; - UrImage Img{SYCL_DEVICE_BINARY_TYPE_NATIVE, // Format - DeviceTargetSpec, // DeviceTargetSpec - "", // Compile options - "", // Link options - std::move(Bin), - std::move(Entries), - std::move(PropSet)}; + MockDeviceImage Img{SYCL_DEVICE_BINARY_TYPE_NATIVE, // Format + DeviceTargetSpec, // DeviceTargetSpec + "", // Compile options + "", // Link options + std::move(Bin), + std::move(Entries), + std::move(PropSet)}; return Img; } @@ -66,7 +66,7 @@ MOCK_INTEGRATION_HEADER(RangeKernel) MOCK_INTEGRATION_HEADER(NoDeviceKernel) MOCK_INTEGRATION_HEADER(JITFallbackKernel) -static sycl::unittest::UrImage Img[] = { +static sycl::unittest::MockDeviceImage Img[] = { sycl::unittest::generateDefaultImage({"SingleTaskKernel"}), sycl::unittest::generateImageWithCompileTarget("SingleTaskKernel", "spir64_x86_64"), @@ -95,7 +95,7 @@ static sycl::unittest::UrImage Img[] = { "intel_gpu_bdw"), }; -static sycl::unittest::UrImageArray ImgArray{Img}; +static sycl::unittest::MockDeviceImageArray ImgArray{Img}; struct MockDeviceData { int Ip; diff --git a/sycl/unittests/program_manager/DynamicLinking.cpp b/sycl/unittests/program_manager/DynamicLinking.cpp index d6f39f81008a8..82b86843b49c3 100644 --- a/sycl/unittests/program_manager/DynamicLinking.cpp +++ b/sycl/unittests/program_manager/DynamicLinking.cpp @@ -1,8 +1,8 @@ #include +#include #include #include -#include #include #include @@ -37,10 +37,10 @@ KERNEL_INFO(AOTCaseKernel) } // namespace sycl namespace { -std::vector +std::vector createPropertySet(const std::vector &Symbols) { - sycl::unittest::UrPropertySet PropSet; - std::vector Props; + sycl::unittest::MockPropertySet PropSet; + std::vector Props; for (const std::string &Symbol : Symbols) { std::vector Storage(sizeof(uint32_t)); uint32_t Val = 1; @@ -48,20 +48,21 @@ createPropertySet(const std::vector &Symbols) { std::uninitialized_copy(DataPtr, DataPtr + sizeof(uint32_t), Storage.data()); - sycl::unittest::UrProperty Prop(Symbol, Storage, SYCL_PROPERTY_TYPE_UINT32); + sycl::unittest::MockProperty Prop(Symbol, Storage, + SYCL_PROPERTY_TYPE_UINT32); Props.push_back(Prop); } return Props; } -sycl::unittest::UrImage generateImage( +sycl::unittest::MockDeviceImage generateImage( std::initializer_list KernelNames, const std::vector &ExportedSymbols, const std::vector &ImportedSymbols, unsigned char Magic, sycl::detail::ur::DeviceBinaryType BinType = SYCL_DEVICE_BINARY_TYPE_SPIRV, const char *DeviceTargetSpec = __SYCL_DEVICE_BINARY_TARGET_SPIRV64) { - sycl::unittest::UrPropertySet PropSet; + sycl::unittest::MockPropertySet PropSet; if (!ExportedSymbols.empty()) PropSet.insert(__SYCL_PROPERTY_SET_SYCL_EXPORTED_SYMBOLS, createPropertySet(ExportedSymbols)); @@ -70,16 +71,16 @@ sycl::unittest::UrImage generateImage( createPropertySet(ImportedSymbols)); std::vector Bin{Magic}; - std::vector Entries = + std::vector Entries = sycl::unittest::makeEmptyKernels(KernelNames); - sycl::unittest::UrImage Img{BinType, - DeviceTargetSpec, - "", // Compile options - "", // Link options - std::move(Bin), - std::move(Entries), - std::move(PropSet)}; + sycl::unittest::MockDeviceImage Img{BinType, + DeviceTargetSpec, + "", // Compile options + "", // Link options + std::move(Bin), + std::move(Entries), + std::move(PropSet)}; return Img; } @@ -94,7 +95,7 @@ static constexpr unsigned MUTUAL_DEP_PRG_B = 17; static constexpr unsigned AOT_CASE_PRG_NATIVE = 23; static constexpr unsigned AOT_CASE_PRG_DEP_NATIVE = 29; -static sycl::unittest::UrImage Imgs[] = { +static sycl::unittest::MockDeviceImage Imgs[] = { generateImage({"BasicCaseKernel"}, {}, {"BasicCaseKernelDep"}, BASIC_CASE_PRG), generateImage({"BasicCaseKernelDep"}, {"BasicCaseKernelDep"}, @@ -121,7 +122,7 @@ static sycl::unittest::UrImage Imgs[] = { __SYCL_DEVICE_BINARY_TARGET_SPIRV64_GEN)}; // Registers mock devices images in the SYCL RT -static sycl::unittest::UrImageArray<9> ImgArray{Imgs}; +static sycl::unittest::MockDeviceImageArray<9> ImgArray{Imgs}; TEST(DynamicLinking, BasicCase) { sycl::unittest::UrMock<> Mock; diff --git a/sycl/unittests/program_manager/arg_mask/EliminatedArgMask.cpp b/sycl/unittests/program_manager/arg_mask/EliminatedArgMask.cpp index 23ebfda43bd22..0d920590c6e15 100644 --- a/sycl/unittests/program_manager/arg_mask/EliminatedArgMask.cpp +++ b/sycl/unittests/program_manager/arg_mask/EliminatedArgMask.cpp @@ -12,8 +12,8 @@ #include #include +#include #include -#include #include #include @@ -51,51 +51,52 @@ struct KernelInfo : public unittest::MockKernelInfoBase { } // namespace _V1 } // namespace sycl -static sycl::unittest::UrImage generateEAMTestKernelImage() { +static sycl::unittest::MockDeviceImage generateEAMTestKernelImage() { using namespace sycl::unittest; // Eliminated arguments are 1st and 3rd. std::vector KernelEAM{0b00000101}; - UrProperty EAMKernelPOI = makeKernelParamOptInfo( + MockProperty EAMKernelPOI = makeKernelParamOptInfo( EAMTestKernelName, EAMTestKernelNumArgs, KernelEAM); - std::vector ImgKPOI{std::move(EAMKernelPOI)}; + std::vector ImgKPOI{std::move(EAMKernelPOI)}; - UrPropertySet PropSet; + MockPropertySet PropSet; PropSet.insert(__SYCL_PROPERTY_SET_KERNEL_PARAM_OPT_INFO, std::move(ImgKPOI)); - std::vector Entries = makeEmptyKernels({EAMTestKernelName}); + std::vector Entries = makeEmptyKernels({EAMTestKernelName}); - UrImage Img(std::move(Entries), std::move(PropSet)); + MockDeviceImage Img{std::move(Entries), std::move(PropSet)}; return Img; } -static sycl::unittest::UrImage generateEAMTestKernel3Image() { +static sycl::unittest::MockDeviceImage generateEAMTestKernel3Image() { using namespace sycl::unittest; // Eliminated arguments are 2nd and 4th. std::vector KernelEAM{0b00001010}; - UrProperty EAMKernelPOI = makeKernelParamOptInfo( + MockProperty EAMKernelPOI = makeKernelParamOptInfo( EAMTestKernel3Name, EAMTestKernelNumArgs, KernelEAM); - std::vector ImgKPOI{std::move(EAMKernelPOI)}; + std::vector ImgKPOI{std::move(EAMKernelPOI)}; - UrPropertySet PropSet; + MockPropertySet PropSet; PropSet.insert(__SYCL_PROPERTY_SET_KERNEL_PARAM_OPT_INFO, std::move(ImgKPOI)); - std::vector Entries = makeEmptyKernels({EAMTestKernel3Name}); + std::vector Entries = + makeEmptyKernels({EAMTestKernel3Name}); - UrImage Img(std::move(Entries), std::move(PropSet)); + MockDeviceImage Img(std::move(Entries), std::move(PropSet)); return Img; } -static sycl::unittest::UrImage EAMImg = generateEAMTestKernelImage(); -static sycl::unittest::UrImage EAM2Img = +static sycl::unittest::MockDeviceImage EAMImg = generateEAMTestKernelImage(); +static sycl::unittest::MockDeviceImage EAM2Img = sycl::unittest::generateDefaultImage({EAMTestKernel2Name}); -static sycl::unittest::UrImage EAM3Img = generateEAMTestKernel3Image(); -static sycl::unittest::UrImageArray<1> EAMImgArray{&EAMImg}; -static sycl::unittest::UrImageArray<1> EAM2ImgArray{&EAM2Img}; -static sycl::unittest::UrImageArray<1> EAM3ImgArray{&EAM3Img}; +static sycl::unittest::MockDeviceImage EAM3Img = generateEAMTestKernel3Image(); +static sycl::unittest::MockDeviceImageArray<1> EAMImgArray{&EAMImg}; +static sycl::unittest::MockDeviceImageArray<1> EAM2ImgArray{&EAM2Img}; +static sycl::unittest::MockDeviceImageArray<1> EAM3ImgArray{&EAM3Img}; // ur_program_handle_t address is used as a key for ProgramManager::NativePrograms // storage. redefinedProgramLinkCommon makes ur_program_handle_t address equal to 0x1. diff --git a/sycl/unittests/program_manager/passing_link_and_compile_options.cpp b/sycl/unittests/program_manager/passing_link_and_compile_options.cpp index 88de522c1f2dd..4deac120a133e 100644 --- a/sycl/unittests/program_manager/passing_link_and_compile_options.cpp +++ b/sycl/unittests/program_manager/passing_link_and_compile_options.cpp @@ -10,8 +10,8 @@ #include +#include #include -#include #include #include @@ -56,31 +56,31 @@ struct KernelInfo : public unittest::MockKernelInfoBase { } // namespace sycl template -static sycl::unittest::UrImage +static sycl::unittest::MockDeviceImage generateEAMTestKernelImage(std::string _cmplOptions, std::string _lnkOptions) { using namespace sycl::unittest; std::vector KernelEAM1{0b00000101}; - UrProperty EAMKernelPOI = + MockProperty EAMKernelPOI = makeKernelParamOptInfo(sycl::detail::KernelInfo::getName(), EAMTestKernelNumArgs1, KernelEAM1); - std::vector ImgKPOI{std::move(EAMKernelPOI)}; + std::vector ImgKPOI{std::move(EAMKernelPOI)}; - UrPropertySet PropSet; + MockPropertySet PropSet; PropSet.insert(__SYCL_PROPERTY_SET_KERNEL_PARAM_OPT_INFO, std::move(ImgKPOI)); std::vector Bin{0, 1, 2, 3, 4, 5}; // Random data - std::vector Entries = + std::vector Entries = makeEmptyKernels({sycl::detail::KernelInfo::getName()}); - UrImage Img{SYCL_DEVICE_BINARY_TYPE_SPIRV, // Format - __SYCL_DEVICE_BINARY_TARGET_SPIRV64, // DeviceTargetSpec - _cmplOptions, // Compile options - _lnkOptions, // Link options - std::move(Bin), - std::move(Entries), - std::move(PropSet)}; + MockDeviceImage Img{SYCL_DEVICE_BINARY_TYPE_SPIRV, // Format + __SYCL_DEVICE_BINARY_TARGET_SPIRV64, // DeviceTargetSpec + _cmplOptions, // Compile options + _lnkOptions, // Link options + std::move(Bin), + std::move(Entries), + std::move(PropSet)}; return Img; } @@ -126,10 +126,10 @@ TEST(Link_Compile_Options, compile_link_Options_Test_empty_options) { current_link_options.clear(); current_compile_options.clear(); std::string expected_options = ""; - static sycl::unittest::UrImage DevImage = + static sycl::unittest::MockDeviceImage DevImage = generateEAMTestKernelImage(expected_options, expected_options); - static sycl::unittest::UrImageArray<1> DevImageArray_{&DevImage}; + static sycl::unittest::MockDeviceImageArray<1> DevImageArray_{&DevImage}; auto KernelID_1 = sycl::get_kernel_id(); sycl::queue Queue{Dev}; const sycl::context Ctx = Queue.get_context(); @@ -156,11 +156,11 @@ TEST(Link_Compile_Options, compile_link_Options_Test_filled_options) { "-cl-opt-disable -cl-fp32-correctly-rounded-divide-sqrt", expected_link_options_1 = "-cl-denorms-are-zero -cl-no-signed-zeros"; - static sycl::unittest::UrImage DevImage_1 = + static sycl::unittest::MockDeviceImage DevImage_1 = generateEAMTestKernelImage(expected_compile_options_1, expected_link_options_1); - static sycl::unittest::UrImageArray<1> DevImageArray = {&DevImage_1}; + static sycl::unittest::MockDeviceImageArray<1> DevImageArray = {&DevImage_1}; auto KernelID_1 = sycl::get_kernel_id(); sycl::queue Queue{Dev}; const sycl::context Ctx = Queue.get_context(); @@ -191,10 +191,10 @@ TEST(Link_Compile_Options, check_sycl_build) { current_compile_options.clear(); std::string expected_compile_options = "-cl-opt-disable", expected_link_options = "-cl-denorms-are-zero"; - static sycl::unittest::UrImage DevImage = + static sycl::unittest::MockDeviceImage DevImage = generateEAMTestKernelImage(expected_compile_options, expected_link_options); - static sycl::unittest::UrImageArray<1> DevImageArray{&DevImage}; + static sycl::unittest::MockDeviceImageArray<1> DevImageArray{&DevImage}; auto KernelID = sycl::get_kernel_id(); sycl::context Ctx{Dev}; sycl::queue Queue{Ctx, Dev}; diff --git a/sycl/unittests/queue/GetProfilingInfo.cpp b/sycl/unittests/queue/GetProfilingInfo.cpp index d74702c2f85d8..9c011e16ace8a 100644 --- a/sycl/unittests/queue/GetProfilingInfo.cpp +++ b/sycl/unittests/queue/GetProfilingInfo.cpp @@ -15,9 +15,9 @@ #include +#include #include #include -#include #include #include @@ -51,10 +51,10 @@ TEST(GetProfilingInfo, normal_pass_without_exception) { &redefinedUrEventGetProfilingInfo); const sycl::device Dev = Plt.get_devices()[0]; sycl::context Ctx{Dev}; - static sycl::unittest::UrImage DevImage = + static sycl::unittest::MockDeviceImage DevImage = sycl::unittest::generateDefaultImage({"InfoTestKernel"}); - static sycl::unittest::UrImageArray<1> DevImageArray = {&DevImage}; + static sycl::unittest::MockDeviceImageArray<1> DevImageArray = {&DevImage}; auto KernelID = sycl::get_kernel_id(); sycl::queue Queue{ Ctx, Dev, sycl::property_list{sycl::property::queue::enable_profiling{}}}; @@ -89,9 +89,9 @@ TEST(GetProfilingInfo, command_exception_check) { &redefinedUrEventGetProfilingInfo); const sycl::device Dev = Plt.get_devices()[0]; sycl::context Ctx{Dev}; - static sycl::unittest::UrImage DevImage = + static sycl::unittest::MockDeviceImage DevImage = sycl::unittest::generateDefaultImage({"InfoTestKernel"}); - static sycl::unittest::UrImageArray<1> DevImageArray = {&DevImage}; + static sycl::unittest::MockDeviceImageArray<1> DevImageArray = {&DevImage}; auto KernelID = sycl::get_kernel_id(); sycl::queue Queue{Ctx, Dev}; auto KernelBundle = sycl::get_kernel_bundle( @@ -190,9 +190,9 @@ TEST(GetProfilingInfo, check_if_now_dead_queue_property_set) { &redefinedUrEventGetProfilingInfo); const sycl::device Dev = Plt.get_devices()[0]; sycl::context Ctx{Dev}; - static sycl::unittest::UrImage DevImage = + static sycl::unittest::MockDeviceImage DevImage = sycl::unittest::generateDefaultImage({"InfoTestKernel"}); - static sycl::unittest::UrImageArray<1> DevImageArray = {&DevImage}; + static sycl::unittest::MockDeviceImageArray<1> DevImageArray = {&DevImage}; auto KernelID = sycl::get_kernel_id(); const int globalWIs{512}; sycl::event event; @@ -230,10 +230,10 @@ TEST(GetProfilingInfo, check_if_now_dead_queue_property_not_set) { &redefinedUrEventGetProfilingInfo); const sycl::device Dev = Plt.get_devices()[0]; sycl::context Ctx{Dev}; - static sycl::unittest::UrImage DevImage = + static sycl::unittest::MockDeviceImage DevImage = sycl::unittest::generateDefaultImage({"InfoTestKernel"}); - static sycl::unittest::UrImageArray<1> DevImageArray = {&DevImage}; + static sycl::unittest::MockDeviceImageArray<1> DevImageArray = {&DevImage}; auto KernelID = sycl::get_kernel_id(); const int globalWIs{512}; sycl::event event; @@ -372,9 +372,9 @@ TEST(GetProfilingInfo, fallback_profiling_PiGetDeviceAndHostTimer_unsupported) { &redefinedDeviceGetInfoAcc); const sycl::device Dev = Plt.get_devices()[0]; sycl::context Ctx{Dev}; - static sycl::unittest::UrImage DevImage = + static sycl::unittest::MockDeviceImage DevImage = sycl::unittest::generateDefaultImage({"InfoTestKernel"}); - static sycl::unittest::UrImageArray<1> DevImageArray = {&DevImage}; + static sycl::unittest::MockDeviceImageArray<1> DevImageArray = {&DevImage}; auto KernelID = sycl::get_kernel_id(); sycl::queue Queue{ Ctx, Dev, sycl::property_list{sycl::property::queue::enable_profiling{}}}; @@ -412,9 +412,9 @@ TEST(GetProfilingInfo, fallback_profiling_mock_piEnqueueKernelLaunch) { &redefinedDeviceGetInfoAcc); const sycl::device Dev = Plt.get_devices()[0]; sycl::context Ctx{Dev}; - static sycl::unittest::UrImage DevImage = + static sycl::unittest::MockDeviceImage DevImage = sycl::unittest::generateDefaultImage({"InfoTestKernel"}); - static sycl::unittest::UrImageArray<1> DevImageArray = {&DevImage}; + static sycl::unittest::MockDeviceImageArray<1> DevImageArray = {&DevImage}; auto KernelID = sycl::get_kernel_id(); sycl::queue Queue{ Ctx, Dev, sycl::property_list{sycl::property::queue::enable_profiling{}}}; diff --git a/sycl/unittests/scheduler/CommandsWaitForEvents.cpp b/sycl/unittests/scheduler/CommandsWaitForEvents.cpp index 355f8985acf64..0d59ec13795cb 100644 --- a/sycl/unittests/scheduler/CommandsWaitForEvents.cpp +++ b/sycl/unittests/scheduler/CommandsWaitForEvents.cpp @@ -9,8 +9,8 @@ #include "SchedulerTest.hpp" #include "SchedulerTestUtils.hpp" #include "ur_mock_helpers.hpp" +#include #include -#include #include #include @@ -102,22 +102,22 @@ struct KernelInfo } // namespace _V1 } // namespace sycl -static sycl::unittest::UrImage generateDefaultImage() { +static sycl::unittest::MockDeviceImage generateDefaultImage() { using namespace sycl::unittest; - UrPropertySet PropSet; + MockPropertySet PropSet; addESIMDFlag(PropSet); - std::vector Entries = + std::vector Entries = makeEmptyKernels({"StreamAUXCmdsWait_TestKernel"}); - UrImage Img(std::move(Entries), std::move(PropSet)); + MockDeviceImage Img(std::move(Entries), std::move(PropSet)); return Img; } -sycl::unittest::UrImage Img = generateDefaultImage(); -sycl::unittest::UrImageArray<1> ImgArray{&Img}; +sycl::unittest::MockDeviceImage Img = generateDefaultImage(); +sycl::unittest::MockDeviceImageArray<1> ImgArray{&Img}; class EventImplProxyT : public sycl::detail::event_impl { public: