Previously std::once_flag was assigned per map:
std::unordered_map<ContextId, std::unique_ptr<SipKernel>> which was
incorrect and caused the situation in which SipKernel is allocated only
on 1 context and was skipped for other contexts, so we ended up with
only one allocation regardless of the number of contexts.
This change assigns std::once_flag for each allocated SipKernel.
Related-To: NEO-7630
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
Observed about 50MB reduction in overall binaries size (directory build))
when building all targets
with MSVC (Visual Studio 2022 17.3.0 preview 6)
using Debug 64 configuration.
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
When header is included for the first time in translation unit,
then preprocessor simply copy-pastes its content. If we define a
constant in a header file and this constant has internal linkage
then each and every translation unit, which includes this header
will have its own copy of this constant.
C++17 introduces inline variables, which are meant to allow creation
of variables in header files, which do not cause multiple instances.
The inline variable has a single instance when:
- constexpr is used without static (constexpr implicitly implies inline)
- inline is used without static
- inline const is used without static (const does not imply internal linkage
when used with inline)
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
Dates corrected in copyright headers to reflect original publication date
(2018 for OpenCL, 2020 for Level Zero).
Signed-off-by: lgotszal <lukasz.gotszald@intel.com>
create program for all provided devices
move OCL specific code from shared to opencl
Related-To: NEO-5001
Change-Id: Ic352b4e907ae75426634ae4b3c7048edecaf83e7
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>