Skip to content

Commit 8cd02e0

Browse files
authored
use multiple threads in reco example (#53)
* use multiple threads in reco example * fix typos
1 parent e3fb949 commit 8cd02e0

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

examples/alien_reco.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ subtool::Task<DeviceBuffer<int>> seeding(DeviceBuffer<int> clusters,
124124

125125
log(self) << "Found " << nSeeds << " seeds" << std::endl;
126126

127-
// Allocate clusters of appropiate size on device
127+
// Allocate seeds of appropiate size on device
128128
int* d_seeds = nullptr;
129129
ERROR_CHECK_CUDA(cudaMallocAsync(reinterpret_cast<void**>(&d_seeds),
130130
nSeeds * sizeof(int), stream));
131131

132-
// Write some dummy data to the clusters buffer to simulate work
132+
// Write some dummy data to the seeds buffer to simulate work
133133
ERROR_CHECK_CUDA(cudaMemsetAsync(d_seeds, 0, nSeeds * sizeof(int), stream));
134134
ERROR_CHECK_CUDA(
135135
cudaMemsetAsync(d_seeds, 1, nSeeds / 2 * sizeof(int), stream));
@@ -182,7 +182,7 @@ int main() {
182182

183183
log() << "main Starting" << std::endl;
184184

185-
tbb::task_arena task_arena{2};
185+
tbb::task_arena task_arena{2, 0};
186186

187187
auto scheduler = [&task_arena](std::coroutine_handle<> handle) {
188188
task_arena.enqueue([handle]() { handle.resume(); });

examples/capy_reco.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ boost::capy::task<DeviceBuffer<int>> seeding(DeviceBuffer<int> clusters,
101101

102102
log(self) << "Found " << nSeeds << " seeds" << std::endl;
103103

104-
// Allocate clusters of appropiate size on device
104+
// Allocate seeds of appropiate size on device
105105
int* d_seeds = nullptr;
106106
ERROR_CHECK_CUDA(cudaMallocAsync(reinterpret_cast<void**>(&d_seeds),
107107
nSeeds * sizeof(int), stream));
108108

109-
// Write some dummy data to the clusters buffer to simulate work
109+
// Write some dummy data to the seeds buffer to simulate work
110110
ERROR_CHECK_CUDA(cudaMemsetAsync(d_seeds, 0, nSeeds * sizeof(int), stream));
111111
ERROR_CHECK_CUDA(
112112
cudaMemsetAsync(d_seeds, 1, nSeeds / 2 * sizeof(int), stream));
@@ -159,7 +159,7 @@ int main() {
159159

160160
log() << "main Starting" << std::endl;
161161

162-
auto task_arena = tbb::task_arena{2};
162+
auto task_arena = tbb::task_arena{2, 0};
163163
auto context = TaskArenaContext(task_arena);
164164
auto executor = TaskArenaExecutor(context);
165165

examples/exec_reco.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ exec::task<DeviceBuffer<int>> seeding(DeviceBuffer<int> clusters,
100100

101101
log(self) << "Found " << nSeeds << " seeds" << std::endl;
102102

103-
// Allocate clusters of appropiate size on device
103+
// Allocate seeds of appropiate size on device
104104
int* d_seeds = nullptr;
105105
ERROR_CHECK_CUDA(cudaMallocAsync(reinterpret_cast<void**>(&d_seeds),
106106
nSeeds * sizeof(int), stream));
107107

108-
// Write some dummy data to the clusters buffer to simulate work
108+
// Write some dummy data to the seeds buffer to simulate work
109109
ERROR_CHECK_CUDA(cudaMemsetAsync(d_seeds, 0, nSeeds * sizeof(int), stream));
110110
ERROR_CHECK_CUDA(
111111
cudaMemsetAsync(d_seeds, 1, nSeeds / 2 * sizeof(int), stream));
@@ -158,7 +158,7 @@ int main() {
158158

159159
log() << "main Starting" << std::endl;
160160

161-
tbb::task_arena task_arena{2};
161+
tbb::task_arena task_arena{2, 0};
162162
execution::scheduler auto scheduler = get_scheduler(task_arena, false);
163163

164164
{

0 commit comments

Comments
 (0)