Skip to content

Commit e2130b1

Browse files
authored
[SYCL][NFC] Remove idle flag (#1157)
Signed-off-by: Sergey Kanaev <[email protected]>
1 parent 85d7a5e commit e2130b1

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

sycl/source/detail/kernel_program_cache.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ class KernelProgramCache {
3131
std::string Msg;
3232
pi_int32 Code;
3333

34-
/// Equals to true if the Msg and Code are initialized. This flag is added
35-
/// due to the possibility of error code being equal to zero even in case
36-
/// if build is failed and cl::sycl::exception is thrown.
37-
bool FilledIn;
34+
bool isFilledIn() const {
35+
return !Msg.empty();
36+
}
3837
};
3938

4039
/// Denotes pointer to some entity with its general state and build error.
@@ -46,7 +45,7 @@ class KernelProgramCache {
4645
std::atomic<int> State;
4746
BuildError Error;
4847

49-
BuildResult(T* P, int S) : Ptr{P}, State{S}, Error{"", 0, false} {}
48+
BuildResult(T* P, int S) : Ptr{P}, State{S}, Error{"", 0} {}
5049
};
5150

5251
using PiProgramT = std::remove_pointer<RT::PiProgram>::type;

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ RetT *waitUntilBuilt(KernelProgramCache &Cache,
151151
return State == BS_Done || State == BS_Failed;
152152
});
153153

154-
if (BuildResult->Error.FilledIn) {
154+
if (BuildResult->Error.isFilledIn()) {
155155
const KernelProgramCache::BuildError &Error = BuildResult->Error;
156156
throw ExceptionT(Error.Msg, Error.Code);
157157
}
@@ -237,7 +237,6 @@ RetT *getOrBuild(KernelProgramCache &KPCache, const KeyT &CacheKey,
237237
} catch (const exception &Ex) {
238238
BuildResult->Error.Msg = Ex.what();
239239
BuildResult->Error.Code = Ex.get_cl_code();
240-
BuildResult->Error.FilledIn = true;
241240

242241
BuildResult->State.store(BS_Failed);
243242

0 commit comments

Comments
 (0)