mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Replace wstring_convert with std::wstring (#9614)
* remove wstring_convert * . * fix indentation
This commit is contained in:
parent
f7774a91d6
commit
a3e4d77b35
1 changed files with 5 additions and 3 deletions
|
|
@ -46,9 +46,11 @@ ThreadPoolProfiler::ThreadPoolProfiler(int num_threads, const CHAR_TYPE* thread_
|
|||
child_thread_stats_.assign(num_threads, {});
|
||||
if (thread_pool_name) {
|
||||
#ifdef _WIN32
|
||||
using convert_type = std::codecvt_utf8<wchar_t>;
|
||||
std::wstring_convert<convert_type, wchar_t> converter;
|
||||
thread_pool_name_ = converter.to_bytes(thread_pool_name);
|
||||
std::wstring ws(thread_pool_name);
|
||||
thread_pool_name_.resize(ws.length());
|
||||
std::transform(ws.begin(), ws.end(), thread_pool_name_.begin(), [] (wchar_t c) {
|
||||
return (char)c;
|
||||
});
|
||||
#else
|
||||
thread_pool_name_ = thread_pool_name;
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue