1 | package net.bmahe.genetics4j.gpu.spec.fitness.cldata; | |
2 | ||
3 | import org.apache.commons.lang3.Validate; | |
4 | import org.jocl.Sizeof; | |
5 | ||
6 | public class LocalMemoryAllocators { | |
7 | ||
8 | private LocalMemoryAllocators() { | |
9 | } | |
10 | ||
11 | public static LocalMemoryAllocator ofSize(final int type, final long size) { | |
12 | Validate.isTrue(type > 0); | |
13 | Validate.isTrue(size > 0); | |
14 | ||
15 |
1
1. ofSize : replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofSize → NO_COVERAGE |
return (openCLExecutionContext, kernelExecutionContext, generation, genotypes) -> { |
16 | ||
17 |
2
1. lambda$ofSize$0 : Replaced long multiplication with division → NO_COVERAGE 2. lambda$ofSize$0 : replaced long return with 0 for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::lambda$ofSize$0 → NO_COVERAGE |
return type * size; |
18 | }; | |
19 | } | |
20 | ||
21 | public static LocalMemoryAllocator ofWorkGroupSize(final int type, final int multiple) { | |
22 | Validate.isTrue(multiple > 0); | |
23 | ||
24 |
1
1. ofWorkGroupSize : replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofWorkGroupSize → NO_COVERAGE |
return (openCLExecutionContext, kernelExecutionContext, generation, genotypes) -> { |
25 | ||
26 |
1
1. lambda$ofWorkGroupSize$1 : removed call to net/bmahe/genetics4j/gpu/spec/fitness/kernelcontext/KernelExecutionContext::workGroupSize → NO_COVERAGE |
final long[] workGroupSize = kernelExecutionContext.workGroupSize() |
27 |
1
1. lambda$ofWorkGroupSize$1 : removed call to java/util/Optional::get → NO_COVERAGE |
.get(); |
28 |
1
1. lambda$ofWorkGroupSize$1 : Substituted 1 with 2 → NO_COVERAGE |
long totalWorkGroupSize = 1; |
29 |
5
1. lambda$ofWorkGroupSize$1 : Substituted 0 with 1 → NO_COVERAGE 2. lambda$ofWorkGroupSize$1 : removed conditional - replaced comparison check with true → NO_COVERAGE 3. lambda$ofWorkGroupSize$1 : changed conditional boundary → NO_COVERAGE 4. lambda$ofWorkGroupSize$1 : removed conditional - replaced comparison check with false → NO_COVERAGE 5. lambda$ofWorkGroupSize$1 : negated conditional → NO_COVERAGE |
for (int i = 0; i < workGroupSize.length; i++) { |
30 |
1
1. lambda$ofWorkGroupSize$1 : Replaced long multiplication with division → NO_COVERAGE |
totalWorkGroupSize *= workGroupSize[i]; |
31 | } | |
32 |
3
1. lambda$ofWorkGroupSize$1 : replaced long return with 0 for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::lambda$ofWorkGroupSize$1 → NO_COVERAGE 2. lambda$ofWorkGroupSize$1 : Replaced long multiplication with division → NO_COVERAGE 3. lambda$ofWorkGroupSize$1 : Replaced long multiplication with division → NO_COVERAGE |
return type * totalWorkGroupSize * multiple; |
33 | }; | |
34 | } | |
35 | ||
36 | public static LocalMemoryAllocator ofWorkGroupSize(final int type) { | |
37 |
3
1. ofWorkGroupSize : replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofWorkGroupSize → NO_COVERAGE 2. ofWorkGroupSize : Substituted 1 with 0 → NO_COVERAGE 3. ofWorkGroupSize : removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofWorkGroupSize → NO_COVERAGE |
return ofWorkGroupSize(type, 1); |
38 | } | |
39 | ||
40 | public static LocalMemoryAllocator ofMaxWorkGroupSize(final int type, final int multiple) { | |
41 | Validate.isTrue(multiple > 0); | |
42 | ||
43 |
1
1. ofMaxWorkGroupSize : replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofMaxWorkGroupSize → NO_COVERAGE |
return (openCLExecutionContext, kernelExecutionContext, generation, genotypes) -> { |
44 | ||
45 |
1
1. lambda$ofMaxWorkGroupSize$2 : removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::device → NO_COVERAGE |
final var device = openCLExecutionContext.device(); |
46 |
4
1. lambda$ofMaxWorkGroupSize$2 : Replaced long multiplication with division → NO_COVERAGE 2. lambda$ofMaxWorkGroupSize$2 : replaced long return with 0 for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::lambda$ofMaxWorkGroupSize$2 → NO_COVERAGE 3. lambda$ofMaxWorkGroupSize$2 : removed call to net/bmahe/genetics4j/gpu/opencl/model/Device::maxWorkGroupSize → NO_COVERAGE 4. lambda$ofMaxWorkGroupSize$2 : Replaced long multiplication with division → NO_COVERAGE |
return type * device.maxWorkGroupSize() * multiple; |
47 | }; | |
48 | } | |
49 | ||
50 | public static LocalMemoryAllocator ofMaxWorkGroupSize(final int type) { | |
51 |
3
1. ofMaxWorkGroupSize : Substituted 1 with 0 → NO_COVERAGE 2. ofMaxWorkGroupSize : replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofMaxWorkGroupSize → NO_COVERAGE 3. ofMaxWorkGroupSize : removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofMaxWorkGroupSize → NO_COVERAGE |
return ofMaxWorkGroupSize(type, 1); |
52 | } | |
53 | ||
54 | public static LocalMemoryAllocator ofMaxWorkGroupSizeFloat(final int multiple) { | |
55 |
3
1. ofMaxWorkGroupSizeFloat : Substituted 4 with 5 → NO_COVERAGE 2. ofMaxWorkGroupSizeFloat : replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofMaxWorkGroupSizeFloat → NO_COVERAGE 3. ofMaxWorkGroupSizeFloat : removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofMaxWorkGroupSize → NO_COVERAGE |
return ofMaxWorkGroupSize(Sizeof.cl_float, multiple); |
56 | } | |
57 | ||
58 | public static LocalMemoryAllocator ofMaxWorkGroupSizeFloat() { | |
59 |
4
1. ofMaxWorkGroupSizeFloat : Substituted 4 with 5 → NO_COVERAGE 2. ofMaxWorkGroupSizeFloat : replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofMaxWorkGroupSizeFloat → NO_COVERAGE 3. ofMaxWorkGroupSizeFloat : Substituted 1 with 0 → NO_COVERAGE 4. ofMaxWorkGroupSizeFloat : removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofMaxWorkGroupSize → NO_COVERAGE |
return ofMaxWorkGroupSize(Sizeof.cl_float, 1); |
60 | } | |
61 | ||
62 | public static LocalMemoryAllocator ofSizeFloat(final long size) { | |
63 | Validate.isTrue(size > 0); | |
64 | ||
65 |
3
1. ofSizeFloat : replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofSizeFloat → NO_COVERAGE 2. ofSizeFloat : removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofSize → NO_COVERAGE 3. ofSizeFloat : Substituted 4 with 5 → NO_COVERAGE |
return ofSize(Sizeof.cl_float, size); |
66 | } | |
67 | ||
68 | public static LocalMemoryAllocator ofSizeInt(final long size) { | |
69 | Validate.isTrue(size > 0); | |
70 | ||
71 |
3
1. ofSizeInt : replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofSizeInt → NO_COVERAGE 2. ofSizeInt : Substituted 4 with 5 → NO_COVERAGE 3. ofSizeInt : removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofSize → NO_COVERAGE |
return ofSize(Sizeof.cl_int, size); |
72 | } | |
73 | } | |
Mutations | ||
15 |
1.1 |
|
17 |
1.1 2.2 |
|
24 |
1.1 |
|
26 |
1.1 |
|
27 |
1.1 |
|
28 |
1.1 |
|
29 |
1.1 2.2 3.3 4.4 5.5 |
|
30 |
1.1 |
|
32 |
1.1 2.2 3.3 |
|
37 |
1.1 2.2 3.3 |
|
43 |
1.1 |
|
45 |
1.1 |
|
46 |
1.1 2.2 3.3 4.4 |
|
51 |
1.1 2.2 3.3 |
|
55 |
1.1 2.2 3.3 |
|
59 |
1.1 2.2 3.3 4.4 |
|
65 |
1.1 2.2 3.3 |
|
71 |
1.1 2.2 3.3 |