Skip to content

Commit 31d8f6e

Browse files
Mei, YijieZhennanQin
Mei, Yijie
authored andcommitted
graph: compiler: build: fix SEQ build
1 parent 51b8d37 commit 31d8f6e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/graph/backend/graph_compiler/core/src/runtime/low_level_threadpool_wrapper.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright 2023 Intel Corporation
2+
* Copyright 2023-2024 Intel Corporation
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
1717
#ifndef GRAPH_BACKEND_GRAPH_COMPILER_CORE_SRC_RUNTIME_LOW_LEVEL_THREADPOOL_WRAPPER_HPP
1818
#define GRAPH_BACKEND_GRAPH_COMPILER_CORE_SRC_RUNTIME_LOW_LEVEL_THREADPOOL_WRAPPER_HPP
1919

20-
#include <exception>
20+
#include <stdexcept>
2121
#include "thread_locals.hpp"
2222
#include <runtime/config.hpp>
2323
#include <util/compiler_macros.hpp>
@@ -58,7 +58,10 @@ void call_threadpool(TSched *ths, main_func_t f, runtime::stream_t *stream,
5858
ths = T::all_thread_prepare(ths, stream, threads);
5959
if (threads > 1 || !T::can_optimize_single_thread) {
6060
typename T::TyState rtl_state {T::before_parallel(ths)};
61-
61+
#if SC_CPU_THREADPOOL == SC_THREAD_POOL_SEQ
62+
int64_t i = 0; // make compiler happy
63+
throw std::runtime_error("Running SEQ in thread pool");
64+
#endif
6265
#if SC_CPU_THREADPOOL == SC_THREAD_POOL_OMP
6366
SC_NO_OP();
6467
#pragma omp parallel for
@@ -91,9 +94,6 @@ void call_threadpool(TSched *ths, main_func_t f, runtime::stream_t *stream,
9194
});
9295
#endif
9396
T::after_parallel(ths);
94-
#if SC_CPU_THREADPOOL == SC_THREAD_POOL_SEQ
95-
throw std::runtime_error("Running SEQ in thread pool");
96-
#endif
9797
} else {
9898
T::single_thread(ths, f, stream, mod_data, args);
9999
}

0 commit comments

Comments
 (0)