Skip to content

Commit

Permalink
Merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jchlanda committed Jul 11, 2024
1 parent bb1e3f9 commit 93b07a7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class SYCLSpecConstDataInserter
public:
SYCLSpecConstDataInserter(const unsigned char *SpecConstData,
size_t SpecConstDataSize)
: SpecConstData(SpecConstData), SpecConstDataSize(SpecConstDataSize){};
: SpecConstData(SpecConstData), SpecConstDataSize(SpecConstDataSize) {};

SYCLSpecConstDataInserter() {
SpecConstDataSize = 255;
Expand Down
27 changes: 13 additions & 14 deletions sycl/source/detail/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,11 +590,14 @@ template <> class SYCLConfig<SYCL_CACHE_IN_MEM> {
using BaseT = SYCLConfigBase<SYCL_CACHE_IN_MEM>;

public:
static bool get() {
constexpr bool DefaultValue = true;

const char *ValStr = getCachedValue();
static constexpr bool Default = true; // default is true
static bool get() { return getCachedValue(); }
static const char *getName() { return BaseT::MConfigName; }
static void reset() { (void)getCachedValue(/*ResetCache=*/true); }

private:
static bool parseValue() {
const char *ValStr = BaseT::getRawValue();
if (!ValStr)
return Default;
if (strlen(ValStr) != 1 || (ValStr[0] != '0' && ValStr[0] != '1')) {
Expand All @@ -606,16 +609,12 @@ template <> class SYCLConfig<SYCL_CACHE_IN_MEM> {
return ValStr[0] == '1';
}

static void reset() { (void)getCachedValue(/*ResetCache=*/true); }

static const char *getName() { return BaseT::MConfigName; }

private:
static const char *getCachedValue(bool ResetCache = false) {
static const char *ValStr = BaseT::getRawValue();
if (ResetCache)
ValStr = BaseT::getRawValue();
return ValStr;
static bool getCachedValue(bool ResetCache = false) {
static bool Val = parseValue();
if (ResetCache) {
Val = BaseT::getRawValue();
}
return Val;
}
};

Expand Down
5 changes: 4 additions & 1 deletion sycl/source/detail/program_manager/program_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2567,10 +2567,13 @@ sycl::detail::pi::PiKernel ProgramManager::getOrCreateMaterializedKernel(
std::string CompileOpts;
std::string LinkOpts;
applyOptionsFromEnvironment(CompileOpts, LinkOpts);
// No linking of extra programs reqruired.
std::vector<sycl::detail::pi::PiProgram> ExtraProgramsToLink;
auto BuildProgram =
build(std::move(ProgramManaged), detail::getSyclObjImpl(Context),
CompileOpts, LinkOpts, DeviceImpl->getHandleRef(),
/*For non SPIR-V devices DeviceLibReqdMask is always 0*/ 0);
/*For non SPIR-V devices DeviceLibReqdMask is always 0*/ 0,
ExtraProgramsToLink);
sycl::detail::pi::PiKernel PiKernel{nullptr};
Plugin->call<errc::kernel_not_supported, PiApiKind::piKernelCreate>(
BuildProgram.get(), KernelName.c_str(), &PiKernel);
Expand Down

0 comments on commit 93b07a7

Please sign in to comment.