|
1 | 1 | /*******************************************************************************
|
2 |
| - * Copyright 2023 Intel Corporation |
| 2 | + * Copyright 2023-2024 Intel Corporation |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
17 | 17 | #ifndef GRAPH_BACKEND_GRAPH_COMPILER_CORE_SRC_RUNTIME_LOW_LEVEL_THREADPOOL_WRAPPER_HPP
|
18 | 18 | #define GRAPH_BACKEND_GRAPH_COMPILER_CORE_SRC_RUNTIME_LOW_LEVEL_THREADPOOL_WRAPPER_HPP
|
19 | 19 |
|
20 |
| -#include <exception> |
| 20 | +#include <stdexcept> |
21 | 21 | #include "thread_locals.hpp"
|
22 | 22 | #include <runtime/config.hpp>
|
23 | 23 | #include <util/compiler_macros.hpp>
|
@@ -58,7 +58,10 @@ void call_threadpool(TSched *ths, main_func_t f, runtime::stream_t *stream,
|
58 | 58 | ths = T::all_thread_prepare(ths, stream, threads);
|
59 | 59 | if (threads > 1 || !T::can_optimize_single_thread) {
|
60 | 60 | 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 |
62 | 65 | #if SC_CPU_THREADPOOL == SC_THREAD_POOL_OMP
|
63 | 66 | SC_NO_OP();
|
64 | 67 | #pragma omp parallel for
|
@@ -91,9 +94,6 @@ void call_threadpool(TSched *ths, main_func_t f, runtime::stream_t *stream,
|
91 | 94 | });
|
92 | 95 | #endif
|
93 | 96 | 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 |
97 | 97 | } else {
|
98 | 98 | T::single_thread(ths, f, stream, mod_data, args);
|
99 | 99 | }
|
|
0 commit comments