Skip to content

Commit 5ab089b

Browse files
committed
use all local IDs
1 parent 052e3d4 commit 5ab089b

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

  • samples/benchmarks/00_apibenchmark

samples/benchmarks/00_apibenchmark/main.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,20 @@ struct Kernel : public benchmark::Fixture
227227
virtual void SetUp(benchmark::State& state) override {
228228
queue = env.ioq;
229229

230-
static const char kernelString[] = R"CLC( kernel void Empty(int a) {} )CLC";
230+
static const char kernelString[] = R"CLC(
231+
kernel void Silly(global int* dst) {
232+
size_t sum = get_local_id(0) + get_local_id(1) + get_local_id(2);
233+
if (sum > 99999) {
234+
dst[0] = 0;
235+
}
236+
} )CLC";
231237

232238
program = cl::Program{env.context, kernelString};
233239

234240
program.build();
235-
kernel = cl::Kernel{program, "Empty"};
241+
kernel = cl::Kernel{program, "Silly"};
236242

237-
kernel.setArg(0, 0);
243+
kernel.setArg(0, nullptr);
238244
}
239245
virtual void TearDown(benchmark::State& state) override {
240246
program = NULL;
@@ -393,7 +399,7 @@ BENCHMARK_DEFINE_F(Kernel, clEnqueueNDRangeKernel_overhead)(benchmark::State& st
393399
clFinish(queue());
394400
}
395401
}
396-
BENCHMARK_REGISTER_F(Kernel, clEnqueueNDRangeKernel_overhead)->ArgsProduct({{0, 1}, {1, 1024, 32*1024*1024}});
402+
BENCHMARK_REGISTER_F(Kernel, clEnqueueNDRangeKernel_overhead)->ArgsProduct({{0, 1}, {1, 32*1024*1024}});
397403

398404
struct SVMKernel : public benchmark::Fixture
399405
{

0 commit comments

Comments
 (0)