LocalMemoryAllocators.java

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

Mutations

15

1.1
Location : ofSize
Killed by : none
replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofSize → NO_COVERAGE

2.2
Location : lambda$ofSize$0
Killed by : none
Replaced long multiplication with division → NO_COVERAGE

3.3
Location : lambda$ofSize$0
Killed by : none
replaced long return with 0 for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::lambda$ofSize$0 → NO_COVERAGE

21

1.1
Location : ofWorkGroupSize
Killed by : none
replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofWorkGroupSize → NO_COVERAGE

23

1.1
Location : lambda$ofWorkGroupSize$0
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/kernelcontext/KernelExecutionContext::workGroupSize → NO_COVERAGE

2.2
Location : lambda$ofWorkGroupSize$0
Killed by : none
removed call to java/util/Optional::get → NO_COVERAGE

24

1.1
Location : lambda$ofWorkGroupSize$0
Killed by : none
Substituted 1 with 2 → NO_COVERAGE

25

1.1
Location : lambda$ofWorkGroupSize$0
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : lambda$ofWorkGroupSize$0
Killed by : none
removed conditional - replaced comparison check with false → NO_COVERAGE

3.3
Location : lambda$ofWorkGroupSize$0
Killed by : none
Substituted 0 with 1 → NO_COVERAGE

4.4
Location : lambda$ofWorkGroupSize$0
Killed by : none
removed conditional - replaced comparison check with true → NO_COVERAGE

5.5
Location : lambda$ofWorkGroupSize$0
Killed by : none
changed conditional boundary → NO_COVERAGE

26

1.1
Location : lambda$ofWorkGroupSize$0
Killed by : none
Replaced long multiplication with division → NO_COVERAGE

28

1.1
Location : lambda$ofWorkGroupSize$0
Killed by : none
Replaced long multiplication with division → NO_COVERAGE

2.2
Location : lambda$ofWorkGroupSize$0
Killed by : none
replaced long return with 0 for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::lambda$ofWorkGroupSize$0 → NO_COVERAGE

3.3
Location : lambda$ofWorkGroupSize$0
Killed by : none
Replaced long multiplication with division → NO_COVERAGE

33

1.1
Location : ofWorkGroupSize
Killed by : none
replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofWorkGroupSize → NO_COVERAGE

2.2
Location : ofWorkGroupSize
Killed by : none
Substituted 1 with 0 → NO_COVERAGE

3.3
Location : ofWorkGroupSize
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofWorkGroupSize → NO_COVERAGE

39

1.1
Location : ofMaxWorkGroupSize
Killed by : none
replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofMaxWorkGroupSize → NO_COVERAGE

41

1.1
Location : lambda$ofMaxWorkGroupSize$0
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::device → NO_COVERAGE

42

1.1
Location : lambda$ofMaxWorkGroupSize$0
Killed by : none
Replaced long multiplication with division → NO_COVERAGE

2.2
Location : lambda$ofMaxWorkGroupSize$0
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/model/Device::maxWorkGroupSize → NO_COVERAGE

3.3
Location : lambda$ofMaxWorkGroupSize$0
Killed by : none
replaced long return with 0 for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::lambda$ofMaxWorkGroupSize$0 → NO_COVERAGE

4.4
Location : lambda$ofMaxWorkGroupSize$0
Killed by : none
Replaced long multiplication with division → NO_COVERAGE

47

1.1
Location : ofMaxWorkGroupSize
Killed by : none
Substituted 1 with 0 → NO_COVERAGE

2.2
Location : ofMaxWorkGroupSize
Killed by : none
replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofMaxWorkGroupSize → NO_COVERAGE

3.3
Location : ofMaxWorkGroupSize
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofMaxWorkGroupSize → NO_COVERAGE

51

1.1
Location : ofMaxWorkGroupSizeFloat
Killed by : none
Substituted 4 with 5 → NO_COVERAGE

2.2
Location : ofMaxWorkGroupSizeFloat
Killed by : none
replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofMaxWorkGroupSizeFloat → NO_COVERAGE

3.3
Location : ofMaxWorkGroupSizeFloat
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofMaxWorkGroupSize → NO_COVERAGE

55

1.1
Location : ofMaxWorkGroupSizeFloat
Killed by : none
Substituted 4 with 5 → NO_COVERAGE

2.2
Location : ofMaxWorkGroupSizeFloat
Killed by : none
replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofMaxWorkGroupSizeFloat → NO_COVERAGE

3.3
Location : ofMaxWorkGroupSizeFloat
Killed by : none
Substituted 1 with 0 → NO_COVERAGE

4.4
Location : ofMaxWorkGroupSizeFloat
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofMaxWorkGroupSize → NO_COVERAGE

61

1.1
Location : ofSizeFloat
Killed by : none
replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofSizeFloat → NO_COVERAGE

2.2
Location : ofSizeFloat
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofSize → NO_COVERAGE

3.3
Location : ofSizeFloat
Killed by : none
Substituted 4 with 5 → NO_COVERAGE

67

1.1
Location : ofSizeInt
Killed by : none
replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofSizeInt → NO_COVERAGE

2.2
Location : ofSizeInt
Killed by : none
Substituted 4 with 5 → NO_COVERAGE

3.3
Location : ofSizeInt
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofSize → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.25.7 support