Skip to content

Commit 45e11a5

Browse files
authored
[bugfix]add init device (#511)
add init device
1 parent b5ebca1 commit 45e11a5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

ucm/store/pcstore/cc/domain/trans/trans_queue.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,14 @@ Status TransQueue::Setup(const int32_t deviceId, const size_t streamNumber, cons
105105
UC_ERROR("Failed({}) to make host buffer({},{}).", ts.ToString(), blockSize, bufferNumber);
106106
return Status::Error();
107107
}
108-
auto success =
109-
this->devPool_.SetWorkerFn([this](auto t, auto) { this->DeviceWorker(std::move(t)); })
110-
.Run();
108+
auto success = this->devPool_
109+
.SetWorkerInitFn([deviceId](auto&) {
110+
Trans::Device device;
111+
auto ts = device.Setup(deviceId);
112+
return ts.Success();
113+
})
114+
.SetWorkerFn([this](auto t, auto) { this->DeviceWorker(std::move(t)); })
115+
.Run();
111116
if (!success) { return Status::Error(); }
112117
success = this->filePool_.SetWorkerFn([this](auto t, auto) { this->FileWorker(std::move(t)); })
113118
.SetNWorker(streamNumber)

0 commit comments

Comments
 (0)