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 if (control.shouldYield) Thread.yield();
101 res.allOps++;
102 }
103
104 notifyControl.startMeasurement = true;
105 create3D_thrpt_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, l_sampler3d1_G, l_trianglesamplerbenchmark0_G);
106 notifyControl.stopMeasurement = true;
107 control.announceWarmdownReady();
108 try {
109 while (control.warmdownShouldWait) {
110 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
111 if (control.shouldYield) Thread.yield();
112 res.allOps++;
113 }
114 } catch (Throwable e) {
115 if (!(e instanceof InterruptedException)) throw e;
116 }
117 control.preTearDown();
118 if (TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.compareAndSet(l_sampler3d1_G, 0, 1)) {
119 try {
120 if (control.isFailing) throw new FailureAssistException();
121 if (l_sampler3d1_G.readyIteration) {
122 l_sampler3d1_G.readyIteration = false;
123 }
124 } catch (Throwable t) {
125 control.isFailing = true;
126 throw t;
127 } finally {
128 TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.set(l_sampler3d1_G, 0);
129 }
130 } else {
131 while (TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.get(l_sampler3d1_G) == 1) {
132 if (control.isFailing) throw new FailureAssistException();
133 if (Thread.interrupted()) throw new InterruptedException();
134 }
135 }
136
137 if (control.isLastIteration()) {
138 synchronized(this.getClass()) {
139 f_sampler3d1_G = null;
140 }
141 synchronized(this.getClass()) {
142 f_trianglesamplerbenchmark0_G = null;
143 }
144 }
145 res.allOps += res.measuredOps;
146 int batchSize = iterationParams.getBatchSize();
147 int opsPerInv = benchmarkParams.getOpsPerInvocation();
148 res.allOps *= opsPerInv;
149 res.allOps /= batchSize;
150 res.measuredOps *= opsPerInv;
151 res.measuredOps /= batchSize;
152 BenchmarkTaskResult results = new BenchmarkTaskResult((long)res.allOps, (long)res.measuredOps);
153 results.add(new ThroughputResult(ResultRole.PRIMARY, "create3D", res.measuredOps, res.getTime(), benchmarkParams.getTimeUnit()));
154 this.blackhole.evaporate("Yes, I am Stephen Hawking, and know a thing or two about black holes.");
155 return results;
156 } else
157 throw new IllegalStateException("Harness failed to distribute threads among groups properly");
158 }
159
160 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 {
161 long operations = 0;
162 long realTime = 0;
163 result.startTime = System.nanoTime();
164 do {
165 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
166 operations++;
167 } while(!control.isDone);
168 result.stopTime = System.nanoTime();
169 result.realTime = realTime;
170 result.measuredOps = operations;
171 }
172
173
174 public BenchmarkTaskResult create3D_AverageTime(InfraControl control, ThreadParams threadParams) throws Throwable {
175 this.benchmarkParams = control.benchmarkParams;
176 this.iterationParams = control.iterationParams;
177 this.threadParams = threadParams;
178 this.notifyControl = control.notifyControl;
179 if (this.blackhole == null) {
180 this.blackhole = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous.");
181 }
182 if (threadParams.getSubgroupIndex() == 0) {
183 RawResults res = new RawResults();
184 TriangleSamplerBenchmark_jmhType l_trianglesamplerbenchmark0_G = _jmh_tryInit_f_trianglesamplerbenchmark0_G(control);
185 TriangleSamplerBenchmark_Sampler3D_jmhType l_sampler3d1_G = _jmh_tryInit_f_sampler3d1_G(control);
186
187 control.preSetup();
188 if (TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.compareAndSet(l_sampler3d1_G, 0, 1)) {
189 try {
190 if (control.isFailing) throw new FailureAssistException();
191 if (!l_sampler3d1_G.readyIteration) {
192 l_sampler3d1_G.setup();
193 l_sampler3d1_G.readyIteration = true;
194 }
195 } catch (Throwable t) {
196 control.isFailing = true;
197 throw t;
198 } finally {
199 TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.set(l_sampler3d1_G, 0);
200 }
201 } else {
202 while (TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.get(l_sampler3d1_G) == 1) {
203 if (control.isFailing) throw new FailureAssistException();
204 if (Thread.interrupted()) throw new InterruptedException();
205 }
206 }
207
208
209 control.announceWarmupReady();
210 while (control.warmupShouldWait) {
211 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
212 if (control.shouldYield) Thread.yield();
213 res.allOps++;
214 }
215
216 notifyControl.startMeasurement = true;
217 create3D_avgt_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, l_sampler3d1_G, l_trianglesamplerbenchmark0_G);
218 notifyControl.stopMeasurement = true;
219 control.announceWarmdownReady();
220 try {
221 while (control.warmdownShouldWait) {
222 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
223 if (control.shouldYield) Thread.yield();
224 res.allOps++;
225 }
226 } catch (Throwable e) {
227 if (!(e instanceof InterruptedException)) throw e;
228 }
229 control.preTearDown();
230 if (TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.compareAndSet(l_sampler3d1_G, 0, 1)) {
231 try {
232 if (control.isFailing) throw new FailureAssistException();
233 if (l_sampler3d1_G.readyIteration) {
234 l_sampler3d1_G.readyIteration = false;
235 }
236 } catch (Throwable t) {
237 control.isFailing = true;
238 throw t;
239 } finally {
240 TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.set(l_sampler3d1_G, 0);
241 }
242 } else {
243 while (TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.get(l_sampler3d1_G) == 1) {
244 if (control.isFailing) throw new FailureAssistException();
245 if (Thread.interrupted()) throw new InterruptedException();
246 }
247 }
248
249 if (control.isLastIteration()) {
250 synchronized(this.getClass()) {
251 f_sampler3d1_G = null;
252 }
253 synchronized(this.getClass()) {
254 f_trianglesamplerbenchmark0_G = null;
255 }
256 }
257 res.allOps += res.measuredOps;
258 int batchSize = iterationParams.getBatchSize();
259 int opsPerInv = benchmarkParams.getOpsPerInvocation();
260 res.allOps *= opsPerInv;
261 res.allOps /= batchSize;
262 res.measuredOps *= opsPerInv;
263 res.measuredOps /= batchSize;
264 BenchmarkTaskResult results = new BenchmarkTaskResult((long)res.allOps, (long)res.measuredOps);
265 results.add(new AverageTimeResult(ResultRole.PRIMARY, "create3D", res.measuredOps, res.getTime(), benchmarkParams.getTimeUnit()));
266 this.blackhole.evaporate("Yes, I am Stephen Hawking, and know a thing or two about black holes.");
267 return results;
268 } else
269 throw new IllegalStateException("Harness failed to distribute threads among groups properly");
270 }
271
272 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 {
273 long operations = 0;
274 long realTime = 0;
275 result.startTime = System.nanoTime();
276 do {
277 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
278 operations++;
279 } while(!control.isDone);
280 result.stopTime = System.nanoTime();
281 result.realTime = realTime;
282 result.measuredOps = operations;
283 }
284
285
286 public BenchmarkTaskResult create3D_SampleTime(InfraControl control, ThreadParams threadParams) throws Throwable {
287 this.benchmarkParams = control.benchmarkParams;
288 this.iterationParams = control.iterationParams;
289 this.threadParams = threadParams;
290 this.notifyControl = control.notifyControl;
291 if (this.blackhole == null) {
292 this.blackhole = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous.");
293 }
294 if (threadParams.getSubgroupIndex() == 0) {
295 RawResults res = new RawResults();
296 TriangleSamplerBenchmark_jmhType l_trianglesamplerbenchmark0_G = _jmh_tryInit_f_trianglesamplerbenchmark0_G(control);
297 TriangleSamplerBenchmark_Sampler3D_jmhType l_sampler3d1_G = _jmh_tryInit_f_sampler3d1_G(control);
298
299 control.preSetup();
300 if (TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.compareAndSet(l_sampler3d1_G, 0, 1)) {
301 try {
302 if (control.isFailing) throw new FailureAssistException();
303 if (!l_sampler3d1_G.readyIteration) {
304 l_sampler3d1_G.setup();
305 l_sampler3d1_G.readyIteration = true;
306 }
307 } catch (Throwable t) {
308 control.isFailing = true;
309 throw t;
310 } finally {
311 TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.set(l_sampler3d1_G, 0);
312 }
313 } else {
314 while (TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.get(l_sampler3d1_G) == 1) {
315 if (control.isFailing) throw new FailureAssistException();
316 if (Thread.interrupted()) throw new InterruptedException();
317 }
318 }
319
320
321 control.announceWarmupReady();
322 while (control.warmupShouldWait) {
323 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
324 if (control.shouldYield) Thread.yield();
325 res.allOps++;
326 }
327
328 notifyControl.startMeasurement = true;
329 int targetSamples = (int) (control.getDuration(TimeUnit.MILLISECONDS) * 20);
330 int batchSize = iterationParams.getBatchSize();
331 int opsPerInv = benchmarkParams.getOpsPerInvocation();
332 SampleBuffer buffer = new SampleBuffer();
333 create3D_sample_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, buffer, targetSamples, opsPerInv, batchSize, l_sampler3d1_G, l_trianglesamplerbenchmark0_G);
334 notifyControl.stopMeasurement = true;
335 control.announceWarmdownReady();
336 try {
337 while (control.warmdownShouldWait) {
338 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
339 if (control.shouldYield) Thread.yield();
340 res.allOps++;
341 }
342 } catch (Throwable e) {
343 if (!(e instanceof InterruptedException)) throw e;
344 }
345 control.preTearDown();
346 if (TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.compareAndSet(l_sampler3d1_G, 0, 1)) {
347 try {
348 if (control.isFailing) throw new FailureAssistException();
349 if (l_sampler3d1_G.readyIteration) {
350 l_sampler3d1_G.readyIteration = false;
351 }
352 } catch (Throwable t) {
353 control.isFailing = true;
354 throw t;
355 } finally {
356 TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.set(l_sampler3d1_G, 0);
357 }
358 } else {
359 while (TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.get(l_sampler3d1_G) == 1) {
360 if (control.isFailing) throw new FailureAssistException();
361 if (Thread.interrupted()) throw new InterruptedException();
362 }
363 }
364
365 if (control.isLastIteration()) {
366 synchronized(this.getClass()) {
367 f_sampler3d1_G = null;
368 }
369 synchronized(this.getClass()) {
370 f_trianglesamplerbenchmark0_G = null;
371 }
372 }
373 res.allOps += res.measuredOps * batchSize;
374 res.allOps *= opsPerInv;
375 res.allOps /= batchSize;
376 res.measuredOps *= opsPerInv;
377 BenchmarkTaskResult results = new BenchmarkTaskResult((long)res.allOps, (long)res.measuredOps);
378 results.add(new SampleTimeResult(ResultRole.PRIMARY, "create3D", buffer, benchmarkParams.getTimeUnit()));
379 this.blackhole.evaporate("Yes, I am Stephen Hawking, and know a thing or two about black holes.");
380 return results;
381 } else
382 throw new IllegalStateException("Harness failed to distribute threads among groups properly");
383 }
384
385 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 {
386 long realTime = 0;
387 long operations = 0;
388 int rnd = (int)System.nanoTime();
389 int rndMask = startRndMask;
390 long time = 0;
391 int currentStride = 0;
392 do {
393 rnd = (rnd * 1664525 + 1013904223);
394 boolean sample = (rnd & rndMask) == 0;
395 if (sample) {
396 time = System.nanoTime();
397 }
398 for (int b = 0; b < batchSize; b++) {
399 if (control.volatileSpoiler) return;
400 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
401 }
402 if (sample) {
403 buffer.add((System.nanoTime() - time) / opsPerInv);
404 if (currentStride++ > targetSamples) {
405 buffer.half();
406 currentStride = 0;
407 rndMask = (rndMask << 1) + 1;
408 }
409 }
410 operations++;
411 } while(!control.isDone);
412 startRndMask = Math.max(startRndMask, rndMask);
413 result.realTime = realTime;
414 result.measuredOps = operations;
415 }
416
417
418 public BenchmarkTaskResult create3D_SingleShotTime(InfraControl control, ThreadParams threadParams) throws Throwable {
419 this.benchmarkParams = control.benchmarkParams;
420 this.iterationParams = control.iterationParams;
421 this.threadParams = threadParams;
422 this.notifyControl = control.notifyControl;
423 if (this.blackhole == null) {
424 this.blackhole = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous.");
425 }
426 if (threadParams.getSubgroupIndex() == 0) {
427 TriangleSamplerBenchmark_jmhType l_trianglesamplerbenchmark0_G = _jmh_tryInit_f_trianglesamplerbenchmark0_G(control);
428 TriangleSamplerBenchmark_Sampler3D_jmhType l_sampler3d1_G = _jmh_tryInit_f_sampler3d1_G(control);
429
430 control.preSetup();
431 if (TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.compareAndSet(l_sampler3d1_G, 0, 1)) {
432 try {
433 if (control.isFailing) throw new FailureAssistException();
434 if (!l_sampler3d1_G.readyIteration) {
435 l_sampler3d1_G.setup();
436 l_sampler3d1_G.readyIteration = true;
437 }
438 } catch (Throwable t) {
439 control.isFailing = true;
440 throw t;
441 } finally {
442 TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.set(l_sampler3d1_G, 0);
443 }
444 } else {
445 while (TriangleSamplerBenchmark_Sampler3D_jmhType.setupIterationMutexUpdater.get(l_sampler3d1_G) == 1) {
446 if (control.isFailing) throw new FailureAssistException();
447 if (Thread.interrupted()) throw new InterruptedException();
448 }
449 }
450
451
452 notifyControl.startMeasurement = true;
453 RawResults res = new RawResults();
454 int batchSize = iterationParams.getBatchSize();
455 create3D_ss_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, batchSize, l_sampler3d1_G, l_trianglesamplerbenchmark0_G);
456 control.preTearDown();
457 if (TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.compareAndSet(l_sampler3d1_G, 0, 1)) {
458 try {
459 if (control.isFailing) throw new FailureAssistException();
460 if (l_sampler3d1_G.readyIteration) {
461 l_sampler3d1_G.readyIteration = false;
462 }
463 } catch (Throwable t) {
464 control.isFailing = true;
465 throw t;
466 } finally {
467 TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.set(l_sampler3d1_G, 0);
468 }
469 } else {
470 while (TriangleSamplerBenchmark_Sampler3D_jmhType.tearIterationMutexUpdater.get(l_sampler3d1_G) == 1) {
471 if (control.isFailing) throw new FailureAssistException();
472 if (Thread.interrupted()) throw new InterruptedException();
473 }
474 }
475
476 if (control.isLastIteration()) {
477 synchronized(this.getClass()) {
478 f_sampler3d1_G = null;
479 }
480 synchronized(this.getClass()) {
481 f_trianglesamplerbenchmark0_G = null;
482 }
483 }
484 int opsPerInv = control.benchmarkParams.getOpsPerInvocation();
485 long totalOps = opsPerInv;
486 BenchmarkTaskResult results = new BenchmarkTaskResult(totalOps, totalOps);
487 results.add(new SingleShotResult(ResultRole.PRIMARY, "create3D", res.getTime(), totalOps, benchmarkParams.getTimeUnit()));
488 this.blackhole.evaporate("Yes, I am Stephen Hawking, and know a thing or two about black holes.");
489 return results;
490 } else
491 throw new IllegalStateException("Harness failed to distribute threads among groups properly");
492 }
493
494 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 {
495 long realTime = 0;
496 result.startTime = System.nanoTime();
497 for (int b = 0; b < batchSize; b++) {
498 if (control.volatileSpoiler) return;
499 l_trianglesamplerbenchmark0_G.create3D(blackhole, l_sampler3d1_G);
500 }
501 result.stopTime = System.nanoTime();
502 result.realTime = realTime;
503 }
504
505
506 static volatile TriangleSamplerBenchmark_Sampler3D_jmhType f_sampler3d1_G;
507
508 TriangleSamplerBenchmark_Sampler3D_jmhType _jmh_tryInit_f_sampler3d1_G(InfraControl control) throws Throwable {
509 TriangleSamplerBenchmark_Sampler3D_jmhType val = f_sampler3d1_G;
510 if (val != null) {
511 return val;
512 }
513 synchronized(this.getClass()) {
514 try {
515 if (control.isFailing) throw new FailureAssistException();
516 val = f_sampler3d1_G;
517 if (val != null) {
518 return val;
519 }
520 val = new TriangleSamplerBenchmark_Sampler3D_jmhType();
521 Field f;
522 f = org.apache.commons.rng.examples.jmh.sampling.shape.TriangleSamplerBenchmark.SamplerData.class.getDeclaredField("size");
523 f.setAccessible(true);
524 f.set(val, Integer.valueOf(control.getParam("size")));
525 f = org.apache.commons.rng.examples.jmh.sampling.shape.TriangleSamplerBenchmark.Sampler3D.class.getDeclaredField("type");
526 f.setAccessible(true);
527 f.set(val, control.getParam("type"));
528 val.readyTrial = true;
529 f_sampler3d1_G = val;
530 } catch (Throwable t) {
531 control.isFailing = true;
532 throw t;
533 }
534 }
535 return val;
536 }
537
538 static volatile TriangleSamplerBenchmark_jmhType f_trianglesamplerbenchmark0_G;
539
540 TriangleSamplerBenchmark_jmhType _jmh_tryInit_f_trianglesamplerbenchmark0_G(InfraControl control) throws Throwable {
541 TriangleSamplerBenchmark_jmhType val = f_trianglesamplerbenchmark0_G;
542 if (val != null) {
543 return val;
544 }
545 synchronized(this.getClass()) {
546 try {
547 if (control.isFailing) throw new FailureAssistException();
548 val = f_trianglesamplerbenchmark0_G;
549 if (val != null) {
550 return val;
551 }
552 val = new TriangleSamplerBenchmark_jmhType();
553 val.readyTrial = true;
554 f_trianglesamplerbenchmark0_G = val;
555 } catch (Throwable t) {
556 control.isFailing = true;
557 throw t;
558 }
559 }
560 return val;
561 }
562
563
564 }
565