diff --git a/sycl/unittests/Extensions/DeviceGlobal.cpp b/sycl/unittests/Extensions/DeviceGlobal.cpp index 4d47500507502..dc34b822a1013 100644 --- a/sycl/unittests/Extensions/DeviceGlobal.cpp +++ b/sycl/unittests/Extensions/DeviceGlobal.cpp @@ -12,6 +12,7 @@ #include "detail/context_impl.hpp" #include "detail/kernel_program_cache.hpp" +#include #include #include @@ -42,31 +43,17 @@ sycl::ext::oneapi::experimental::device_global< namespace sycl { __SYCL_INLINE_VER_NAMESPACE(_V1) { namespace detail { -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo + : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return DeviceGlobalTestKernelName; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo + : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return DeviceGlobalImgScopeTestKernelName; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; } // namespace detail } // __SYCL_INLINE_VER_NAMESPACE(_V1) diff --git a/sycl/unittests/Extensions/USMMemcpy2D.cpp b/sycl/unittests/Extensions/USMMemcpy2D.cpp index 8139f6ae24edd..ffdaa86ff95a6 100644 --- a/sycl/unittests/Extensions/USMMemcpy2D.cpp +++ b/sycl/unittests/Extensions/USMMemcpy2D.cpp @@ -10,6 +10,7 @@ #include +#include #include #include @@ -23,7 +24,9 @@ constexpr const char *USMMemcpyHelperKernelNameChar = "__usmmemcpy2d_char"; namespace sycl { __SYCL_INLINE_VER_NAMESPACE(_V1) { namespace detail { -template <> struct KernelInfo> { +template <> +struct KernelInfo> + : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return USMFillHelperKernelNameLong; } static constexpr unsigned getNumParams() { return 7; } static const kernel_param_desc_t &getParamDesc(int Idx) { @@ -39,15 +42,14 @@ template <> struct KernelInfo> { }; return DummySignature[Idx]; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } static constexpr int64_t getKernelSize() { return 2 * sizeof(void *) + 2 * sizeof(sycl::id<2>) + 3 * sizeof(size_t); } }; -template <> struct KernelInfo> { +template <> +struct KernelInfo> + : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return USMFillHelperKernelNameChar; } static constexpr unsigned getNumParams() { return 7; } static const kernel_param_desc_t &getParamDesc(int Idx) { @@ -63,15 +65,14 @@ template <> struct KernelInfo> { }; return DummySignature[Idx]; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } static constexpr int64_t getKernelSize() { return 2 * sizeof(void *) + 2 * sizeof(sycl::id<2>) + 3 * sizeof(size_t); } }; -template <> struct KernelInfo> { +template <> +struct KernelInfo> + : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return USMMemcpyHelperKernelNameLong; } @@ -90,15 +91,14 @@ template <> struct KernelInfo> { }; return DummySignature[Idx]; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } static constexpr int64_t getKernelSize() { return 2 * sizeof(void *) + 2 * sizeof(sycl::id<2>) + 4 * sizeof(size_t); } }; -template <> struct KernelInfo> { +template <> +struct KernelInfo> + : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return USMMemcpyHelperKernelNameChar; } @@ -117,9 +117,6 @@ template <> struct KernelInfo> { }; return DummySignature[Idx]; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } static constexpr int64_t getKernelSize() { return 2 * sizeof(void *) + 2 * sizeof(sycl::id<2>) + 4 * sizeof(size_t); } diff --git a/sycl/unittests/SYCL2020/IsCompatible.cpp b/sycl/unittests/SYCL2020/IsCompatible.cpp index 19a4d738af4f5..14214e0101b13 100644 --- a/sycl/unittests/SYCL2020/IsCompatible.cpp +++ b/sycl/unittests/SYCL2020/IsCompatible.cpp @@ -1,5 +1,6 @@ #include +#include #include #include @@ -16,141 +17,51 @@ class TestKernelACC; namespace sycl { __SYCL_INLINE_VER_NAMESPACE(_V1) { namespace detail { -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "TestKernelCPU"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; -} // namespace detail -} // __SYCL_INLINE_VER_NAMESPACE(_V1) -} // namespace sycl - -namespace sycl { -__SYCL_INLINE_VER_NAMESPACE(_V1) { -namespace detail { -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; +template <> +struct KernelInfo + : public unittest::MockKernelInfoBase { + static constexpr const char *getName() { + return "TestKernelCPUInvalidReqdWGSize1D"; } - static constexpr const char *getName() { return "TestKernelCPUInvalidReqdWGSize1D"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; -} // namespace detail -} // __SYCL_INLINE_VER_NAMESPACE(_V1) -} // namespace sycl - -namespace sycl { -__SYCL_INLINE_VER_NAMESPACE(_V1) { -namespace detail { -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; +template <> +struct KernelInfo + : public unittest::MockKernelInfoBase { + static constexpr const char *getName() { + return "TestKernelCPUInvalidReqdWGSize2D"; } - static constexpr const char *getName() { return "TestKernelCPUInvalidReqdWGSize2D"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; -} // namespace detail -} // __SYCL_INLINE_VER_NAMESPACE(_V1) -} // namespace sycl - -namespace sycl { -__SYCL_INLINE_VER_NAMESPACE(_V1) { -namespace detail { -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo + : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "TestKernelCPUInvalidReqdWGSize3D"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; -} // namespace detail -} // __SYCL_INLINE_VER_NAMESPACE(_V1) -} // namespace sycl - -namespace sycl { -__SYCL_INLINE_VER_NAMESPACE(_V1) { -namespace detail { -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo + : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "TestKernelCPUValidReqdWGSize3D"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; -} // namespace detail -} // __SYCL_INLINE_VER_NAMESPACE(_V1) -} // namespace sycl - -namespace sycl { -__SYCL_INLINE_VER_NAMESPACE(_V1) { -namespace detail { -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "TestKernelGPU"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; -} // namespace detail -} // __SYCL_INLINE_VER_NAMESPACE(_V1) -} // namespace sycl - -namespace sycl { -__SYCL_INLINE_VER_NAMESPACE(_V1) { -namespace detail { -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "TestKernelACC"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; } // namespace detail diff --git a/sycl/unittests/SYCL2020/KernelBundle.cpp b/sycl/unittests/SYCL2020/KernelBundle.cpp index 28755557ba5ae..6cf41ac0924bb 100644 --- a/sycl/unittests/SYCL2020/KernelBundle.cpp +++ b/sycl/unittests/SYCL2020/KernelBundle.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -22,43 +23,19 @@ class TestKernelWithAspects; namespace sycl { __SYCL_INLINE_VER_NAMESPACE(_V1) { namespace detail { -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "TestKernel"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "TestKernelExeOnly"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "TestKernelWithAspects"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; } // namespace detail diff --git a/sycl/unittests/SYCL2020/KernelID.cpp b/sycl/unittests/SYCL2020/KernelID.cpp index 3d7ad4a7f107a..75008fdf82e23 100644 --- a/sycl/unittests/SYCL2020/KernelID.cpp +++ b/sycl/unittests/SYCL2020/KernelID.cpp @@ -8,6 +8,7 @@ #include +#include #include #include @@ -21,58 +22,26 @@ class ServiceKernel1; namespace sycl { __SYCL_INLINE_VER_NAMESPACE(_V1) { namespace detail { -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "KernelID_TestKernel1"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "KernelID_TestKernel2"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "KernelID_TestKernel3"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "_ZTSN2cl4sycl6detail23__sycl_service_kernel__14ServiceKernel1"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; } // namespace detail } // __SYCL_INLINE_VER_NAMESPACE(_V1) diff --git a/sycl/unittests/SYCL2020/SpecializationConstant.cpp b/sycl/unittests/SYCL2020/SpecializationConstant.cpp index 8588ae7f9b718..4a2b65435678b 100644 --- a/sycl/unittests/SYCL2020/SpecializationConstant.cpp +++ b/sycl/unittests/SYCL2020/SpecializationConstant.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -22,19 +23,11 @@ const static sycl::specialization_id SpecConst1{42}; namespace sycl { __SYCL_INLINE_VER_NAMESPACE(_V1) { namespace detail { -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "SpecializationConstant_TestKernel"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; template <> const char *get_spec_constant_symbolic_ID() { diff --git a/sycl/unittests/assert/assert.cpp b/sycl/unittests/assert/assert.cpp index 6bdda2e7a144c..3a9482193fbba 100644 --- a/sycl/unittests/assert/assert.cpp +++ b/sycl/unittests/assert/assert.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -42,24 +43,17 @@ class TestKernel; namespace sycl { __SYCL_INLINE_VER_NAMESPACE(_V1) { namespace detail { -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "TestKernel"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; static constexpr const kernel_param_desc_t Signatures[] = { {kernel_param_kind_t::kind_accessor, 4062, 0}}; template <> -struct KernelInfo<::sycl::detail::__sycl_service_kernel__::AssertInfoCopier> { +struct KernelInfo<::sycl::detail::__sycl_service_kernel__::AssertInfoCopier> + : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "_ZTSN2cl4sycl6detail23__sycl_service_kernel__16AssertInfoCopierE"; } @@ -68,9 +62,6 @@ struct KernelInfo<::sycl::detail::__sycl_service_kernel__::AssertInfoCopier> { assert(!Idx); return Signatures[Idx]; } - static constexpr bool isESIMD() { return 0; } - static constexpr bool callsThisItem() { return 0; } - static constexpr bool callsAnyThisFreeFunction() { return 0; } static constexpr int64_t getKernelSize() { // The AssertInfoCopier service kernel lambda captures an accessor. return sizeof(sycl::accessor +#include + namespace sycl { __SYCL_INLINE_VER_NAMESPACE(_V1) { namespace unittest { diff --git a/sycl/unittests/kernel-and-program/KernelBuildOptions.cpp b/sycl/unittests/kernel-and-program/KernelBuildOptions.cpp index f67ffed3f81f1..5ad6a31c3a028 100644 --- a/sycl/unittests/kernel-and-program/KernelBuildOptions.cpp +++ b/sycl/unittests/kernel-and-program/KernelBuildOptions.cpp @@ -11,6 +11,7 @@ #define __SYCL_INTERNAL_API #endif +#include #include #include #include @@ -23,17 +24,10 @@ static std::string BuildOpts; namespace sycl { __SYCL_INLINE_VER_NAMESPACE(_V1) { namespace detail { -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "BuildOptsTestKernel"; } static constexpr bool isESIMD() { return true; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; } // namespace detail diff --git a/sycl/unittests/kernel-and-program/MultipleDevsCache.cpp b/sycl/unittests/kernel-and-program/MultipleDevsCache.cpp index 5f29139f336e0..650328f4a8f09 100644 --- a/sycl/unittests/kernel-and-program/MultipleDevsCache.cpp +++ b/sycl/unittests/kernel-and-program/MultipleDevsCache.cpp @@ -11,6 +11,7 @@ #include "detail/context_impl.hpp" #include "detail/kernel_bundle_impl.hpp" #include "detail/kernel_program_cache.hpp" +#include #include #include @@ -25,19 +26,12 @@ class MultipleDevsCacheTestKernel; namespace sycl { __SYCL_INLINE_VER_NAMESPACE(_V1) { namespace detail { -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo + : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "MultipleDevsCacheTestKernel"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; } // namespace detail diff --git a/sycl/unittests/program_manager/EliminatedArgMask.cpp b/sycl/unittests/program_manager/EliminatedArgMask.cpp index d71902b5f2a40..e5e7f0e0cbee0 100644 --- a/sycl/unittests/program_manager/EliminatedArgMask.cpp +++ b/sycl/unittests/program_manager/EliminatedArgMask.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -26,30 +27,16 @@ constexpr unsigned EAMTestKernelNumArgs = 4; namespace sycl { __SYCL_INLINE_VER_NAMESPACE(_V1) { namespace detail { -template <> struct KernelInfo { +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr unsigned getNumParams() { return EAMTestKernelNumArgs; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } static constexpr const char *getName() { return EAMTestKernelName; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; -template <> struct KernelInfo { +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } static constexpr const char *getName() { return EAMTestKernel2Name; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; } // namespace detail 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 95f2cf4ba5ca3..a1f36996ef019 100644 --- a/sycl/unittests/program_manager/passing_link_and_compile_options.cpp +++ b/sycl/unittests/program_manager/passing_link_and_compile_options.cpp @@ -10,6 +10,7 @@ #include +#include #include #include @@ -32,43 +33,22 @@ constexpr unsigned EAMTestKernelNumArgs3 = 4; namespace sycl { __SYCL_INLINE_VER_NAMESPACE(_V1) { namespace detail { -template <> struct KernelInfo { +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr unsigned getNumParams() { return EAMTestKernelNumArgs1; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } static constexpr const char *getName() { return EAMTestKernelName1; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; -template <> struct KernelInfo { +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr unsigned getNumParams() { return EAMTestKernelNumArgs2; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } static constexpr const char *getName() { return EAMTestKernelName2; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; -template <> struct KernelInfo { +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr unsigned getNumParams() { return EAMTestKernelNumArgs3; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } static constexpr const char *getName() { return EAMTestKernelName3; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; } // namespace detail diff --git a/sycl/unittests/queue/GetProfilingInfo.cpp b/sycl/unittests/queue/GetProfilingInfo.cpp index 3d9293a5a3bf1..c3122ca64aca0 100644 --- a/sycl/unittests/queue/GetProfilingInfo.cpp +++ b/sycl/unittests/queue/GetProfilingInfo.cpp @@ -15,6 +15,7 @@ #include +#include #include #include #include @@ -26,17 +27,9 @@ class InfoTestKernel; namespace sycl { __SYCL_INLINE_VER_NAMESPACE(_V1) { namespace detail { -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "InfoTestKernel"; } - static constexpr bool isESIMD() { return false; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } - static constexpr int64_t getKernelSize() { return 1; } }; } // namespace detail diff --git a/sycl/unittests/scheduler/CommandsWaitForEvents.cpp b/sycl/unittests/scheduler/CommandsWaitForEvents.cpp index 31dfc8118b657..8e0105e992c01 100644 --- a/sycl/unittests/scheduler/CommandsWaitForEvents.cpp +++ b/sycl/unittests/scheduler/CommandsWaitForEvents.cpp @@ -8,6 +8,7 @@ #include "SchedulerTest.hpp" #include "SchedulerTestUtils.hpp" +#include #include #include @@ -85,18 +86,13 @@ class StreamAUXCmdsWait_TestKernel; namespace sycl { __SYCL_INLINE_VER_NAMESPACE(_V1) { namespace detail { -template <> struct KernelInfo { - static constexpr unsigned getNumParams() { return 0; } - static const kernel_param_desc_t &getParamDesc(int) { - static kernel_param_desc_t Dummy; - return Dummy; - } +template <> +struct KernelInfo + : public unittest::MockKernelInfoBase { static constexpr const char *getName() { return "StreamAUXCmdsWait_TestKernel"; } static constexpr bool isESIMD() { return true; } - static constexpr bool callsThisItem() { return false; } - static constexpr bool callsAnyThisFreeFunction() { return false; } static constexpr int64_t getKernelSize() { return sizeof(sycl::stream); } };