24 inline namespace _V1 {
44 const std::string FileName;
46 static const char LockSuffix[];
52 static bool isLocked(
const std::string &Path) {
100 static void writeBinaryDataToFile(
const std::string &FileName,
101 const std::vector<std::vector<char>> &Data);
106 static std::vector<std::vector<char>>
107 readBinaryDataFromFile(
const std::string &FileName);
114 writeSourceItem(
const std::string &FileName,
const device &Device,
115 const std::vector<const RTDeviceBinaryImage *> &SortedImgs,
117 const std::string &BuildOptionsString);
121 static bool isCacheItemSrcEqual(
122 const std::string &FileName,
const device &Device,
123 const std::vector<const RTDeviceBinaryImage *> &SortedImgs,
124 const SerializedObj &SpecConsts,
const std::string &BuildOptionsString);
128 static bool isEnabled();
131 static std::string getRootDir();
134 static std::string getDeviceIDString(
const device &Device);
138 static bool areImagesCacheable(
139 const std::vector<const RTDeviceBinaryImage *> &SortedImgs);
143 template <ConfigID Config>
144 static unsigned long getNumParam(
unsigned long Default) {
148 return std::stol(Value);
149 }
catch (std::exception
const &) {
151 std::to_string(Default));
157 static constexpr
unsigned long DEFAULT_MIN_DEVICE_IMAGE_SIZE = 0;
160 static constexpr
unsigned long DEFAULT_MAX_DEVICE_IMAGE_SIZE =
168 const std::vector<const RTDeviceBinaryImage *> &SortedImgs,
170 const std::string &BuildOptionsString);
176 static std::vector<std::vector<char>>
178 const std::vector<const RTDeviceBinaryImage *> &Imgs,
180 const std::string &BuildOptionsString);
186 const std::vector<const RTDeviceBinaryImage *> &Imgs,
188 const std::string &BuildOptionsString,
189 const ur_program_handle_t &NativePrg);
192 static void trace(
const std::string &msg) {
195 std::cerr <<
"*** Code caching: " << msg << std::endl;
static bool isLocked(const std::string &Path)
LockCacheItem(const std::string &Path)
static bool isPathPresent(const std::string &Path)
Checks if specified path is present.
static std::string getCacheItemPath(const device &Device, const std::vector< const RTDeviceBinaryImage * > &SortedImgs, const SerializedObj &SpecConsts, const std::string &BuildOptionsString)
static void trace(const std::string &msg)
static std::vector< std::vector< char > > getItemFromDisc(const device &Device, const std::vector< const RTDeviceBinaryImage * > &Imgs, const SerializedObj &SpecConsts, const std::string &BuildOptionsString)
static void putItemToDisc(const device &Device, const std::vector< const RTDeviceBinaryImage * > &Imgs, const SerializedObj &SpecConsts, const std::string &BuildOptionsString, const ur_program_handle_t &NativePrg)
static const char * get()
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
__SYCL_EXTERN_STREAM_ATTRS ostream cerr
Linked to standard error (unbuffered)
std::string getDirName(const char *Path)
std::vector< unsigned char > SerializedObj
C++ utilities for Unified Runtime integration.