1 package org.apache.commons.rng.examples.jmh.sampling.shape.jmh_generated;
2
3 import java.util.List;
4 import java.util.concurrent.atomic.AtomicInteger;
5 import java.util.Collection;
6 import java.util.ArrayList;
7 import java.util.concurrent.TimeUnit;
8 import org.openjdk.jmh.annotations.CompilerControl;
9 import org.openjdk.jmh.runner.InfraControl;
10 import org.openjdk.jmh.infra.ThreadParams;
11 import org.openjdk.jmh.results.BenchmarkTaskResult;
12 import org.openjdk.jmh.results.Result;
13 import org.openjdk.jmh.results.ThroughputResult;
14 import org.openjdk.jmh.results.AverageTimeResult;
15 import org.openjdk.jmh.results.SampleTimeResult;
16 import org.openjdk.jmh.results.SingleShotResult;
17 import org.openjdk.jmh.util.SampleBuffer;
18 import org.openjdk.jmh.annotations.Mode;
19 import org.openjdk.jmh.annotations.Fork;
20 import org.openjdk.jmh.annotations.Measurement;
21 import org.openjdk.jmh.annotations.Threads;
22 import org.openjdk.jmh.annotations.Warmup;
23 import org.openjdk.jmh.annotations.BenchmarkMode;
24 import org.openjdk.jmh.results.RawResults;
25 import org.openjdk.jmh.results.ResultRole;
26 import java.lang.reflect.Field;
27 import org.openjdk.jmh.infra.BenchmarkParams;
28 import org.openjdk.jmh.infra.IterationParams;
29 import org.openjdk.jmh.infra.Blackhole;
30 import org.openjdk.jmh.infra.Control;
31 import org.openjdk.jmh.results.ScalarResult;
32 import org.openjdk.jmh.results.AggregationPolicy;
33 import org.openjdk.jmh.runner.FailureAssistException;
34
35 import org.apache.commons.rng.examples.jmh.sampling.shape.jmh_generated.TriangleSamplerBenchmark_Sampler3D_jmhType;
36 import org.apache.commons.rng.examples.jmh.sampling.shape.jmh_generated.TriangleSamplerBenchmark_jmhType;
37 public final class TriangleSamplerBenchmark_create3D_jmhTest {
38
39 byte p000, p001, p002, p003, p004, p005, p006, p007, p008, p009, p010, p011, p012, p013, p014, p015;
40 byte p016, p017, p018, p019, p020, p021, p022, p023, p024, p025, p026, p027, p028, p029, p030, p031;
41 byte p032, p033, p034, p035, p036, p037, p038, p039, p040, p041, p042, p043, p044, p045, p046, p047;
42 byte p048, p049, p050, p051, p052, p053, p054, p055, p056, p057, p058, p059, p060, p061, p062, p063;
43 byte p064, p065, p066, p067, p068, p069, p070, p071, p072, p073, p074, p075, p076, p077, p078, p079;
44 byte p080, p081, p082, p083, p084, p085, p086, p087, p088, p089, p090, p091, p092, p093, p094, p095;
45 byte p096, p097, p098, p099, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111;
46 byte p112, p113, p114, p115, p116, p117, p118, p119, p120, p121, p122, p123, p124, p125, p126, p127;
47 byte p128, p129, p130, p131, p132, p133, p134, p135, p136, p137, p138, p139, p140, p141, p142, p143;
48 byte p144, p145, p146, p147, p148, p149, p150, p151, p152, p153, p154, p155, p156, p157, p158, p159;
49 byte p160, p161, p162, p163, p164, p165, p166, p167, p168, p169, p170, p171, p172, p173, p174, p175;
50 byte p176, p177, p178, p179, p180, p181, p182, p183, p184, p185, p186, p187, p188, p189, p190, p191;
51 byte p192, p193, p194, p195, p196, p197, p198, p199, p200, p201, p202, p203, p204, p205, p206, p207;
52 byte p208, p209, p210, p211, p212, p213, p214, p215, p216, p217, p218, p219, p220, p221, p222, p223;
53 byte p224, p225, p226, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239;
54 byte p240, p241, p242, p243, p244, p245, p246, p247, p248, p249, p250, p251, p252, p253, p254, p255;
55 int startRndMask;
56 BenchmarkParams benchmarkParams;
57 IterationParams iterationParams;
58 ThreadParams threadParams;
59 Blackhole blackhole;
60 Control notifyControl;
61
62 public BenchmarkTaskResult create3D_Throughput(InfraControl control, ThreadParams threadParams) throws Throwable {
63 this.benchmarkParams = control.benchmarkParams;
64 this.iterationParams = control.iterationParams;
65 this.threadParams = threadParams;
66 this.notifyControl = control.notifyControl;
67 if (this.blackhole == null) {
68 this.blackhole = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous.");
69 }
70 if (threadParams.getSubgroupIndex() == 0) {
71 RawResults res = new RawResults();
72 TriangleSamplerBenchmark_jmhType l_trianglesamplerbenchmark0_G = _jmh_tryInit_f_trianglesamplerbenchmark0_G(control);
73 TriangleSamplerBenchmark_Sampler3D_jmhType l_sampler3d1_G = _jmh_tryInit_f_sampler3d1_G(control);
74
75 control.preSetup();
76 if (TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.compareAndSet(l_sampler3d1_G, 0, 1)) {
77 try {
78 if (control.isFailing) throw new FailureAssistException();
79 if (!l_sampler3d1_G.readyIteration) {
80 l_sampler3d1_G.setup();
81 l_sampler3d1_G.readyIteration = true;
82 }
83 } catch (Throwable t) {
84 control.isFailing = true;
85 throw t;
86 } finally {
87 TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.set(l_sampler3d1_G, 0);
88 }
89 } else {
90 while (TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.get(l_sampler3d1_G) == 1) {
91 if (control.isFailing) throw new FailureAssistException();
92 if (Thread.interrupted()) throw new InterruptedException();
93 }
94 }
95
96
97 control.announceWarmupReady();
98 while (control.warmupShouldWait) {
99 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
100 res.allOps++;
101 }
102
103 notifyControl.startMeasurement = true;
104 create3D_thrpt_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, l_sampler3d1_G, l_trianglesamplerbenchmark0_G);
105 notifyControl.stopMeasurement = true;
106 control.announceWarmdownReady();
107 try {
108 while (control.warmdownShouldWait) {
109 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
110 res.allOps++;
111 }
112 } catch (Throwable e) {
113 if (!(e instanceof InterruptedException)) throw e;
114 }
115 control.preTearDown();
116 if (TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.compareAndSet(l_sampler3d1_G, 0, 1)) {
117 try {
118 if (control.isFailing) throw new FailureAssistException();
119 if (l_sampler3d1_G.readyIteration) {
120 l_sampler3d1_G.readyIteration = false;
121 }
122 } catch (Throwable t) {
123 control.isFailing = true;
124 throw t;
125 } finally {
126 TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.set(l_sampler3d1_G, 0);
127 }
128 } else {
129 while (TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.get(l_sampler3d1_G) == 1) {
130 if (control.isFailing) throw new FailureAssistException();
131 if (Thread.interrupted()) throw new InterruptedException();
132 }
133 }
134
135 if (control.isLastIteration()) {
136 synchronized(this.getClass()) {
137 f_sampler3d1_G = null;
138 }
139 synchronized(this.getClass()) {
140 f_trianglesamplerbenchmark0_G = null;
141 }
142 }
143 res.allOps += res.measuredOps;
144 int batchSize = iterationParams.getBatchSize();
145 int opsPerInv = benchmarkParams.getOpsPerInvocation();
146 res.allOps *= opsPerInv;
147 res.allOps /= batchSize;
148 res.measuredOps *= opsPerInv;
149 res.measuredOps /= batchSize;
150 BenchmarkTaskResult results = new BenchmarkTaskResult((long)res.allOps, (long)res.measuredOps);
151 results.add(new ThroughputResult(ResultRole.PRIMARY, "create3D", res.measuredOps, res.getTime(), benchmarkParams.getTimeUnit()));
152 this.blackhole.evaporate("Yes, I am Stephen Hawking, and know a thing or two about black holes.");
153 return results;
154 } else
155 throw new IllegalStateException("Harness failed to distribute threads among groups properly");
156 }
157
158 public static void create3D_thrpt_jmhStub(InfraControl control, RawResults result, BenchmarkParams benchmarkParams, IterationParams iterationParams, ThreadParams threadParams, Blackhole blackhole, Control notifyControl, int startRndMask, TriangleSamplerBenchmark_Sampler3D_jmhType l_sampler3d1_G, TriangleSamplerBenchmark_jmhType l_trianglesamplerbenchmark0_G) throws Throwable {
159 long operations = 0;
160 long realTime = 0;
161 result.startTime = System.nanoTime();
162 do {
163 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
164 operations++;
165 } while(!control.isDone);
166 result.stopTime = System.nanoTime();
167 result.realTime = realTime;
168 result.measuredOps = operations;
169 }
170
171
172 public BenchmarkTaskResult create3D_AverageTime(InfraControl control, ThreadParams threadParams) throws Throwable {
173 this.benchmarkParams = control.benchmarkParams;
174 this.iterationParams = control.iterationParams;
175 this.threadParams = threadParams;
176 this.notifyControl = control.notifyControl;
177 if (this.blackhole == null) {
178 this.blackhole = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous.");
179 }
180 if (threadParams.getSubgroupIndex() == 0) {
181 RawResults res = new RawResults();
182 TriangleSamplerBenchmark_jmhType l_trianglesamplerbenchmark0_G = _jmh_tryInit_f_trianglesamplerbenchmark0_G(control);
183 TriangleSamplerBenchmark_Sampler3D_jmhType l_sampler3d1_G = _jmh_tryInit_f_sampler3d1_G(control);
184
185 control.preSetup();
186 if (TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.compareAndSet(l_sampler3d1_G, 0, 1)) {
187 try {
188 if (control.isFailing) throw new FailureAssistException();
189 if (!l_sampler3d1_G.readyIteration) {
190 l_sampler3d1_G.setup();
191 l_sampler3d1_G.readyIteration = true;
192 }
193 } catch (Throwable t) {
194 control.isFailing = true;
195 throw t;
196 } finally {
197 TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.set(l_sampler3d1_G, 0);
198 }
199 } else {
200 while (TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.get(l_sampler3d1_G) == 1) {
201 if (control.isFailing) throw new FailureAssistException();
202 if (Thread.interrupted()) throw new InterruptedException();
203 }
204 }
205
206
207 control.announceWarmupReady();
208 while (control.warmupShouldWait) {
209 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
210 res.allOps++;
211 }
212
213 notifyControl.startMeasurement = true;
214 create3D_avgt_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, l_sampler3d1_G, l_trianglesamplerbenchmark0_G);
215 notifyControl.stopMeasurement = true;
216 control.announceWarmdownReady();
217 try {
218 while (control.warmdownShouldWait) {
219 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
220 res.allOps++;
221 }
222 } catch (Throwable e) {
223 if (!(e instanceof InterruptedException)) throw e;
224 }
225 control.preTearDown();
226 if (TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.compareAndSet(l_sampler3d1_G, 0, 1)) {
227 try {
228 if (control.isFailing) throw new FailureAssistException();
229 if (l_sampler3d1_G.readyIteration) {
230 l_sampler3d1_G.readyIteration = false;
231 }
232 } catch (Throwable t) {
233 control.isFailing = true;
234 throw t;
235 } finally {
236 TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.set(l_sampler3d1_G, 0);
237 }
238 } else {
239 while (TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.get(l_sampler3d1_G) == 1) {
240 if (control.isFailing) throw new FailureAssistException();
241 if (Thread.interrupted()) throw new InterruptedException();
242 }
243 }
244
245 if (control.isLastIteration()) {
246 synchronized(this.getClass()) {
247 f_sampler3d1_G = null;
248 }
249 synchronized(this.getClass()) {
250 f_trianglesamplerbenchmark0_G = null;
251 }
252 }
253 res.allOps += res.measuredOps;
254 int batchSize = iterationParams.getBatchSize();
255 int opsPerInv = benchmarkParams.getOpsPerInvocation();
256 res.allOps *= opsPerInv;
257 res.allOps /= batchSize;
258 res.measuredOps *= opsPerInv;
259 res.measuredOps /= batchSize;
260 BenchmarkTaskResult results = new BenchmarkTaskResult((long)res.allOps, (long)res.measuredOps);
261 results.add(new AverageTimeResult(ResultRole.PRIMARY, "create3D", res.measuredOps, res.getTime(), benchmarkParams.getTimeUnit()));
262 this.blackhole.evaporate("Yes, I am Stephen Hawking, and know a thing or two about black holes.");
263 return results;
264 } else
265 throw new IllegalStateException("Harness failed to distribute threads among groups properly");
266 }
267
268 public static void create3D_avgt_jmhStub(InfraControl control, RawResults result, BenchmarkParams benchmarkParams, IterationParams iterationParams, ThreadParams threadParams, Blackhole blackhole, Control notifyControl, int startRndMask, TriangleSamplerBenchmark_Sampler3D_jmhType l_sampler3d1_G, TriangleSamplerBenchmark_jmhType l_trianglesamplerbenchmark0_G) throws Throwable {
269 long operations = 0;
270 long realTime = 0;
271 result.startTime = System.nanoTime();
272 do {
273 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
274 operations++;
275 } while(!control.isDone);
276 result.stopTime = System.nanoTime();
277 result.realTime = realTime;
278 result.measuredOps = operations;
279 }
280
281
282 public BenchmarkTaskResult create3D_SampleTime(InfraControl control, ThreadParams threadParams) throws Throwable {
283 this.benchmarkParams = control.benchmarkParams;
284 this.iterationParams = control.iterationParams;
285 this.threadParams = threadParams;
286 this.notifyControl = control.notifyControl;
287 if (this.blackhole == null) {
288 this.blackhole = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous.");
289 }
290 if (threadParams.getSubgroupIndex() == 0) {
291 RawResults res = new RawResults();
292 TriangleSamplerBenchmark_jmhType l_trianglesamplerbenchmark0_G = _jmh_tryInit_f_trianglesamplerbenchmark0_G(control);
293 TriangleSamplerBenchmark_Sampler3D_jmhType l_sampler3d1_G = _jmh_tryInit_f_sampler3d1_G(control);
294
295 control.preSetup();
296 if (TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.compareAndSet(l_sampler3d1_G, 0, 1)) {
297 try {
298 if (control.isFailing) throw new FailureAssistException();
299 if (!l_sampler3d1_G.readyIteration) {
300 l_sampler3d1_G.setup();
301 l_sampler3d1_G.readyIteration = true;
302 }
303 } catch (Throwable t) {
304 control.isFailing = true;
305 throw t;
306 } finally {
307 TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.set(l_sampler3d1_G, 0);
308 }
309 } else {
310 while (TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.get(l_sampler3d1_G) == 1) {
311 if (control.isFailing) throw new FailureAssistException();
312 if (Thread.interrupted()) throw new InterruptedException();
313 }
314 }
315
316
317 control.announceWarmupReady();
318 while (control.warmupShouldWait) {
319 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
320 res.allOps++;
321 }
322
323 notifyControl.startMeasurement = true;
324 int targetSamples = (int) (control.getDuration(TimeUnit.MILLISECONDS) * 20);
325 int batchSize = iterationParams.getBatchSize();
326 int opsPerInv = benchmarkParams.getOpsPerInvocation();
327 SampleBuffer buffer = new SampleBuffer();
328 create3D_sample_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, buffer, targetSamples, opsPerInv, batchSize, l_sampler3d1_G, l_trianglesamplerbenchmark0_G);
329 notifyControl.stopMeasurement = true;
330 control.announceWarmdownReady();
331 try {
332 while (control.warmdownShouldWait) {
333 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
334 res.allOps++;
335 }
336 } catch (Throwable e) {
337 if (!(e instanceof InterruptedException)) throw e;
338 }
339 control.preTearDown();
340 if (TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.compareAndSet(l_sampler3d1_G, 0, 1)) {
341 try {
342 if (control.isFailing) throw new FailureAssistException();
343 if (l_sampler3d1_G.readyIteration) {
344 l_sampler3d1_G.readyIteration = false;
345 }
346 } catch (Throwable t) {
347 control.isFailing = true;
348 throw t;
349 } finally {
350 TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.set(l_sampler3d1_G, 0);
351 }
352 } else {
353 while (TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.get(l_sampler3d1_G) == 1) {
354 if (control.isFailing) throw new FailureAssistException();
355 if (Thread.interrupted()) throw new InterruptedException();
356 }
357 }
358
359 if (control.isLastIteration()) {
360 synchronized(this.getClass()) {
361 f_sampler3d1_G = null;
362 }
363 synchronized(this.getClass()) {
364 f_trianglesamplerbenchmark0_G = null;
365 }
366 }
367 res.allOps += res.measuredOps * batchSize;
368 res.allOps *= opsPerInv;
369 res.allOps /= batchSize;
370 res.measuredOps *= opsPerInv;
371 BenchmarkTaskResult results = new BenchmarkTaskResult((long)res.allOps, (long)res.measuredOps);
372 results.add(new SampleTimeResult(ResultRole.PRIMARY, "create3D", buffer, benchmarkParams.getTimeUnit()));
373 this.blackhole.evaporate("Yes, I am Stephen Hawking, and know a thing or two about black holes.");
374 return results;
375 } else
376 throw new IllegalStateException("Harness failed to distribute threads among groups properly");
377 }
378
379 public static void create3D_sample_jmhStub(InfraControl control, RawResults result, BenchmarkParams benchmarkParams, IterationParams iterationParams, ThreadParams threadParams, Blackhole blackhole, Control notifyControl, int startRndMask, SampleBuffer buffer, int targetSamples, long opsPerInv, int batchSize, TriangleSamplerBenchmark_Sampler3D_jmhType l_sampler3d1_G, TriangleSamplerBenchmark_jmhType l_trianglesamplerbenchmark0_G) throws Throwable {
380 long realTime = 0;
381 long operations = 0;
382 int rnd = (int)System.nanoTime();
383 int rndMask = startRndMask;
384 long time = 0;
385 int currentStride = 0;
386 do {
387 rnd = (rnd * 1664525 + 1013904223);
388 boolean sample = (rnd & rndMask) == 0;
389 if (sample) {
390 time = System.nanoTime();
391 }
392 for (int b = 0; b < batchSize; b++) {
393 if (control.volatileSpoiler) return;
394 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
395 }
396 if (sample) {
397 buffer.add((System.nanoTime() - time) / opsPerInv);
398 if (currentStride++ > targetSamples) {
399 buffer.half();
400 currentStride = 0;
401 rndMask = (rndMask << 1) + 1;
402 }
403 }
404 operations++;
405 } while(!control.isDone);
406 startRndMask = Math.max(startRndMask, rndMask);
407 result.realTime = realTime;
408 result.measuredOps = operations;
409 }
410
411
412 public BenchmarkTaskResult create3D_SingleShotTime(InfraControl control, ThreadParams threadParams) throws Throwable {
413 this.benchmarkParams = control.benchmarkParams;
414 this.iterationParams = control.iterationParams;
415 this.threadParams = threadParams;
416 this.notifyControl = control.notifyControl;
417 if (this.blackhole == null) {
418 this.blackhole = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous.");
419 }
420 if (threadParams.getSubgroupIndex() == 0) {
421 TriangleSamplerBenchmark_jmhType l_trianglesamplerbenchmark0_G = _jmh_tryInit_f_trianglesamplerbenchmark0_G(control);
422 TriangleSamplerBenchmark_Sampler3D_jmhType l_sampler3d1_G = _jmh_tryInit_f_sampler3d1_G(control);
423
424 control.preSetup();
425 if (TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.compareAndSet(l_sampler3d1_G, 0, 1)) {
426 try {
427 if (control.isFailing) throw new FailureAssistException();
428 if (!l_sampler3d1_G.readyIteration) {
429 l_sampler3d1_G.setup();
430 l_sampler3d1_G.readyIteration = true;
431 }
432 } catch (Throwable t) {
433 control.isFailing = true;
434 throw t;
435 } finally {
436 TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.set(l_sampler3d1_G, 0);
437 }
438 } else {
439 while (TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.get(l_sampler3d1_G) == 1) {
440 if (control.isFailing) throw new FailureAssistException();
441 if (Thread.interrupted()) throw new InterruptedException();
442 }
443 }
444
445
446 notifyControl.startMeasurement = true;
447 RawResults res = new RawResults();
448 int batchSize = iterationParams.getBatchSize();
449 create3D_ss_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, batchSize, l_sampler3d1_G, l_trianglesamplerbenchmark0_G);
450 control.preTearDown();
451 if (TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.compareAndSet(l_sampler3d1_G, 0, 1)) {
452 try {
453 if (control.isFailing) throw new FailureAssistException();
454 if (l_sampler3d1_G.readyIteration) {
455 l_sampler3d1_G.readyIteration = false;
456 }
457 } catch (Throwable t) {
458 control.isFailing = true;
459 throw t;
460 } finally {
461 TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.set(l_sampler3d1_G, 0);
462 }
463 } else {
464 while (TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.get(l_sampler3d1_G) == 1) {
465 if (control.isFailing) throw new FailureAssistException();
466 if (Thread.interrupted()) throw new InterruptedException();
467 }
468 }
469
470 if (control.isLastIteration()) {
471 synchronized(this.getClass()) {
472 f_sampler3d1_G = null;
473 }
474 synchronized(this.getClass()) {
475 f_trianglesamplerbenchmark0_G = null;
476 }
477 }
478 int opsPerInv = control.benchmarkParams.getOpsPerInvocation();
479 long totalOps = opsPerInv;
480 BenchmarkTaskResult results = new BenchmarkTaskResult(totalOps, totalOps);
481 results.add(new SingleShotResult(ResultRole.PRIMARY, "create3D", res.getTime(), totalOps, benchmarkParams.getTimeUnit()));
482 this.blackhole.evaporate("Yes, I am Stephen Hawking, and know a thing or two about black holes.");
483 return results;
484 } else
485 throw new IllegalStateException("Harness failed to distribute threads among groups properly");
486 }
487
488 public static void create3D_ss_jmhStub(InfraControl control, RawResults result, BenchmarkParams benchmarkParams, IterationParams iterationParams, ThreadParams threadParams, Blackhole blackhole, Control notifyControl, int startRndMask, int batchSize, TriangleSamplerBenchmark_Sampler3D_jmhType l_sampler3d1_G, TriangleSamplerBenchmark_jmhType l_trianglesamplerbenchmark0_G) throws Throwable {
489 long realTime = 0;
490 result.startTime = System.nanoTime();
491 for (int b = 0; b < batchSize; b++) {
492 if (control.volatileSpoiler) return;
493 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
494 }
495 result.stopTime = System.nanoTime();
496 result.realTime = realTime;
497 }
498
499
500 static volatile TriangleSamplerBenchmark_Sampler3D_jmhType f_sampler3d1_G;
501
502 TriangleSamplerBenchmark_Sampler3D_jmhType _jmh_tryInit_f_sampler3d1_G(InfraControl control) throws Throwable {
503 TriangleSamplerBenchmark_Sampler3D_jmhType val = f_sampler3d1_G;
504 if (val != null) {
505 return val;
506 }
507 synchronized(this.getClass()) {
508 try {
509 if (control.isFailing) throw new FailureAssistException();
510 val = f_sampler3d1_G;
511 if (val != null) {
512 return val;
513 }
514 val = new TriangleSamplerBenchmark_Sampler3D_jmhType();
515 Field f;
516 f = org.apache.commons.rng.examples.jmh.sampling.shape.TriangleSamplerBenchmark.SamplerData.class.getDeclaredField("size");
517 f.setAccessible(true);
518 f.set(val, Integer.valueOf(control.getParam("size")));
519 f = org.apache.commons.rng.examples.jmh.sampling.shape.TriangleSamplerBenchmark.Sampler3D.class.getDeclaredField("type");
520 f.setAccessible(true);
521 f.set(val, control.getParam("type"));
522 val.readyTrial = true;
523 f_sampler3d1_G = val;
524 } catch (Throwable t) {
525 control.isFailing = true;
526 throw t;
527 }
528 }
529 return val;
530 }
531
532 static volatile TriangleSamplerBenchmark_jmhType f_trianglesamplerbenchmark0_G;
533
534 TriangleSamplerBenchmark_jmhType _jmh_tryInit_f_trianglesamplerbenchmark0_G(InfraControl control) throws Throwable {
535 TriangleSamplerBenchmark_jmhType val = f_trianglesamplerbenchmark0_G;
536 if (val != null) {
537 return val;
538 }
539 synchronized(this.getClass()) {
540 try {
541 if (control.isFailing) throw new FailureAssistException();
542 val = f_trianglesamplerbenchmark0_G;
543 if (val != null) {
544 return val;
545 }
546 val = new TriangleSamplerBenchmark_jmhType();
547 val.readyTrial = true;
548 f_trianglesamplerbenchmark0_G = val;
549 } catch (Throwable t) {
550 control.isFailing = true;
551 throw t;
552 }
553 }
554 return val;
555 }
556
557
558 }
559