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 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
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 net/bmahe/genetics4j/gpu/spec/fitness/kernelcontext/KernelExecutionContext::workGroupSize → NO_COVERAGE

27

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

28

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

29

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
removed conditional - replaced comparison check with false → NO_COVERAGE

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

30

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

32

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

37

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

43

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

45

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

46

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

51

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

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
removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocators::ofMaxWorkGroupSize → NO_COVERAGE

59

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

65

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

71

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