diff --git a/sycl/unittests/Extensions/DeviceGlobal.cpp b/sycl/unittests/Extensions/DeviceGlobal.cpp index ee59cb4dc2d84..e61afbdc5dc09 100644 --- a/sycl/unittests/Extensions/DeviceGlobal.cpp +++ b/sycl/unittests/Extensions/DeviceGlobal.cpp @@ -12,7 +12,7 @@ #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,29 +61,29 @@ 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, - UrArray{std::move(DevGlobInfo)}); + Array{std::move(DevGlobInfo)}); std::vector Bin{10, 11, 12, 13, 14, 15}; // Random data - UrArray Entries = + Array Entries = makeEmptyKernels({DeviceGlobalTestKernelName}); - 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; } -static sycl::unittest::UrImage generateDeviceGlobalImgScopeImage() { +static sycl::unittest::MockDeviceImage generateDeviceGlobalImgScopeImage() { using namespace sycl::unittest; // Call device global map initializer explicitly to mimic the integration @@ -92,32 +92,32 @@ 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, - UrArray{std::move(DevGlobInfo)}); + Array{std::move(DevGlobInfo)}); std::vector Bin{10, 11, 12, 13, 14, 15}; // Random data - UrArray Entries = + Array Entries = makeEmptyKernels({DeviceGlobalImgScopeTestKernelName}); - 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; } 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 18d45736e54cb..0b2b9d09f7ddb 100644 --- a/sycl/unittests/Extensions/USMMemcpy2D.cpp +++ b/sycl/unittests/Extensions/USMMemcpy2D.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include @@ -125,31 +125,31 @@ struct KernelInfo> } // namespace _V1 } // namespace sycl -static sycl::unittest::UrImage generateMemopsImage() { +static sycl::unittest::MockDeviceImage generateMemopsImage() { using namespace sycl::unittest; - UrPropertySet PropSet; + MockPropertySet PropSet; std::vector Bin{10, 11, 12, 13, 14, 15}; // Random data - UrArray Entries = makeEmptyKernels( + Array Entries = makeEmptyKernels( {USMFillHelperKernelNameLong, USMFillHelperKernelNameChar, USMMemcpyHelperKernelNameLong, USMMemcpyHelperKernelNameChar}); - 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; } namespace { -sycl::unittest::UrImage Imgs[] = {generateMemopsImage()}; -sycl::unittest::UrImageArray<1> ImgArray{Imgs}; +sycl::unittest::MockDeviceImage Imgs[] = {generateMemopsImage()}; +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 8ec091e099f8a..9c9f8d8f257a7 100644 --- a/sycl/unittests/Extensions/VirtualFunctions/RuntimeLinking.cpp +++ b/sycl/unittests/Extensions/VirtualFunctions/RuntimeLinking.cpp @@ -4,7 +4,7 @@ #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; - sycl::unittest::UrArray Props; + sycl::unittest::MockPropertySet PropSet; + sycl::unittest::Array 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}; - sycl::unittest::UrArray Entries = + sycl::unittest::Array 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/SYCL2020/DeviceGetInfoAspects.cpp b/sycl/unittests/SYCL2020/DeviceGetInfoAspects.cpp index 42ff1c6eceabf..a77d6660cf6cc 100644 --- a/sycl/unittests/SYCL2020/DeviceGetInfoAspects.cpp +++ b/sycl/unittests/SYCL2020/DeviceGetInfoAspects.cpp @@ -8,7 +8,7 @@ #include -#include +#include #include #include diff --git a/sycl/unittests/SYCL2020/IsCompatible.cpp b/sycl/unittests/SYCL2020/IsCompatible.cpp index aaa295bf77b2f..62941336a220f 100644 --- a/sycl/unittests/SYCL2020/IsCompatible.cpp +++ b/sycl/unittests/SYCL2020/IsCompatible.cpp @@ -1,7 +1,7 @@ #include #include -#include +#include #include #include @@ -22,30 +22,31 @@ 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 = {}) { + const std::vector &Aspects, + const std::vector &ReqdWGSize = {}) { using namespace sycl::unittest; - UrPropertySet PropSet; + MockPropertySet PropSet; addDeviceRequirementsProps(PropSet, Aspects, ReqdWGSize); std::vector Bin{0, 1, 2, 3, 4, 5}; // Random data - UrArray Entries = makeEmptyKernels(KernelNames); + Array 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; } -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) @@ -64,7 +65,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 9829f746ac819..0abc6f72b1dd9 100644 --- a/sycl/unittests/SYCL2020/KernelBundle.cpp +++ b/sycl/unittests/SYCL2020/KernelBundle.cpp @@ -11,7 +11,7 @@ #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 - UrArray Entries = makeEmptyKernels(KernelNames); + Array 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 897ff6aba4f4d..4ab308b44cfae 100644 --- a/sycl/unittests/SYCL2020/KernelBundleStateFiltering.cpp +++ b/sycl/unittests/SYCL2020/KernelBundleStateFiltering.cpp @@ -11,7 +11,7 @@ #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++}; - UrArray Entries = makeEmptyKernels(KernelNames); + Array 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 21e458864549a..ed6cde0c90e3c 100644 --- a/sycl/unittests/SYCL2020/KernelID.cpp +++ b/sycl/unittests/SYCL2020/KernelID.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include @@ -47,33 +47,33 @@ struct KernelInfo : public unittest::MockKernelInfoBase { } // namespace _V1 } // namespace sycl -static sycl::unittest::UrImage +static sycl::unittest::MockDeviceImage generateDefaultImage(std::initializer_list Kernels) { using namespace sycl::unittest; - UrPropertySet PropSet; + MockPropertySet PropSet; std::vector Bin{0, 1, 2, 3, 4, 5}; // Random data - UrArray Entries = makeEmptyKernels(Kernels); + Array Entries = makeEmptyKernels(Kernels); - 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; } -static sycl::unittest::UrImage Imgs[2] = { +static sycl::unittest::MockDeviceImage Imgs[2] = { generateDefaultImage({"KernelID_TestKernel1", "KernelID_TestKernel3"}), 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 9875084a3ed92..19d606e29623f 100644 --- a/sycl/unittests/SYCL2020/SpecializationConstant.cpp +++ b/sycl/unittests/SYCL2020/SpecializationConstant.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include @@ -37,33 +37,34 @@ 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 Bin{0, 1, 2, 3, 4, 5}; // Random data - UrArray Entries = + Array Entries = makeEmptyKernels({"SpecializationConstant_TestKernel"}); - 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; } -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/accessor/AccessorPlaceholder.cpp b/sycl/unittests/accessor/AccessorPlaceholder.cpp index 045ae6402d22e..fbc1b26bbc07f 100644 --- a/sycl/unittests/accessor/AccessorPlaceholder.cpp +++ b/sycl/unittests/accessor/AccessorPlaceholder.cpp @@ -1,6 +1,6 @@ #include -#include +#include #include #include #include diff --git a/sycl/unittests/assert/assert.cpp b/sycl/unittests/assert/assert.cpp index 33048f3433932..3957628931b2e 100644 --- a/sycl/unittests/assert/assert.cpp +++ b/sycl/unittests/assert/assert.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include @@ -73,58 +73,58 @@ 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 Bin{0, 1, 2, 3, 4, 5}; // Random data - UrArray Entries = makeEmptyKernels({KernelName}); + Array Entries = makeEmptyKernels({KernelName}); - 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; } -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 Bin{10, 11, 12, 13, 14, 15}; // Random data - UrArray Entries = makeEmptyKernels({CopierKernelName}); + Array Entries = makeEmptyKernels({CopierKernelName}); - 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; } -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..57b25980ff03b 100644 --- a/sycl/unittests/buffer/KernelArgMemObj.cpp +++ b/sycl/unittests/buffer/KernelArgMemObj.cpp @@ -9,7 +9,7 @@ #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 76% rename from sycl/unittests/helpers/UrImage.hpp rename to sycl/unittests/helpers/MockDeviceImage.hpp index 566817d7ef375..8a56e90e3043d 100644 --- a/sycl/unittests/helpers/UrImage.hpp +++ b/sycl/unittests/helpers/MockDeviceImage.hpp @@ -1,4 +1,5 @@ -//==------------- UrImage.hpp --- UR mock image unit testing library -------==// +//==------------- MockDeviceImage.hpp --- UR mock image unit testing library +//-------==// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -22,7 +23,7 @@ namespace unittest { using namespace sycl::detail; /// Convinience wrapper around _ur_device_binary_property_struct. -class UrProperty { +class MockProperty { public: using NativeType = _sycl_device_binary_property_struct; @@ -31,21 +32,21 @@ class UrProperty { /// \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) + 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; @@ -71,22 +72,23 @@ class UrProperty { }; /// Convinience wrapper for _ur_offload_entry_struct. -class UrOffloadEntry { +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; @@ -110,17 +112,17 @@ class UrOffloadEntry { }; /// Generic array of UR entries. -template class UrArray { +template class Array { public: - explicit UrArray(std::vector Entries) : MMockEntries(std::move(Entries)) { + explicit Array(std::vector Entries) : MMockEntries(std::move(Entries)) { updateEntries(); } - UrArray(std::initializer_list Entries) : MMockEntries(std::move(Entries)) { + Array(std::initializer_list Entries) : MMockEntries(std::move(Entries)) { updateEntries(); } - UrArray() = default; + Array() = default; void push_back(const T &Entry) { MMockEntries.push_back(Entry); @@ -161,15 +163,15 @@ template class UrArray { }; #ifdef __cpp_deduction_guides -template UrArray(std::vector) -> UrArray; +template Array(std::vector) -> Array; -template UrArray(std::initializer_list) -> UrArray; +template Array(std::initializer_list) -> Array; #endif // __cpp_deduction_guides /// 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 @@ -186,15 +188,15 @@ 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); - insert(__SYCL_PROPERTY_SET_DEVICELIB_REQ_MASK, UrArray{DeviceLibReqMask}); + MockProperty DeviceLibReqMask("", Data, SYCL_PROPERTY_TYPE_UINT32); + insert(__SYCL_PROPERTY_SET_DEVICELIB_REQ_MASK, Array{DeviceLibReqMask}); } /// 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 Props is an array of property values. - void insert(const std::string &Name, UrArray Props) { + void insert(const std::string &Name, Array Props) { MNames.push_back(Name); MMockProperties.push_back(std::move(Props)); MProperties.push_back(_sycl_device_binary_property_set_struct{ @@ -216,20 +218,22 @@ class UrPropertySet { private: 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 /// image data lifecycle. -class UrImage { +class MockDeviceImage { 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, - UrArray 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, + Array OffloadEntries, + MockPropertySet PropertySet) : MVersion(Version), MKind(Kind), MFormat(Format), MDeviceTargetSpec(DeviceTargetSpec), MCompileOptions(CompileOptions), MLinkOptions(LinkOptions), MManifest(std::move(Manifest)), @@ -237,14 +241,17 @@ class UrImage { MPropertySet(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, - UrArray OffloadEntries, UrPropertySet PropertySet) - : UrImage(SYCL_DEVICE_BINARY_VERSION, - SYCL_DEVICE_BINARY_OFFLOAD_KIND_SYCL, Format, DeviceTargetSpec, - CompileOptions, LinkOptions, {}, std::move(Binary), - 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, + Array OffloadEntries, + MockPropertySet PropertySet) + : MockDeviceImage(SYCL_DEVICE_BINARY_VERSION, + SYCL_DEVICE_BINARY_OFFLOAD_KIND_SYCL, Format, + DeviceTargetSpec, CompileOptions, LinkOptions, {}, + std::move(Binary), std::move(OffloadEntries), + std::move(PropertySet)) {} sycl_device_binary_struct convertToNativeType() { return sycl_device_binary_struct{ @@ -275,17 +282,17 @@ class UrImage { std::string MLinkOptions; std::vector MManifest; std::vector MBinary; - UrArray MOffloadEntries; - UrPropertySet MPropertySet; + Array 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(); @@ -300,7 +307,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]; @@ -332,11 +339,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); @@ -384,15 +391,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) { - UrArray Value; + MockPropertySet &Set) { + Array 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)); @@ -401,36 +408,37 @@ 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(UrArray SpecConstants, - std::vector ValData, UrPropertySet &Props) { +inline void addSpecConstants(Array 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}; - UrArray DefaultValues{std::move(Prop)}; + Array DefaultValues{std::move(Prop)}; Props.insert(__SYCL_PROPERTY_SET_SPEC_CONST_DEFAULT_VALUES_MAP, std::move(DefaultValues)); } /// 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}; - UrArray Value{std::move(Prop)}; + Array Value{std::move(Prop)}; Props.insert(__SYCL_PROPERTY_SET_SYCL_MISC_PROP, std::move(Value)); } /// Utility function to generate offload entries for kernels without arguments. -inline UrArray +inline Array makeEmptyKernels(std::initializer_list KernelNames) { - UrArray Entries; + Array Entries; for (const auto &Name : KernelNames) { - UrOffloadEntry E{Name, {}, 0}; + MockOffloadEntry E{Name, {}, 0}; Entries.push_back(std::move(E)); } return Entries; @@ -441,7 +449,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; @@ -453,7 +461,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; } @@ -464,9 +472,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; @@ -476,7 +484,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; } @@ -486,8 +494,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; @@ -495,13 +503,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)); @@ -514,7 +522,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(); @@ -528,30 +536,30 @@ inline UrProperty makeReqdWGSizeProp(const std::vector &ReqdWGSize) { } inline void -addDeviceRequirementsProps(UrPropertySet &Props, +addDeviceRequirementsProps(MockPropertySet &Props, const std::vector &Aspects, const std::vector &ReqdWGSize = {}) { - UrArray Value{makeAspectsProp(Aspects)}; + Array 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::vector Bin{0, 1, 2, 3, 4, 5}; // Random data - UrArray Entries = makeEmptyKernels(KernelNames); + Array 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..3ee2ad5833ec8 100644 --- a/sycl/unittests/helpers/TestKernel.hpp +++ b/sycl/unittests/helpers/TestKernel.hpp @@ -9,7 +9,7 @@ #pragma once #include "MockKernelInfo.hpp" -#include "UrImage.hpp" +#include "MockDeviceImage.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 c2ddb46c3a17f..f7b7922faa8e0 100644 --- a/sycl/unittests/kernel-and-program/Cache.cpp +++ b/sycl/unittests/kernel-and-program/Cache.cpp @@ -15,7 +15,7 @@ #include "detail/kernel_program_cache.hpp" #include "sycl/detail/ur.hpp" #include -#include +#include #include #include @@ -50,33 +50,34 @@ 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 Bin{0, 1, 2, 3, 4, 5}; // Random data - UrArray Entries = + Array Entries = makeEmptyKernels({"CacheTestKernel", "CacheTestKernel2"}); - 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; } -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 2fb0d69da97b9..e34b871c26a50 100644 --- a/sycl/unittests/kernel-and-program/KernelBuildOptions.cpp +++ b/sycl/unittests/kernel-and-program/KernelBuildOptions.cpp @@ -12,7 +12,7 @@ #endif #include -#include +#include #include #include @@ -71,28 +71,28 @@ 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 - UrArray Entries = makeEmptyKernels({"BuildOptsTestKernel"}); + Array 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 5bcbc3150abef..7d89ae0f73b3e 100644 --- a/sycl/unittests/kernel-and-program/MultipleDevsCache.cpp +++ b/sycl/unittests/kernel-and-program/MultipleDevsCache.cpp @@ -12,7 +12,7 @@ #include "detail/kernel_bundle_impl.hpp" #include "detail/kernel_program_cache.hpp" #include -#include +#include #include #include @@ -25,9 +25,9 @@ class MultipleDevsCacheTestKernel; MOCK_INTEGRATION_HEADER(MultipleDevsCacheTestKernel) -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 c249e6599ec5a..31ef5b9a979ee 100644 --- a/sycl/unittests/kernel-and-program/OutOfResources.cpp +++ b/sycl/unittests/kernel-and-program/OutOfResources.cpp @@ -12,7 +12,7 @@ #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 b625b9f5fc5cc..c7e605daf2be2 100644 --- a/sycl/unittests/pipes/host_pipe_registration.cpp +++ b/sycl/unittests/pipes/host_pipe_registration.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include @@ -29,29 +29,29 @@ 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, - UrArray{std::move(HostPipeInfo)}); + Array{std::move(HostPipeInfo)}); std::vector Bin{0, 1, 2, 3, 4, 5}; // Random data - UrArray Entries = makeEmptyKernels({"TestKernel"}); + Array Entries = makeEmptyKernels({"TestKernel"}); - 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; } @@ -123,8 +123,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/BuildLog.cpp b/sycl/unittests/program_manager/BuildLog.cpp index fc4ff8abbbde2..1c28d8e3d6003 100644 --- a/sycl/unittests/program_manager/BuildLog.cpp +++ b/sycl/unittests/program_manager/BuildLog.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include diff --git a/sycl/unittests/program_manager/DynamicLinking.cpp b/sycl/unittests/program_manager/DynamicLinking.cpp index c8c9b101baf9e..29c48f3100175 100644 --- a/sycl/unittests/program_manager/DynamicLinking.cpp +++ b/sycl/unittests/program_manager/DynamicLinking.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -37,10 +37,10 @@ KERNEL_INFO(AOTCaseKernel) } // namespace sycl namespace { -sycl::unittest::UrArray +sycl::unittest::Array createPropertySet(const std::vector &Symbols) { - sycl::unittest::UrPropertySet PropSet; - sycl::unittest::UrArray Props; + sycl::unittest::MockPropertySet PropSet; + sycl::unittest::Array Props; for (const std::string &Symbol : Symbols) { std::vector Storage(sizeof(uint32_t)); uint32_t Val = 1; @@ -48,21 +48,22 @@ 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 +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) { - sycl::unittest::UrPropertySet PropSet; + sycl::unittest::MockPropertySet PropSet; if (!ExportedSymbols.empty()) PropSet.insert(__SYCL_PROPERTY_SET_SYCL_EXPORTED_SYMBOLS, createPropertySet(ExportedSymbols)); @@ -71,10 +72,10 @@ generateImage(std::initializer_list KernelNames, createPropertySet(ImportedSymbols)); std::vector Bin{Magic}; - sycl::unittest::UrArray Entries = + sycl::unittest::Array Entries = sycl::unittest::makeEmptyKernels(KernelNames); - sycl::unittest::UrImage Img{ + sycl::unittest::MockDeviceImage Img{ BinType, __SYCL_DEVICE_BINARY_TARGET_SPIRV64, // DeviceTargetSpec "", // Compile options @@ -96,7 +97,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"}, @@ -120,7 +121,7 @@ static sycl::unittest::UrImage Imgs[] = { AOT_CASE_PRG_DEP_NATIVE, SYCL_DEVICE_BINARY_TYPE_NATIVE)}; // 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/SubDevices.cpp b/sycl/unittests/program_manager/SubDevices.cpp index 26d5b4cf148a0..759b35190bbf6 100644 --- a/sycl/unittests/program_manager/SubDevices.cpp +++ b/sycl/unittests/program_manager/SubDevices.cpp @@ -8,7 +8,7 @@ #include -#include +#include #include #include diff --git a/sycl/unittests/program_manager/arg_mask/EliminatedArgMask.cpp b/sycl/unittests/program_manager/arg_mask/EliminatedArgMask.cpp index 5eb6fdb7e8f4e..015b9465a08cb 100644 --- a/sycl/unittests/program_manager/arg_mask/EliminatedArgMask.cpp +++ b/sycl/unittests/program_manager/arg_mask/EliminatedArgMask.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include @@ -43,57 +43,57 @@ 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); - UrArray ImgKPOI{std::move(EAMKernelPOI)}; + Array 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 - UrArray Entries = makeEmptyKernels({EAMTestKernelName}); + Array Entries = makeEmptyKernels({EAMTestKernelName}); - 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; } -static sycl::unittest::UrImage generateEAMTestKernel2Image() { +static sycl::unittest::MockDeviceImage generateEAMTestKernel2Image() { using namespace sycl::unittest; - UrPropertySet PropSet; + MockPropertySet PropSet; std::vector Bin{6, 7, 8, 9, 10, 11}; // Random data - UrArray Entries = makeEmptyKernels({EAMTestKernel2Name}); + Array Entries = makeEmptyKernels({EAMTestKernel2Name}); - 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; } -static sycl::unittest::UrImage EAMImg = generateEAMTestKernelImage(); -static sycl::unittest::UrImage EAM2Img = generateEAMTestKernel2Image(); -static sycl::unittest::UrImageArray<1> EAMImgArray{&EAMImg}; -static sycl::unittest::UrImageArray<1> EAM2ImgArray{&EAM2Img}; +static sycl::unittest::MockDeviceImage EAMImg = generateEAMTestKernelImage(); +static sycl::unittest::MockDeviceImage EAM2Img = generateEAMTestKernel2Image(); +static sycl::unittest::MockDeviceImageArray<1> EAMImgArray{&EAMImg}; +static sycl::unittest::MockDeviceImageArray<1> EAM2ImgArray{&EAM2Img}; // 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/itt_annotations.cpp b/sycl/unittests/program_manager/itt_annotations.cpp index edcb9a9baf88b..05945b63f7314 100644 --- a/sycl/unittests/program_manager/itt_annotations.cpp +++ b/sycl/unittests/program_manager/itt_annotations.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include 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 893e8bdb41ee7..89c03b1679e84 100644 --- a/sycl/unittests/program_manager/passing_link_and_compile_options.cpp +++ b/sycl/unittests/program_manager/passing_link_and_compile_options.cpp @@ -11,7 +11,7 @@ #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); - UrArray ImgKPOI{std::move(EAMKernelPOI)}; + Array 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 - UrArray Entries = + Array 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..1889c6d742eaa 100644 --- a/sycl/unittests/queue/GetProfilingInfo.cpp +++ b/sycl/unittests/queue/GetProfilingInfo.cpp @@ -17,7 +17,7 @@ #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 fdada9b624714..7e65b65c264ba 100644 --- a/sycl/unittests/scheduler/CommandsWaitForEvents.cpp +++ b/sycl/unittests/scheduler/CommandsWaitForEvents.cpp @@ -10,7 +10,7 @@ #include "SchedulerTestUtils.hpp" #include "ur_mock_helpers.hpp" #include -#include +#include #include #include @@ -102,29 +102,29 @@ 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 Bin{0, 1, 2, 3, 4, 5}; // Random data - UrArray Entries = + Array Entries = makeEmptyKernels({"StreamAUXCmdsWait_TestKernel"}); - 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; } -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: diff --git a/sycl/unittests/scheduler/InOrderQueueHostTaskDeps.cpp b/sycl/unittests/scheduler/InOrderQueueHostTaskDeps.cpp index c37753735c658..02316fc1549c1 100644 --- a/sycl/unittests/scheduler/InOrderQueueHostTaskDeps.cpp +++ b/sycl/unittests/scheduler/InOrderQueueHostTaskDeps.cpp @@ -10,7 +10,7 @@ #include "SchedulerTestUtils.hpp" #include -#include +#include #include #include diff --git a/sycl/unittests/scheduler/RequiredWGSize.cpp b/sycl/unittests/scheduler/RequiredWGSize.cpp index 3cfa1958ed524..e62da1134b1b1 100644 --- a/sycl/unittests/scheduler/RequiredWGSize.cpp +++ b/sycl/unittests/scheduler/RequiredWGSize.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include diff --git a/sycl/unittests/stream/stream.cpp b/sycl/unittests/stream/stream.cpp index 0811abff8cf77..a075a8eb0f573 100644 --- a/sycl/unittests/stream/stream.cpp +++ b/sycl/unittests/stream/stream.cpp @@ -8,7 +8,7 @@ #include -#include +#include #include #include diff --git a/sycl/unittests/windows/dllmain.cpp b/sycl/unittests/windows/dllmain.cpp index f99364fe11720..de08aeab30a97 100644 --- a/sycl/unittests/windows/dllmain.cpp +++ b/sycl/unittests/windows/dllmain.cpp @@ -12,7 +12,7 @@ * distinct binary executable. */ -#include +#include #include #include