Files
compute-runtime/runtime/compiler_interface/binary_cache.h
Katarzyna Cencelewska 3e800d55e6 Add support for dumping cl_cache to specified directory
Change-Id: I782ff17d0d4b17d3d26db543eb7ae222f75ff8a1
2018-11-29 13:59:26 +01:00

34 lines
872 B
C++

/*
* Copyright (C) 2017-2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include <cstdint>
#include <cstring>
#include <string>
#include <mutex>
#include "runtime/utilities/arrayref.h"
namespace OCLRT {
struct HardwareInfo;
class Program;
class BinaryCache {
public:
static const std::string getCachedFileName(const HardwareInfo &hwInfo, ArrayRef<const char> input,
ArrayRef<const char> options, ArrayRef<const char> internalOptions);
BinaryCache();
virtual ~BinaryCache();
virtual bool cacheBinary(const std::string kernelFileHash, const char *pBinary, uint32_t binarySize);
virtual bool loadCachedBinary(const std::string kernelFileHash, Program &program);
protected:
static std::mutex cacheAccessMtx;
std::string clCacheLocation;
};
} // namespace OCLRT