DPC++ Runtime
Runtime libraries for oneAPI Data Parallel C++
program_manager.cpp File Reference
#include <CL/sycl/backend_types.hpp>
#include <CL/sycl/context.hpp>
#include <CL/sycl/detail/common.hpp>
#include <CL/sycl/detail/os_util.hpp>
#include <CL/sycl/detail/type_traits.hpp>
#include <CL/sycl/detail/util.hpp>
#include <CL/sycl/device.hpp>
#include <CL/sycl/exception.hpp>
#include <CL/sycl/stl.hpp>
#include <detail/config.hpp>
#include <detail/context_impl.hpp>
#include <detail/device_image_impl.hpp>
#include <detail/device_impl.hpp>
#include <detail/global_handler.hpp>
#include <detail/persistent_device_code_cache.hpp>
#include <detail/program_impl.hpp>
#include <detail/program_manager/program_manager.hpp>
#include <detail/spec_constant_impl.hpp>
#include <sycl/ext/oneapi/experimental/spec_constant.hpp>
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <memory>
#include <mutex>
#include <sstream>
#include <string>
Include dependency graph for program_manager.cpp:

Go to the source code of this file.

Namespaces

 cl
 We provide new interfaces for matrix muliply in this patch:
 
 cl::sycl
 
 cl::sycl::detail
 

Enumerations

enum  cl::sycl::detail::BuildState { cl::sycl::detail::BS_InProgress, cl::sycl::detail::BS_Done, cl::sycl::detail::BS_Failed }
 

Functions

static constexpr char cl::sycl::detail::UseSpvEnv ("SYCL_USE_KERNEL_SPV")
 
static void cl::sycl::detail::enableITTAnnotationsIfNeeded (const RT::PiProgram &Prog, const plugin &Plugin)
 This function enables ITT annotations in SPIR-V module by setting a specialization constant if INTEL_LIBITTNOTIFY64 env variable is set. More...
 
static RT::PiProgram cl::sycl::detail::createBinaryProgram (const ContextImplPtr Context, const device &Device, const unsigned char *Data, size_t DataLen, const std::vector< pi_device_binary_property > Metadata)
 
static RT::PiProgram cl::sycl::detail::createSpirvProgram (const ContextImplPtr Context, const unsigned char *Data, size_t DataLen)
 
template<typename ExceptionT , typename RetT >
RetT * cl::sycl::detail::waitUntilBuilt (KernelProgramCache &Cache, KernelProgramCache::BuildResult< RetT > *BuildResult)
 
template<typename RetT , typename ExceptionT , typename KeyT , typename AcquireFT , typename GetCacheFT , typename BuildFT >
KernelProgramCache::BuildResult< RetT > * cl::sycl::detail::getOrBuild (KernelProgramCache &KPCache, KeyT &&CacheKey, AcquireFT &&Acquire, GetCacheFT &&GetCache, BuildFT &&Build)
 Try to fetch entity (kernel or program) from cache. More...
 
static bool cl::sycl::detail::isDeviceBinaryTypeSupported (const context &C, RT::PiDeviceBinaryType Format)
 
static const charcl::sycl::detail::getFormatStr (RT::PiDeviceBinaryType Format)
 
static void cl::sycl::detail::applyOptionsFromImage (std::string &CompileOpts, std::string &LinkOpts, const RTDeviceBinaryImage &Img)
 
static void cl::sycl::detail::applyOptionsFromEnvironment (std::string &CompileOpts, std::string &LinkOpts)
 
static bool cl::sycl::detail::loadDeviceLib (const ContextImplPtr Context, const char *Name, RT::PiProgram &Prog)
 
static const charcl::sycl::detail::getDeviceLibFilename (DeviceLibExt Extension)
 
static const charcl::sycl::detail::getDeviceLibExtensionStr (DeviceLibExt Extension)
 
static RT::PiProgram cl::sycl::detail::loadDeviceLibFallback (const ContextImplPtr Context, DeviceLibExt Extension, const RT::PiDevice &Device, std::map< std::pair< DeviceLibExt, RT::PiDevice >, RT::PiProgram > &CachedLibPrograms)
 
static bool cl::sycl::detail::isDeviceLibRequired (DeviceLibExt Ext, uint32_t DeviceLibReqMask)
 
static std::vector< RT::PiProgramcl::sycl::detail::getDeviceLibPrograms (const ContextImplPtr Context, const RT::PiDevice &Device, std::map< std::pair< DeviceLibExt, RT::PiDevice >, RT::PiProgram > &CachedLibPrograms, uint32_t DeviceLibReqMask)
 
static ProgramManager::KernelArgMask cl::sycl::detail::createKernelArgMask (const pi::ByteArray &Bytes)
 
static bundle_state cl::sycl::detail::getBinImageState (const RTDeviceBinaryImage *BinImage)
 
static bool cl::sycl::detail::compatibleWithDevice (RTDeviceBinaryImage *BinImage, const device &Dev)
 
void __sycl_register_lib (pi_device_binaries desc)
 Executed as a part of current module's (.exe, .dll) static initialization. More...
 
void __sycl_unregister_lib (pi_device_binaries desc)
 Executed as a part of current module's (.exe, .dll) static de-initialization. More...
 

Variables

static constexpr int cl::sycl::detail::DbgProgMgr = 0
 

Function Documentation

◆ __sycl_register_lib()

void __sycl_register_lib ( pi_device_binaries  desc)

Executed as a part of current module's (.exe, .dll) static initialization.

Registers device executable images with the runtime.

Definition at line 1879 of file program_manager.cpp.

References cl::sycl::detail::ProgramManager::addImages(), and cl::sycl::detail::ProgramManager::getInstance().

◆ __sycl_unregister_lib()

void __sycl_unregister_lib ( pi_device_binaries  desc)

Executed as a part of current module's (.exe, .dll) static de-initialization.

Unregisters device executable images with the runtime.

Definition at line 1884 of file program_manager.cpp.