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

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

17

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

2.2
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

24

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

26

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

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

27

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

28

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

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

3.3
Location : lambda$ofWorkGroupSize$1
Killed by : none
changed conditional boundary → NO_COVERAGE

4.4
Location : lambda$ofWorkGroupSize$1
Killed by : none
negated conditional → NO_COVERAGE

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

29

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

31

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

2.2
Location : lambda$ofWorkGroupSize$1
Killed by : none
Replaced long multiplication with division → NO_COVERAGE

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

36

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

42

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

44

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

45

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

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

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

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

50

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

54

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

58

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

64

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

70

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.20.3