Skip to content

Commit ee4fe59

Browse files
romanovvladvladimirlaz
authored andcommitted
[SYCL] Moved Scheduler::getInstance method to library to make it unique across TUs.
Signed-off-by: Romanov, Vlad <[email protected]> Signed-off-by: Vladimir Lazarev <[email protected]>
1 parent 7e65688 commit ee4fe59

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

sycl/include/CL/sycl/detail/scheduler/scheduler.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,7 @@ class Scheduler {
190190
//
191191
void parallelReadOpt();
192192

193-
static Scheduler &getInstance() {
194-
static Scheduler instance;
195-
return instance;
196-
}
193+
static Scheduler &getInstance();
197194

198195
enum DumpOptions { Text = 0, WholeGraph = 1, RunGraph = 2 };
199196
bool getDumpFlagValue(DumpOptions DumpOption);

sycl/source/detail/scheduler/scheduler.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ void Scheduler::printGraphForCommand(CommandPtr Cmd,
183183
Cmd->printDot(Stream);
184184
}
185185

186+
Scheduler &Scheduler::getInstance() {
187+
static Scheduler Instance;
188+
return Instance;
189+
}
190+
186191
} // namespace simple_scheduler
187192
} // namespace sycl
188193
} // namespace cl

0 commit comments

Comments
 (0)