SingleKernelFitness.java

1
package net.bmahe.genetics4j.gpu.spec.fitness;
2
3
import java.util.HashMap;
4
import java.util.List;
5
import java.util.Map;
6
import java.util.concurrent.CompletableFuture;
7
import java.util.concurrent.ConcurrentHashMap;
8
import java.util.concurrent.ExecutorService;
9
10
import org.apache.commons.collections4.MapUtils;
11
import org.apache.commons.lang3.Validate;
12
import org.apache.logging.log4j.LogManager;
13
import org.apache.logging.log4j.Logger;
14
import org.jocl.CL;
15
import org.jocl.Pointer;
16
import org.jocl.Sizeof;
17
18
import net.bmahe.genetics4j.core.Genotype;
19
import net.bmahe.genetics4j.gpu.opencl.OpenCLExecutionContext;
20
import net.bmahe.genetics4j.gpu.opencl.model.Device;
21
import net.bmahe.genetics4j.gpu.spec.fitness.cldata.CLData;
22
import net.bmahe.genetics4j.gpu.spec.fitness.kernelcontext.KernelExecutionContext;
23
24
/**
25
 * GPU-accelerated fitness evaluator that executes a single OpenCL kernel for fitness computation.
26
 * 
27
 * <p>SingleKernelFitness provides a comprehensive framework for implementing fitness evaluation using a single OpenCL
28
 * kernel. It manages the complete lifecycle of GPU computation including data loading, kernel execution, and result
29
 * extraction, making it suitable for most GPU-accelerated evolutionary algorithm scenarios.
30
 * 
31
 * <p>Key features:
32
 * <ul>
33
 * <li><strong>Single kernel execution</strong>: Executes one OpenCL kernel per fitness evaluation</li>
34
 * <li><strong>Data management</strong>: Handles static data, dynamic data, and result allocation</li>
35
 * <li><strong>Memory lifecycle</strong>: Automatic cleanup of OpenCL memory objects</li>
36
 * <li><strong>Multi-device support</strong>: Supports concurrent execution across multiple devices</li>
37
 * <li><strong>Local memory</strong>: Configurable local memory allocation for kernel optimization</li>
38
 * </ul>
39
 * 
40
 * <p>Data flow architecture:
41
 * <ul>
42
 * <li><strong>Static data</strong>: Algorithm parameters loaded once before all evaluations</li>
43
 * <li><strong>Dynamic data</strong>: Population data loaded before each generation</li>
44
 * <li><strong>Local memory</strong>: Work group local memory allocated based on kernel requirements</li>
45
 * <li><strong>Result data</strong>: Output buffers allocated for fitness results and intermediate data</li>
46
 * </ul>
47
 * 
48
 * <p>Typical usage pattern:
49
 * 
50
 * <pre>{@code
51
 * // Define kernel and data configuration
52
 * SingleKernelFitnessDescriptor descriptor = SingleKernelFitnessDescriptor.builder()
53
 * 		.kernelName("fitness_evaluation")
54
 * 		.addDataLoader(0, populationDataLoader)
55
 * 		.addStaticDataLoader(1, parametersDataLoader)
56
 * 		.addResultAllocator(2, fitnessResultAllocator)
57
 * 		.kernelExecutionContextComputer(executionContextComputer)
58
 * 		.build();
59
 * 
60
 * // Define fitness extraction from GPU results
61
 * FitnessExtractor<Double> extractor = (context, kernelCtx, executor, generation, genotypes, results) -> {
62
 * 	float[] fitnessValues = results.extractFloatArray(context, 2);
63
 * 	return Arrays.stream(fitnessValues).mapToDouble(f -> (double) f).boxed().collect(Collectors.toList());
64
 * };
65
 * 
66
 * // Create single kernel fitness evaluator
67
 * SingleKernelFitness<Double> fitness = SingleKernelFitness.of(descriptor, extractor);
68
 * }</pre>
69
 * 
70
 * <p>Kernel execution workflow:
71
 * <ol>
72
 * <li><strong>Initialization</strong>: Load static data once before all evaluations</li>
73
 * <li><strong>Data preparation</strong>: Load generation-specific data and allocate result buffers</li>
74
 * <li><strong>Kernel setup</strong>: Configure kernel arguments with data references</li>
75
 * <li><strong>Execution</strong>: Launch kernel with optimized work group configuration</li>
76
 * <li><strong>Result extraction</strong>: Extract fitness values from GPU memory</li>
77
 * <li><strong>Cleanup</strong>: Release generation-specific memory resources</li>
78
 * </ol>
79
 * 
80
 * <p>Memory management strategy:
81
 * <ul>
82
 * <li><strong>Static data persistence</strong>: Static data remains allocated across generations</li>
83
 * <li><strong>Dynamic allocation</strong>: Generation data is allocated and released per evaluation</li>
84
 * <li><strong>Result buffer reuse</strong>: Result buffers can be reused with proper sizing</li>
85
 * <li><strong>Automatic cleanup</strong>: Memory is automatically released in lifecycle methods</li>
86
 * </ul>
87
 * 
88
 * <p>Performance optimization features:
89
 * <ul>
90
 * <li><strong>Asynchronous execution</strong>: Kernel execution returns CompletableFuture for pipeline processing</li>
91
 * <li><strong>Work group optimization</strong>: Configurable work group sizes for optimal device utilization</li>
92
 * <li><strong>Memory coalescing</strong>: Support for optimized memory access patterns</li>
93
 * <li><strong>Local memory utilization</strong>: Efficient use of device local memory for performance</li>
94
 * </ul>
95
 * 
96
 * @param <T> the fitness value type, must be Comparable for optimization algorithms
97
 * @see OpenCLFitness
98
 * @see SingleKernelFitnessDescriptor
99
 * @see FitnessExtractor
100
 * @see net.bmahe.genetics4j.gpu.spec.fitness.cldata.DataLoader
101
 */
102
public class SingleKernelFitness<T extends Comparable<T>> extends OpenCLFitness<T> {
103
	public static final Logger logger = LogManager.getLogger(SingleKernelFitness.class);
104
105
	private final SingleKernelFitnessDescriptor singleKernelFitnessDescriptor;
106
	private final FitnessExtractor<T> fitnessExtractor;
107
108 2 1. <init> : removed call to java/util/concurrent/ConcurrentHashMap::<init> → NO_COVERAGE
2. <init> : Removed assignment to member variable staticData → NO_COVERAGE
	private final Map<Device, Map<Integer, CLData>> staticData = new ConcurrentHashMap<>();
109 2 1. <init> : Removed assignment to member variable data → NO_COVERAGE
2. <init> : removed call to java/util/concurrent/ConcurrentHashMap::<init> → NO_COVERAGE
	private final Map<Device, Map<Integer, CLData>> data = new ConcurrentHashMap<>();
110 2 1. <init> : removed call to java/util/concurrent/ConcurrentHashMap::<init> → NO_COVERAGE
2. <init> : Removed assignment to member variable resultData → NO_COVERAGE
	private final Map<Device, Map<Integer, CLData>> resultData = new ConcurrentHashMap<>();
111
112 2 1. <init> : removed call to java/util/concurrent/ConcurrentHashMap::<init> → NO_COVERAGE
2. <init> : Removed assignment to member variable kernelExecutionContexts → NO_COVERAGE
	private final Map<Device, KernelExecutionContext> kernelExecutionContexts = new ConcurrentHashMap<>();
113
114
	protected void clearStaticData(final Device device) {
115 10 1. clearStaticData : replaced call to java/util/Map::get with argument → NO_COVERAGE
2. clearStaticData : removed conditional - replaced equality check with true → NO_COVERAGE
3. clearStaticData : removed call to org/apache/commons/collections4/MapUtils::isEmpty → NO_COVERAGE
4. clearStaticData : removed conditional - replaced equality check with false → NO_COVERAGE
5. clearStaticData : negated conditional → NO_COVERAGE
6. clearStaticData : removed call to java/util/Map::get → NO_COVERAGE
7. clearStaticData : negated conditional → NO_COVERAGE
8. clearStaticData : removed conditional - replaced equality check with false → NO_COVERAGE
9. clearStaticData : removed call to org/apache/commons/collections4/MapUtils::isEmpty → NO_COVERAGE
10. clearStaticData : removed conditional - replaced equality check with true → NO_COVERAGE
		if (MapUtils.isEmpty(staticData) || MapUtils.isEmpty(staticData.get(device))) {
116
			return;
117
		}
118
119 2 1. clearStaticData : replaced call to java/util/Map::get with argument → NO_COVERAGE
2. clearStaticData : removed call to java/util/Map::get → NO_COVERAGE
		final Map<Integer, CLData> mapData = staticData.get(device);
120 1 1. clearStaticData : removed call to java/util/Map::values → NO_COVERAGE
		for (final CLData clData : mapData.values()) {
121 2 1. clearStaticData : removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/CLData::clMem → NO_COVERAGE
2. clearStaticData : removed call to org/jocl/CL::clReleaseMemObject → NO_COVERAGE
			CL.clReleaseMemObject(clData.clMem());
122
		}
123
124 1 1. clearStaticData : removed call to java/util/Map::clear → NO_COVERAGE
		mapData.clear();
125 2 1. clearStaticData : removed call to java/util/Map::remove → NO_COVERAGE
2. clearStaticData : replaced call to java/util/Map::remove with argument → NO_COVERAGE
		staticData.remove(device);
126
	}
127
128
	protected void clearData(final Device device) {
129 10 1. clearData : replaced call to java/util/Map::get with argument → NO_COVERAGE
2. clearData : removed conditional - replaced equality check with true → NO_COVERAGE
3. clearData : removed call to org/apache/commons/collections4/MapUtils::isEmpty → NO_COVERAGE
4. clearData : removed conditional - replaced equality check with false → NO_COVERAGE
5. clearData : negated conditional → NO_COVERAGE
6. clearData : negated conditional → NO_COVERAGE
7. clearData : removed conditional - replaced equality check with true → NO_COVERAGE
8. clearData : removed call to org/apache/commons/collections4/MapUtils::isEmpty → NO_COVERAGE
9. clearData : removed conditional - replaced equality check with false → NO_COVERAGE
10. clearData : removed call to java/util/Map::get → NO_COVERAGE
		if (MapUtils.isEmpty(data) || MapUtils.isEmpty(data.get(device))) {
130
			return;
131
		}
132
133 2 1. clearData : replaced call to java/util/Map::get with argument → NO_COVERAGE
2. clearData : removed call to java/util/Map::get → NO_COVERAGE
		final Map<Integer, CLData> mapData = data.get(device);
134 1 1. clearData : removed call to java/util/Map::values → NO_COVERAGE
		for (final CLData clData : mapData.values()) {
135 2 1. clearData : removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/CLData::clMem → NO_COVERAGE
2. clearData : removed call to org/jocl/CL::clReleaseMemObject → NO_COVERAGE
			CL.clReleaseMemObject(clData.clMem());
136
		}
137
138 1 1. clearData : removed call to java/util/Map::clear → NO_COVERAGE
		mapData.clear();
139 2 1. clearData : removed call to java/util/Map::remove → NO_COVERAGE
2. clearData : replaced call to java/util/Map::remove with argument → NO_COVERAGE
		data.remove(device);
140
	}
141
142
	protected void clearResultData(final Device device) {
143 10 1. clearResultData : removed conditional - replaced equality check with false → NO_COVERAGE
2. clearResultData : removed call to org/apache/commons/collections4/MapUtils::isEmpty → NO_COVERAGE
3. clearResultData : replaced call to java/util/Map::get with argument → NO_COVERAGE
4. clearResultData : removed conditional - replaced equality check with true → NO_COVERAGE
5. clearResultData : removed call to java/util/Map::get → NO_COVERAGE
6. clearResultData : negated conditional → NO_COVERAGE
7. clearResultData : removed call to org/apache/commons/collections4/MapUtils::isEmpty → NO_COVERAGE
8. clearResultData : removed conditional - replaced equality check with false → NO_COVERAGE
9. clearResultData : negated conditional → NO_COVERAGE
10. clearResultData : removed conditional - replaced equality check with true → NO_COVERAGE
		if (MapUtils.isEmpty(resultData) || MapUtils.isEmpty(resultData.get(device))) {
144
			return;
145
		}
146
147 2 1. clearResultData : replaced call to java/util/Map::get with argument → NO_COVERAGE
2. clearResultData : removed call to java/util/Map::get → NO_COVERAGE
		final Map<Integer, CLData> mapData = resultData.get(device);
148 1 1. clearResultData : removed call to java/util/Map::values → NO_COVERAGE
		for (final CLData clData : mapData.values()) {
149 2 1. clearResultData : removed call to org/jocl/CL::clReleaseMemObject → NO_COVERAGE
2. clearResultData : removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/CLData::clMem → NO_COVERAGE
			CL.clReleaseMemObject(clData.clMem());
150
		}
151
152 1 1. clearResultData : removed call to java/util/Map::clear → NO_COVERAGE
		mapData.clear();
153 2 1. clearResultData : removed call to java/util/Map::remove → NO_COVERAGE
2. clearResultData : replaced call to java/util/Map::remove with argument → NO_COVERAGE
		resultData.remove(device);
154
	}
155
156
	/**
157
	 * Constructs a SingleKernelFitness with the specified kernel descriptor and fitness extractor.
158
	 * 
159
	 * @param _singleKernelFitnessDescriptor configuration for kernel execution and data management
160
	 * @param _fitnessExtractor              function to extract fitness values from GPU computation results
161
	 * @throws IllegalArgumentException if any parameter is null
162
	 */
163
	public SingleKernelFitness(final SingleKernelFitnessDescriptor _singleKernelFitnessDescriptor,
164
			final FitnessExtractor<T> _fitnessExtractor) {
165
		Validate.notNull(_singleKernelFitnessDescriptor);
166
		Validate.notNull(_fitnessExtractor);
167
168 1 1. <init> : Removed assignment to member variable singleKernelFitnessDescriptor → NO_COVERAGE
		this.singleKernelFitnessDescriptor = _singleKernelFitnessDescriptor;
169 1 1. <init> : Removed assignment to member variable fitnessExtractor → NO_COVERAGE
		this.fitnessExtractor = _fitnessExtractor;
170
	}
171
172
	@Override
173
	public void beforeAllEvaluations(final OpenCLExecutionContext openCLExecutionContext,
174
			final ExecutorService executorService) {
175 1 1. beforeAllEvaluations : removed call to net/bmahe/genetics4j/gpu/spec/fitness/OpenCLFitness::beforeAllEvaluations → NO_COVERAGE
		super.beforeAllEvaluations(openCLExecutionContext, executorService);
176
177 1 1. beforeAllEvaluations : removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::device → NO_COVERAGE
		final var device = openCLExecutionContext.device();
178 1 1. beforeAllEvaluations : removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::clearStaticData → NO_COVERAGE
		clearStaticData(device);
179
180 1 1. beforeAllEvaluations : removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitnessDescriptor::staticDataLoaders → NO_COVERAGE
		final var staticDataLoaders = singleKernelFitnessDescriptor.staticDataLoaders();
181 1 1. beforeAllEvaluations : removed call to java/util/Map::entrySet → NO_COVERAGE
		for (final var entry : staticDataLoaders.entrySet()) {
182 2 1. beforeAllEvaluations : removed call to java/util/Map$Entry::getKey → NO_COVERAGE
2. beforeAllEvaluations : removed call to java/lang/Integer::intValue → NO_COVERAGE
			final int argumentIdx = entry.getKey();
183 1 1. beforeAllEvaluations : removed call to java/util/Map$Entry::getValue → NO_COVERAGE
			final var dataSupplier = entry.getValue();
184
185
			if (logger.isTraceEnabled()) {
186 2 1. beforeAllEvaluations : removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::device → NO_COVERAGE
2. beforeAllEvaluations : removed call to net/bmahe/genetics4j/gpu/opencl/model/Device::name → NO_COVERAGE
				final var deviceName = openCLExecutionContext.device().name();
187
				logger.trace("[{}] Loading static data for index {}", deviceName, argumentIdx);
188
			}
189 1 1. beforeAllEvaluations : removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/StaticDataLoader::load → NO_COVERAGE
			final CLData clData = dataSupplier.load(openCLExecutionContext);
190
191 4 1. beforeAllEvaluations : removed call to java/util/Map::computeIfAbsent → NO_COVERAGE
2. beforeAllEvaluations : replaced call to java/util/Map::computeIfAbsent with argument → NO_COVERAGE
3. lambda$beforeAllEvaluations$0 : removed call to java/util/HashMap::<init> → NO_COVERAGE
4. lambda$beforeAllEvaluations$0 : replaced return value with Collections.emptyMap for net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::lambda$beforeAllEvaluations$0 → NO_COVERAGE
			final var mapData = staticData.computeIfAbsent(device, k -> new HashMap<>());
192 6 1. beforeAllEvaluations : replaced call to java/util/Map::put with argument → NO_COVERAGE
2. beforeAllEvaluations : removed call to java/lang/Integer::valueOf → NO_COVERAGE
3. beforeAllEvaluations : removed conditional - replaced equality check with true → NO_COVERAGE
4. beforeAllEvaluations : removed conditional - replaced equality check with false → NO_COVERAGE
5. beforeAllEvaluations : negated conditional → NO_COVERAGE
6. beforeAllEvaluations : removed call to java/util/Map::put → NO_COVERAGE
			if (mapData.put(argumentIdx, clData) != null) {
193 1 1. beforeAllEvaluations : removed call to java/lang/IllegalArgumentException::<init> → NO_COVERAGE
				throw new IllegalArgumentException("Multiple data configured for index " + argumentIdx);
194
			}
195
		}
196
	}
197
198
	@Override
199
	public void beforeEvaluation(OpenCLExecutionContext openCLExecutionContext, ExecutorService executorService,
200
			long generation, final List<Genotype> genotypes) {
201 1 1. beforeEvaluation : removed call to net/bmahe/genetics4j/gpu/spec/fitness/OpenCLFitness::beforeEvaluation → NO_COVERAGE
		super.beforeEvaluation(openCLExecutionContext, executorService, generation, genotypes);
202
203 1 1. beforeEvaluation : removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::device → NO_COVERAGE
		final var device = openCLExecutionContext.device();
204 1 1. beforeEvaluation : removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::kernels → NO_COVERAGE
		final var kernels = openCLExecutionContext.kernels();
205
206 1 1. beforeEvaluation : removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitnessDescriptor::kernelName → NO_COVERAGE
		final var kernelName = singleKernelFitnessDescriptor.kernelName();
207 2 1. beforeEvaluation : removed call to java/util/Map::get → NO_COVERAGE
2. beforeEvaluation : replaced call to java/util/Map::get with argument → NO_COVERAGE
		final var kernel = kernels.get(kernelName);
208
209 4 1. beforeEvaluation : removed call to java/util/Map::containsKey → NO_COVERAGE
2. beforeEvaluation : negated conditional → NO_COVERAGE
3. beforeEvaluation : removed conditional - replaced equality check with true → NO_COVERAGE
4. beforeEvaluation : removed conditional - replaced equality check with false → NO_COVERAGE
		if (kernelExecutionContexts.containsKey(device)) {
210 1 1. beforeEvaluation : removed call to java/lang/IllegalStateException::<init> → NO_COVERAGE
			throw new IllegalStateException("Found existing kernelExecutionContext");
211
		}
212 1 1. beforeEvaluation : removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitnessDescriptor::kernelExecutionContextComputer → NO_COVERAGE
		final var kernelExecutionContextComputer = singleKernelFitnessDescriptor.kernelExecutionContextComputer();
213
		final var kernelExecutionContext = kernelExecutionContextComputer
214 1 1. beforeEvaluation : removed call to net/bmahe/genetics4j/gpu/spec/fitness/kernelcontext/KernelExecutionContextComputer::compute → NO_COVERAGE
				.compute(openCLExecutionContext, kernelName, generation, genotypes);
215 2 1. beforeEvaluation : removed call to java/util/Map::put → NO_COVERAGE
2. beforeEvaluation : replaced call to java/util/Map::put with argument → NO_COVERAGE
		kernelExecutionContexts.put(device, kernelExecutionContext);
216
217 2 1. beforeEvaluation : replaced call to java/util/Map::get with argument → NO_COVERAGE
2. beforeEvaluation : removed call to java/util/Map::get → NO_COVERAGE
		final var mapData = staticData.get(device);
218 4 1. beforeEvaluation : removed conditional - replaced equality check with false → NO_COVERAGE
2. beforeEvaluation : removed conditional - replaced equality check with true → NO_COVERAGE
3. beforeEvaluation : removed call to org/apache/commons/collections4/MapUtils::isNotEmpty → NO_COVERAGE
4. beforeEvaluation : negated conditional → NO_COVERAGE
		if (MapUtils.isNotEmpty(mapData)) {
219 1 1. beforeEvaluation : removed call to java/util/Map::entrySet → NO_COVERAGE
			for (final var entry : mapData.entrySet()) {
220 2 1. beforeEvaluation : removed call to java/lang/Integer::intValue → NO_COVERAGE
2. beforeEvaluation : removed call to java/util/Map$Entry::getKey → NO_COVERAGE
				final int argumentIdx = entry.getKey();
221 1 1. beforeEvaluation : removed call to java/util/Map$Entry::getValue → NO_COVERAGE
				final var clStaticData = entry.getValue();
222
223
				logger.trace("[{}] Loading static data for index {}", device.name(), argumentIdx);
224
225 4 1. beforeEvaluation : removed call to org/jocl/Pointer::to → NO_COVERAGE
2. beforeEvaluation : removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/CLData::clMem → NO_COVERAGE
3. beforeEvaluation : removed call to org/jocl/CL::clSetKernelArg → NO_COVERAGE
4. beforeEvaluation : replaced call to org/jocl/CL::clSetKernelArg with argument → NO_COVERAGE
				CL.clSetKernelArg(kernel, argumentIdx, Sizeof.cl_mem, Pointer.to(clStaticData.clMem()));
226
			}
227
		}
228
229 1 1. beforeEvaluation : removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitnessDescriptor::dataLoaders → NO_COVERAGE
		final var dataLoaders = singleKernelFitnessDescriptor.dataLoaders();
230 4 1. beforeEvaluation : removed conditional - replaced equality check with false → NO_COVERAGE
2. beforeEvaluation : removed conditional - replaced equality check with true → NO_COVERAGE
3. beforeEvaluation : removed call to org/apache/commons/collections4/MapUtils::isNotEmpty → NO_COVERAGE
4. beforeEvaluation : negated conditional → NO_COVERAGE
		if (MapUtils.isNotEmpty(dataLoaders)) {
231 1 1. beforeEvaluation : removed call to java/util/Map::entrySet → NO_COVERAGE
			for (final var entry : dataLoaders.entrySet()) {
232 2 1. beforeEvaluation : removed call to java/lang/Integer::intValue → NO_COVERAGE
2. beforeEvaluation : removed call to java/util/Map$Entry::getKey → NO_COVERAGE
				final int argumentIdx = entry.getKey();
233 1 1. beforeEvaluation : removed call to java/util/Map$Entry::getValue → NO_COVERAGE
				final var dataLoader = entry.getValue();
234
235 1 1. beforeEvaluation : removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/DataLoader::load → NO_COVERAGE
				final var clDdata = dataLoader.load(openCLExecutionContext, generation, genotypes);
236
237 4 1. beforeEvaluation : removed call to java/util/Map::computeIfAbsent → NO_COVERAGE
2. lambda$beforeEvaluation$1 : removed call to java/util/HashMap::<init> → NO_COVERAGE
3. beforeEvaluation : replaced call to java/util/Map::computeIfAbsent with argument → NO_COVERAGE
4. lambda$beforeEvaluation$1 : replaced return value with Collections.emptyMap for net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::lambda$beforeEvaluation$1 → NO_COVERAGE
				final var dataMapping = data.computeIfAbsent(device, k -> new HashMap<>());
238 6 1. beforeEvaluation : replaced call to java/util/Map::put with argument → NO_COVERAGE
2. beforeEvaluation : removed conditional - replaced equality check with false → NO_COVERAGE
3. beforeEvaluation : removed conditional - replaced equality check with true → NO_COVERAGE
4. beforeEvaluation : removed call to java/util/Map::put → NO_COVERAGE
5. beforeEvaluation : removed call to java/lang/Integer::valueOf → NO_COVERAGE
6. beforeEvaluation : negated conditional → NO_COVERAGE
				if (dataMapping.put(argumentIdx, clDdata) != null) {
239 1 1. beforeEvaluation : removed call to java/lang/IllegalArgumentException::<init> → NO_COVERAGE
					throw new IllegalArgumentException("Multiple data configured for index " + argumentIdx);
240
				}
241
				logger.trace("[{}] Loading data for index {}", device.name(), argumentIdx);
242
243 4 1. beforeEvaluation : removed call to org/jocl/CL::clSetKernelArg → NO_COVERAGE
2. beforeEvaluation : removed call to org/jocl/Pointer::to → NO_COVERAGE
3. beforeEvaluation : removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/CLData::clMem → NO_COVERAGE
4. beforeEvaluation : replaced call to org/jocl/CL::clSetKernelArg with argument → NO_COVERAGE
				CL.clSetKernelArg(kernel, argumentIdx, Sizeof.cl_mem, Pointer.to(clDdata.clMem()));
244
			}
245
		}
246
247 1 1. beforeEvaluation : removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitnessDescriptor::localMemoryAllocators → NO_COVERAGE
		final var localMemoryAllocators = singleKernelFitnessDescriptor.localMemoryAllocators();
248 4 1. beforeEvaluation : negated conditional → NO_COVERAGE
2. beforeEvaluation : removed conditional - replaced equality check with false → NO_COVERAGE
3. beforeEvaluation : removed conditional - replaced equality check with true → NO_COVERAGE
4. beforeEvaluation : removed call to org/apache/commons/collections4/MapUtils::isNotEmpty → NO_COVERAGE
		if (MapUtils.isNotEmpty(localMemoryAllocators)) {
249 1 1. beforeEvaluation : removed call to java/util/Map::entrySet → NO_COVERAGE
			for (final var entry : localMemoryAllocators.entrySet()) {
250 2 1. beforeEvaluation : removed call to java/lang/Integer::intValue → NO_COVERAGE
2. beforeEvaluation : removed call to java/util/Map$Entry::getKey → NO_COVERAGE
				final int argumentIdx = entry.getKey();
251 1 1. beforeEvaluation : removed call to java/util/Map$Entry::getValue → NO_COVERAGE
				final var localMemoryAllocator = entry.getValue();
252
253
				final var size = localMemoryAllocator
254 2 1. beforeEvaluation : replaced call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocator::load with argument → NO_COVERAGE
2. beforeEvaluation : removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocator::load → NO_COVERAGE
						.load(openCLExecutionContext, kernelExecutionContext, generation, genotypes);
255
				logger.trace("[{}] Setting local data for index {} with size of {}", device.name(), argumentIdx, size);
256
257 2 1. beforeEvaluation : removed call to org/jocl/CL::clSetKernelArg → NO_COVERAGE
2. beforeEvaluation : replaced call to org/jocl/CL::clSetKernelArg with argument → NO_COVERAGE
				CL.clSetKernelArg(kernel, argumentIdx, size, null);
258
			}
259
		}
260
261 1 1. beforeEvaluation : removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitnessDescriptor::resultAllocators → NO_COVERAGE
		final var resultAllocators = singleKernelFitnessDescriptor.resultAllocators();
262 4 1. beforeEvaluation : negated conditional → NO_COVERAGE
2. beforeEvaluation : removed conditional - replaced equality check with false → NO_COVERAGE
3. beforeEvaluation : removed conditional - replaced equality check with true → NO_COVERAGE
4. beforeEvaluation : removed call to org/apache/commons/collections4/MapUtils::isNotEmpty → NO_COVERAGE
		if (MapUtils.isNotEmpty(resultAllocators)) {
263 1 1. beforeEvaluation : removed call to java/util/Map::entrySet → NO_COVERAGE
			for (final var entry : resultAllocators.entrySet()) {
264 2 1. beforeEvaluation : removed call to java/util/Map$Entry::getKey → NO_COVERAGE
2. beforeEvaluation : removed call to java/lang/Integer::intValue → NO_COVERAGE
				final int argumentIdx = entry.getKey();
265 1 1. beforeEvaluation : removed call to java/util/Map$Entry::getValue → NO_COVERAGE
				final var resultAllocator = entry.getValue();
266
267
				final var clDdata = resultAllocator
268 1 1. beforeEvaluation : removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/ResultAllocator::load → NO_COVERAGE
						.load(openCLExecutionContext, kernelExecutionContext, generation, genotypes);
269
270 4 1. lambda$beforeEvaluation$2 : removed call to java/util/HashMap::<init> → NO_COVERAGE
2. lambda$beforeEvaluation$2 : replaced return value with Collections.emptyMap for net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::lambda$beforeEvaluation$2 → NO_COVERAGE
3. beforeEvaluation : removed call to java/util/Map::computeIfAbsent → NO_COVERAGE
4. beforeEvaluation : replaced call to java/util/Map::computeIfAbsent with argument → NO_COVERAGE
				final var dataMapping = resultData.computeIfAbsent(device, k -> new HashMap<>());
271 6 1. beforeEvaluation : removed conditional - replaced equality check with false → NO_COVERAGE
2. beforeEvaluation : removed call to java/lang/Integer::valueOf → NO_COVERAGE
3. beforeEvaluation : removed conditional - replaced equality check with true → NO_COVERAGE
4. beforeEvaluation : removed call to java/util/Map::put → NO_COVERAGE
5. beforeEvaluation : negated conditional → NO_COVERAGE
6. beforeEvaluation : replaced call to java/util/Map::put with argument → NO_COVERAGE
				if (dataMapping.put(argumentIdx, clDdata) != null) {
272 1 1. beforeEvaluation : removed call to java/lang/IllegalArgumentException::<init> → NO_COVERAGE
					throw new IllegalArgumentException("Multiple result allocators configured for index " + argumentIdx);
273
				}
274
				logger.trace("[{}] Preparing result data memory for index {}", device.name(), argumentIdx);
275
276 4 1. beforeEvaluation : removed call to org/jocl/CL::clSetKernelArg → NO_COVERAGE
2. beforeEvaluation : removed call to org/jocl/Pointer::to → NO_COVERAGE
3. beforeEvaluation : removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/CLData::clMem → NO_COVERAGE
4. beforeEvaluation : replaced call to org/jocl/CL::clSetKernelArg with argument → NO_COVERAGE
				CL.clSetKernelArg(kernel, argumentIdx, Sizeof.cl_mem, Pointer.to(clDdata.clMem()));
277
			}
278
		}
279
280
	}
281
282
	@Override
283
	public CompletableFuture<List<T>> compute(final OpenCLExecutionContext openCLExecutionContext,
284
			final ExecutorService executorService, final long generation, List<Genotype> genotypes) {
285
286 2 1. compute : removed call to java/util/concurrent/CompletableFuture::supplyAsync → NO_COVERAGE
2. compute : replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::compute → NO_COVERAGE
		return CompletableFuture.supplyAsync(() -> {
287 1 1. lambda$compute$3 : removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::clCommandQueue → NO_COVERAGE
			final var clCommandQueue = openCLExecutionContext.clCommandQueue();
288 1 1. lambda$compute$3 : removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::kernels → NO_COVERAGE
			final var kernels = openCLExecutionContext.kernels();
289
290 1 1. lambda$compute$3 : removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitnessDescriptor::kernelName → NO_COVERAGE
			final var kernelName = singleKernelFitnessDescriptor.kernelName();
291 2 1. lambda$compute$3 : replaced call to java/util/Map::get with argument → NO_COVERAGE
2. lambda$compute$3 : removed call to java/util/Map::get → NO_COVERAGE
			final var kernel = kernels.get(kernelName);
292 3 1. lambda$compute$3 : removed conditional - replaced equality check with false → NO_COVERAGE
2. lambda$compute$3 : negated conditional → NO_COVERAGE
3. lambda$compute$3 : removed conditional - replaced equality check with true → NO_COVERAGE
			if (kernel == null) {
293 1 1. lambda$compute$3 : removed call to java/lang/IllegalStateException::<init> → NO_COVERAGE
				throw new IllegalStateException("Could not find kernel [" + kernelName + "]");
294
			}
295
296 1 1. lambda$compute$3 : removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::device → NO_COVERAGE
			final var device = openCLExecutionContext.device();
297 2 1. lambda$compute$3 : removed call to java/util/Map::get → NO_COVERAGE
2. lambda$compute$3 : replaced call to java/util/Map::get with argument → NO_COVERAGE
			final var kernelExecutionContext = kernelExecutionContexts.get(device);
298
299 1 1. lambda$compute$3 : removed call to net/bmahe/genetics4j/gpu/spec/fitness/kernelcontext/KernelExecutionContext::globalWorkDimensions → NO_COVERAGE
			final var globalWorkDimensions = kernelExecutionContext.globalWorkDimensions();
300 1 1. lambda$compute$3 : removed call to net/bmahe/genetics4j/gpu/spec/fitness/kernelcontext/KernelExecutionContext::globalWorkSize → NO_COVERAGE
			final var globalWorkSize = kernelExecutionContext.globalWorkSize();
301 3 1. lambda$compute$3 : removed call to java/util/Optional::orElse → NO_COVERAGE
2. lambda$compute$3 : removed call to net/bmahe/genetics4j/gpu/spec/fitness/kernelcontext/KernelExecutionContext::workGroupSize → NO_COVERAGE
3. lambda$compute$3 : replaced call to java/util/Optional::orElse with argument → NO_COVERAGE
			final long[] workGroupSize = kernelExecutionContext.workGroupSize().orElse(null);
302
303
			logger.trace(
304
					"Starting computation on kernel {} for {} genotypes and global work size {} and local work size {}",
305
						kernelName,
306 2 1. lambda$compute$3 : removed call to java/util/List::size → NO_COVERAGE
2. lambda$compute$3 : removed call to java/lang/Integer::valueOf → NO_COVERAGE
						genotypes.size(),
307
						globalWorkSize,
308
						workGroupSize);
309 1 1. lambda$compute$3 : removed call to java/lang/System::nanoTime → NO_COVERAGE
			final long startTime = System.nanoTime();
310 3 1. lambda$compute$3 : removed call to org/jocl/CL::clEnqueueNDRangeKernel → NO_COVERAGE
2. lambda$compute$3 : replaced call to org/jocl/CL::clEnqueueNDRangeKernel with argument → NO_COVERAGE
3. lambda$compute$3 : Substituted 0 with 1 → NO_COVERAGE
			CL.clEnqueueNDRangeKernel(
311
					clCommandQueue,
312
						kernel,
313
						globalWorkDimensions,
314
						null,
315
						globalWorkSize,
316
						workGroupSize,
317
						0,
318
						null,
319
						null);
320
321 1 1. lambda$compute$3 : removed call to java/lang/System::nanoTime → NO_COVERAGE
			final long endTime = System.nanoTime();
322 1 1. lambda$compute$3 : Replaced long subtraction with addition → NO_COVERAGE
			final long duration = endTime - startTime;
323
			if (logger.isDebugEnabled()) {
324 2 1. lambda$compute$3 : removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::device → NO_COVERAGE
2. lambda$compute$3 : removed call to net/bmahe/genetics4j/gpu/opencl/model/Device::name → NO_COVERAGE
				final var deviceName = openCLExecutionContext.device().name();
325
				logger.debug("{} - Took {} microsec for {} genotypes", deviceName, duration / 1000., genotypes.size());
326
			}
327 1 1. lambda$compute$3 : replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::lambda$compute$3 → NO_COVERAGE
			return kernelExecutionContext;
328 2 1. compute : replaced call to java/util/concurrent/CompletableFuture::thenApply with receiver → NO_COVERAGE
2. compute : removed call to java/util/concurrent/CompletableFuture::thenApply → NO_COVERAGE
		}, executorService).thenApply(kernelExecutionContext -> {
329
330 1 1. lambda$compute$4 : removed call to net/bmahe/genetics4j/gpu/spec/fitness/ResultExtractor::<init> → NO_COVERAGE
			final var resultExtractor = new ResultExtractor(resultData);
331 3 1. lambda$compute$4 : removed call to net/bmahe/genetics4j/gpu/spec/fitness/FitnessExtractor::compute → NO_COVERAGE
2. lambda$compute$4 : replaced return value with Collections.emptyList for net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::lambda$compute$4 → NO_COVERAGE
3. lambda$compute$4 : replaced call to net/bmahe/genetics4j/gpu/spec/fitness/FitnessExtractor::compute with argument → NO_COVERAGE
			return fitnessExtractor.compute(
332
					openCLExecutionContext,
333
						kernelExecutionContext,
334
						executorService,
335
						generation,
336
						genotypes,
337
						resultExtractor);
338
		});
339
	}
340
341
	@Override
342
	public void afterEvaluation(OpenCLExecutionContext openCLExecutionContext, ExecutorService executorService,
343
			long generation, List<Genotype> genotypes) {
344 1 1. afterEvaluation : removed call to net/bmahe/genetics4j/gpu/spec/fitness/OpenCLFitness::afterEvaluation → NO_COVERAGE
		super.afterEvaluation(openCLExecutionContext, executorService, generation, genotypes);
345
346 1 1. afterEvaluation : removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::device → NO_COVERAGE
		final var device = openCLExecutionContext.device();
347
		logger.trace("[{}] Releasing data", device.name());
348 1 1. afterEvaluation : removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::clearData → NO_COVERAGE
		clearData(device);
349 1 1. afterEvaluation : removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::clearResultData → NO_COVERAGE
		clearResultData(device);
350 2 1. afterEvaluation : removed call to java/util/Map::remove → NO_COVERAGE
2. afterEvaluation : replaced call to java/util/Map::remove with argument → NO_COVERAGE
		kernelExecutionContexts.remove(device);
351
	}
352
353
	@Override
354
	public void afterAllEvaluations(final OpenCLExecutionContext openCLExecutionContext,
355
			final ExecutorService executorService) {
356 1 1. afterAllEvaluations : removed call to net/bmahe/genetics4j/gpu/spec/fitness/OpenCLFitness::afterAllEvaluations → NO_COVERAGE
		super.afterAllEvaluations(openCLExecutionContext, executorService);
357
358 1 1. afterAllEvaluations : removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::device → NO_COVERAGE
		final var device = openCLExecutionContext.device();
359
		logger.trace("[{}] Releasing static data", device.name());
360 1 1. afterAllEvaluations : removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::clearStaticData → NO_COVERAGE
		clearStaticData(device);
361
	}
362
363
	/**
364
	 * Creates a new SingleKernelFitness instance with the specified configuration.
365
	 * 
366
	 * @param <U>                           the fitness value type
367
	 * @param singleKernelFitnessDescriptor configuration for kernel execution and data management
368
	 * @param fitnessExtractor              function to extract fitness values from GPU computation results
369
	 * @return a new SingleKernelFitness instance
370
	 * @throws IllegalArgumentException if any parameter is null
371
	 */
372
	public static <U extends Comparable<U>> SingleKernelFitness<U> of(
373
			final SingleKernelFitnessDescriptor singleKernelFitnessDescriptor,
374
			final FitnessExtractor<U> fitnessExtractor) {
375
		Validate.notNull(singleKernelFitnessDescriptor);
376
		Validate.notNull(fitnessExtractor);
377
378 2 1. of : replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::of → NO_COVERAGE
2. of : removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::<init> → NO_COVERAGE
		return new SingleKernelFitness<>(singleKernelFitnessDescriptor, fitnessExtractor);
379
	}
380
}

Mutations

108

1.1
Location : <init>
Killed by : none
removed call to java/util/concurrent/ConcurrentHashMap::<init> → NO_COVERAGE

2.2
Location : <init>
Killed by : none
Removed assignment to member variable staticData → NO_COVERAGE

109

1.1
Location : <init>
Killed by : none
Removed assignment to member variable data → NO_COVERAGE

2.2
Location : <init>
Killed by : none
removed call to java/util/concurrent/ConcurrentHashMap::<init> → NO_COVERAGE

110

1.1
Location : <init>
Killed by : none
removed call to java/util/concurrent/ConcurrentHashMap::<init> → NO_COVERAGE

2.2
Location : <init>
Killed by : none
Removed assignment to member variable resultData → NO_COVERAGE

112

1.1
Location : <init>
Killed by : none
removed call to java/util/concurrent/ConcurrentHashMap::<init> → NO_COVERAGE

2.2
Location : <init>
Killed by : none
Removed assignment to member variable kernelExecutionContexts → NO_COVERAGE

115

1.1
Location : clearStaticData
Killed by : none
replaced call to java/util/Map::get with argument → NO_COVERAGE

2.2
Location : clearStaticData
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

3.3
Location : clearStaticData
Killed by : none
removed call to org/apache/commons/collections4/MapUtils::isEmpty → NO_COVERAGE

4.4
Location : clearStaticData
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

5.5
Location : clearStaticData
Killed by : none
negated conditional → NO_COVERAGE

6.6
Location : clearStaticData
Killed by : none
removed call to java/util/Map::get → NO_COVERAGE

7.7
Location : clearStaticData
Killed by : none
negated conditional → NO_COVERAGE

8.8
Location : clearStaticData
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

9.9
Location : clearStaticData
Killed by : none
removed call to org/apache/commons/collections4/MapUtils::isEmpty → NO_COVERAGE

10.10
Location : clearStaticData
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

119

1.1
Location : clearStaticData
Killed by : none
replaced call to java/util/Map::get with argument → NO_COVERAGE

2.2
Location : clearStaticData
Killed by : none
removed call to java/util/Map::get → NO_COVERAGE

120

1.1
Location : clearStaticData
Killed by : none
removed call to java/util/Map::values → NO_COVERAGE

121

1.1
Location : clearStaticData
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/CLData::clMem → NO_COVERAGE

2.2
Location : clearStaticData
Killed by : none
removed call to org/jocl/CL::clReleaseMemObject → NO_COVERAGE

124

1.1
Location : clearStaticData
Killed by : none
removed call to java/util/Map::clear → NO_COVERAGE

125

1.1
Location : clearStaticData
Killed by : none
removed call to java/util/Map::remove → NO_COVERAGE

2.2
Location : clearStaticData
Killed by : none
replaced call to java/util/Map::remove with argument → NO_COVERAGE

129

1.1
Location : clearData
Killed by : none
replaced call to java/util/Map::get with argument → NO_COVERAGE

2.2
Location : clearData
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

3.3
Location : clearData
Killed by : none
removed call to org/apache/commons/collections4/MapUtils::isEmpty → NO_COVERAGE

4.4
Location : clearData
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

5.5
Location : clearData
Killed by : none
negated conditional → NO_COVERAGE

6.6
Location : clearData
Killed by : none
negated conditional → NO_COVERAGE

7.7
Location : clearData
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

8.8
Location : clearData
Killed by : none
removed call to org/apache/commons/collections4/MapUtils::isEmpty → NO_COVERAGE

9.9
Location : clearData
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

10.10
Location : clearData
Killed by : none
removed call to java/util/Map::get → NO_COVERAGE

133

1.1
Location : clearData
Killed by : none
replaced call to java/util/Map::get with argument → NO_COVERAGE

2.2
Location : clearData
Killed by : none
removed call to java/util/Map::get → NO_COVERAGE

134

1.1
Location : clearData
Killed by : none
removed call to java/util/Map::values → NO_COVERAGE

135

1.1
Location : clearData
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/CLData::clMem → NO_COVERAGE

2.2
Location : clearData
Killed by : none
removed call to org/jocl/CL::clReleaseMemObject → NO_COVERAGE

138

1.1
Location : clearData
Killed by : none
removed call to java/util/Map::clear → NO_COVERAGE

139

1.1
Location : clearData
Killed by : none
removed call to java/util/Map::remove → NO_COVERAGE

2.2
Location : clearData
Killed by : none
replaced call to java/util/Map::remove with argument → NO_COVERAGE

143

1.1
Location : clearResultData
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

2.2
Location : clearResultData
Killed by : none
removed call to org/apache/commons/collections4/MapUtils::isEmpty → NO_COVERAGE

3.3
Location : clearResultData
Killed by : none
replaced call to java/util/Map::get with argument → NO_COVERAGE

4.4
Location : clearResultData
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

5.5
Location : clearResultData
Killed by : none
removed call to java/util/Map::get → NO_COVERAGE

6.6
Location : clearResultData
Killed by : none
negated conditional → NO_COVERAGE

7.7
Location : clearResultData
Killed by : none
removed call to org/apache/commons/collections4/MapUtils::isEmpty → NO_COVERAGE

8.8
Location : clearResultData
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

9.9
Location : clearResultData
Killed by : none
negated conditional → NO_COVERAGE

10.10
Location : clearResultData
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

147

1.1
Location : clearResultData
Killed by : none
replaced call to java/util/Map::get with argument → NO_COVERAGE

2.2
Location : clearResultData
Killed by : none
removed call to java/util/Map::get → NO_COVERAGE

148

1.1
Location : clearResultData
Killed by : none
removed call to java/util/Map::values → NO_COVERAGE

149

1.1
Location : clearResultData
Killed by : none
removed call to org/jocl/CL::clReleaseMemObject → NO_COVERAGE

2.2
Location : clearResultData
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/CLData::clMem → NO_COVERAGE

152

1.1
Location : clearResultData
Killed by : none
removed call to java/util/Map::clear → NO_COVERAGE

153

1.1
Location : clearResultData
Killed by : none
removed call to java/util/Map::remove → NO_COVERAGE

2.2
Location : clearResultData
Killed by : none
replaced call to java/util/Map::remove with argument → NO_COVERAGE

168

1.1
Location : <init>
Killed by : none
Removed assignment to member variable singleKernelFitnessDescriptor → NO_COVERAGE

169

1.1
Location : <init>
Killed by : none
Removed assignment to member variable fitnessExtractor → NO_COVERAGE

175

1.1
Location : beforeAllEvaluations
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/OpenCLFitness::beforeAllEvaluations → NO_COVERAGE

177

1.1
Location : beforeAllEvaluations
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::device → NO_COVERAGE

178

1.1
Location : beforeAllEvaluations
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::clearStaticData → NO_COVERAGE

180

1.1
Location : beforeAllEvaluations
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitnessDescriptor::staticDataLoaders → NO_COVERAGE

181

1.1
Location : beforeAllEvaluations
Killed by : none
removed call to java/util/Map::entrySet → NO_COVERAGE

182

1.1
Location : beforeAllEvaluations
Killed by : none
removed call to java/util/Map$Entry::getKey → NO_COVERAGE

2.2
Location : beforeAllEvaluations
Killed by : none
removed call to java/lang/Integer::intValue → NO_COVERAGE

183

1.1
Location : beforeAllEvaluations
Killed by : none
removed call to java/util/Map$Entry::getValue → NO_COVERAGE

186

1.1
Location : beforeAllEvaluations
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::device → NO_COVERAGE

2.2
Location : beforeAllEvaluations
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/model/Device::name → NO_COVERAGE

189

1.1
Location : beforeAllEvaluations
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/StaticDataLoader::load → NO_COVERAGE

191

1.1
Location : beforeAllEvaluations
Killed by : none
removed call to java/util/Map::computeIfAbsent → NO_COVERAGE

2.2
Location : beforeAllEvaluations
Killed by : none
replaced call to java/util/Map::computeIfAbsent with argument → NO_COVERAGE

3.3
Location : lambda$beforeAllEvaluations$0
Killed by : none
removed call to java/util/HashMap::<init> → NO_COVERAGE

4.4
Location : lambda$beforeAllEvaluations$0
Killed by : none
replaced return value with Collections.emptyMap for net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::lambda$beforeAllEvaluations$0 → NO_COVERAGE

192

1.1
Location : beforeAllEvaluations
Killed by : none
replaced call to java/util/Map::put with argument → NO_COVERAGE

2.2
Location : beforeAllEvaluations
Killed by : none
removed call to java/lang/Integer::valueOf → NO_COVERAGE

3.3
Location : beforeAllEvaluations
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

4.4
Location : beforeAllEvaluations
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

5.5
Location : beforeAllEvaluations
Killed by : none
negated conditional → NO_COVERAGE

6.6
Location : beforeAllEvaluations
Killed by : none
removed call to java/util/Map::put → NO_COVERAGE

193

1.1
Location : beforeAllEvaluations
Killed by : none
removed call to java/lang/IllegalArgumentException::<init> → NO_COVERAGE

201

1.1
Location : beforeEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/OpenCLFitness::beforeEvaluation → NO_COVERAGE

203

1.1
Location : beforeEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::device → NO_COVERAGE

204

1.1
Location : beforeEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::kernels → NO_COVERAGE

206

1.1
Location : beforeEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitnessDescriptor::kernelName → NO_COVERAGE

207

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map::get → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
replaced call to java/util/Map::get with argument → NO_COVERAGE

209

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map::containsKey → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : beforeEvaluation
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

4.4
Location : beforeEvaluation
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

210

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/lang/IllegalStateException::<init> → NO_COVERAGE

212

1.1
Location : beforeEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitnessDescriptor::kernelExecutionContextComputer → NO_COVERAGE

214

1.1
Location : beforeEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/kernelcontext/KernelExecutionContextComputer::compute → NO_COVERAGE

215

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map::put → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
replaced call to java/util/Map::put with argument → NO_COVERAGE

217

1.1
Location : beforeEvaluation
Killed by : none
replaced call to java/util/Map::get with argument → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map::get → NO_COVERAGE

218

1.1
Location : beforeEvaluation
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

3.3
Location : beforeEvaluation
Killed by : none
removed call to org/apache/commons/collections4/MapUtils::isNotEmpty → NO_COVERAGE

4.4
Location : beforeEvaluation
Killed by : none
negated conditional → NO_COVERAGE

219

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map::entrySet → NO_COVERAGE

220

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/lang/Integer::intValue → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map$Entry::getKey → NO_COVERAGE

221

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map$Entry::getValue → NO_COVERAGE

225

1.1
Location : beforeEvaluation
Killed by : none
removed call to org/jocl/Pointer::to → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/CLData::clMem → NO_COVERAGE

3.3
Location : beforeEvaluation
Killed by : none
removed call to org/jocl/CL::clSetKernelArg → NO_COVERAGE

4.4
Location : beforeEvaluation
Killed by : none
replaced call to org/jocl/CL::clSetKernelArg with argument → NO_COVERAGE

229

1.1
Location : beforeEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitnessDescriptor::dataLoaders → NO_COVERAGE

230

1.1
Location : beforeEvaluation
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

3.3
Location : beforeEvaluation
Killed by : none
removed call to org/apache/commons/collections4/MapUtils::isNotEmpty → NO_COVERAGE

4.4
Location : beforeEvaluation
Killed by : none
negated conditional → NO_COVERAGE

231

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map::entrySet → NO_COVERAGE

232

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/lang/Integer::intValue → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map$Entry::getKey → NO_COVERAGE

233

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map$Entry::getValue → NO_COVERAGE

235

1.1
Location : beforeEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/DataLoader::load → NO_COVERAGE

237

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map::computeIfAbsent → NO_COVERAGE

2.2
Location : lambda$beforeEvaluation$1
Killed by : none
removed call to java/util/HashMap::<init> → NO_COVERAGE

3.3
Location : beforeEvaluation
Killed by : none
replaced call to java/util/Map::computeIfAbsent with argument → NO_COVERAGE

4.4
Location : lambda$beforeEvaluation$1
Killed by : none
replaced return value with Collections.emptyMap for net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::lambda$beforeEvaluation$1 → NO_COVERAGE

238

1.1
Location : beforeEvaluation
Killed by : none
replaced call to java/util/Map::put with argument → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

3.3
Location : beforeEvaluation
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

4.4
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map::put → NO_COVERAGE

5.5
Location : beforeEvaluation
Killed by : none
removed call to java/lang/Integer::valueOf → NO_COVERAGE

6.6
Location : beforeEvaluation
Killed by : none
negated conditional → NO_COVERAGE

239

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/lang/IllegalArgumentException::<init> → NO_COVERAGE

243

1.1
Location : beforeEvaluation
Killed by : none
removed call to org/jocl/CL::clSetKernelArg → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
removed call to org/jocl/Pointer::to → NO_COVERAGE

3.3
Location : beforeEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/CLData::clMem → NO_COVERAGE

4.4
Location : beforeEvaluation
Killed by : none
replaced call to org/jocl/CL::clSetKernelArg with argument → NO_COVERAGE

247

1.1
Location : beforeEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitnessDescriptor::localMemoryAllocators → NO_COVERAGE

248

1.1
Location : beforeEvaluation
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

3.3
Location : beforeEvaluation
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

4.4
Location : beforeEvaluation
Killed by : none
removed call to org/apache/commons/collections4/MapUtils::isNotEmpty → NO_COVERAGE

249

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map::entrySet → NO_COVERAGE

250

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/lang/Integer::intValue → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map$Entry::getKey → NO_COVERAGE

251

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map$Entry::getValue → NO_COVERAGE

254

1.1
Location : beforeEvaluation
Killed by : none
replaced call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocator::load with argument → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/LocalMemoryAllocator::load → NO_COVERAGE

257

1.1
Location : beforeEvaluation
Killed by : none
removed call to org/jocl/CL::clSetKernelArg → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
replaced call to org/jocl/CL::clSetKernelArg with argument → NO_COVERAGE

261

1.1
Location : beforeEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitnessDescriptor::resultAllocators → NO_COVERAGE

262

1.1
Location : beforeEvaluation
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

3.3
Location : beforeEvaluation
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

4.4
Location : beforeEvaluation
Killed by : none
removed call to org/apache/commons/collections4/MapUtils::isNotEmpty → NO_COVERAGE

263

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map::entrySet → NO_COVERAGE

264

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map$Entry::getKey → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
removed call to java/lang/Integer::intValue → NO_COVERAGE

265

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map$Entry::getValue → NO_COVERAGE

268

1.1
Location : beforeEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/ResultAllocator::load → NO_COVERAGE

270

1.1
Location : lambda$beforeEvaluation$2
Killed by : none
removed call to java/util/HashMap::<init> → NO_COVERAGE

2.2
Location : lambda$beforeEvaluation$2
Killed by : none
replaced return value with Collections.emptyMap for net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::lambda$beforeEvaluation$2 → NO_COVERAGE

3.3
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map::computeIfAbsent → NO_COVERAGE

4.4
Location : beforeEvaluation
Killed by : none
replaced call to java/util/Map::computeIfAbsent with argument → NO_COVERAGE

271

1.1
Location : beforeEvaluation
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
removed call to java/lang/Integer::valueOf → NO_COVERAGE

3.3
Location : beforeEvaluation
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

4.4
Location : beforeEvaluation
Killed by : none
removed call to java/util/Map::put → NO_COVERAGE

5.5
Location : beforeEvaluation
Killed by : none
negated conditional → NO_COVERAGE

6.6
Location : beforeEvaluation
Killed by : none
replaced call to java/util/Map::put with argument → NO_COVERAGE

272

1.1
Location : beforeEvaluation
Killed by : none
removed call to java/lang/IllegalArgumentException::<init> → NO_COVERAGE

276

1.1
Location : beforeEvaluation
Killed by : none
removed call to org/jocl/CL::clSetKernelArg → NO_COVERAGE

2.2
Location : beforeEvaluation
Killed by : none
removed call to org/jocl/Pointer::to → NO_COVERAGE

3.3
Location : beforeEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/cldata/CLData::clMem → NO_COVERAGE

4.4
Location : beforeEvaluation
Killed by : none
replaced call to org/jocl/CL::clSetKernelArg with argument → NO_COVERAGE

286

1.1
Location : compute
Killed by : none
removed call to java/util/concurrent/CompletableFuture::supplyAsync → NO_COVERAGE

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

287

1.1
Location : lambda$compute$3
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::clCommandQueue → NO_COVERAGE

288

1.1
Location : lambda$compute$3
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::kernels → NO_COVERAGE

290

1.1
Location : lambda$compute$3
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitnessDescriptor::kernelName → NO_COVERAGE

291

1.1
Location : lambda$compute$3
Killed by : none
replaced call to java/util/Map::get with argument → NO_COVERAGE

2.2
Location : lambda$compute$3
Killed by : none
removed call to java/util/Map::get → NO_COVERAGE

292

1.1
Location : lambda$compute$3
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

2.2
Location : lambda$compute$3
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : lambda$compute$3
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

293

1.1
Location : lambda$compute$3
Killed by : none
removed call to java/lang/IllegalStateException::<init> → NO_COVERAGE

296

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

297

1.1
Location : lambda$compute$3
Killed by : none
removed call to java/util/Map::get → NO_COVERAGE

2.2
Location : lambda$compute$3
Killed by : none
replaced call to java/util/Map::get with argument → NO_COVERAGE

299

1.1
Location : lambda$compute$3
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/kernelcontext/KernelExecutionContext::globalWorkDimensions → NO_COVERAGE

300

1.1
Location : lambda$compute$3
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/kernelcontext/KernelExecutionContext::globalWorkSize → NO_COVERAGE

301

1.1
Location : lambda$compute$3
Killed by : none
removed call to java/util/Optional::orElse → NO_COVERAGE

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

3.3
Location : lambda$compute$3
Killed by : none
replaced call to java/util/Optional::orElse with argument → NO_COVERAGE

306

1.1
Location : lambda$compute$3
Killed by : none
removed call to java/util/List::size → NO_COVERAGE

2.2
Location : lambda$compute$3
Killed by : none
removed call to java/lang/Integer::valueOf → NO_COVERAGE

309

1.1
Location : lambda$compute$3
Killed by : none
removed call to java/lang/System::nanoTime → NO_COVERAGE

310

1.1
Location : lambda$compute$3
Killed by : none
removed call to org/jocl/CL::clEnqueueNDRangeKernel → NO_COVERAGE

2.2
Location : lambda$compute$3
Killed by : none
replaced call to org/jocl/CL::clEnqueueNDRangeKernel with argument → NO_COVERAGE

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

321

1.1
Location : lambda$compute$3
Killed by : none
removed call to java/lang/System::nanoTime → NO_COVERAGE

322

1.1
Location : lambda$compute$3
Killed by : none
Replaced long subtraction with addition → NO_COVERAGE

324

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

2.2
Location : lambda$compute$3
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/model/Device::name → NO_COVERAGE

327

1.1
Location : lambda$compute$3
Killed by : none
replaced return value with null for net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::lambda$compute$3 → NO_COVERAGE

328

1.1
Location : compute
Killed by : none
replaced call to java/util/concurrent/CompletableFuture::thenApply with receiver → NO_COVERAGE

2.2
Location : compute
Killed by : none
removed call to java/util/concurrent/CompletableFuture::thenApply → NO_COVERAGE

330

1.1
Location : lambda$compute$4
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/ResultExtractor::<init> → NO_COVERAGE

331

1.1
Location : lambda$compute$4
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/FitnessExtractor::compute → NO_COVERAGE

2.2
Location : lambda$compute$4
Killed by : none
replaced return value with Collections.emptyList for net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::lambda$compute$4 → NO_COVERAGE

3.3
Location : lambda$compute$4
Killed by : none
replaced call to net/bmahe/genetics4j/gpu/spec/fitness/FitnessExtractor::compute with argument → NO_COVERAGE

344

1.1
Location : afterEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/OpenCLFitness::afterEvaluation → NO_COVERAGE

346

1.1
Location : afterEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::device → NO_COVERAGE

348

1.1
Location : afterEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::clearData → NO_COVERAGE

349

1.1
Location : afterEvaluation
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::clearResultData → NO_COVERAGE

350

1.1
Location : afterEvaluation
Killed by : none
removed call to java/util/Map::remove → NO_COVERAGE

2.2
Location : afterEvaluation
Killed by : none
replaced call to java/util/Map::remove with argument → NO_COVERAGE

356

1.1
Location : afterAllEvaluations
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/OpenCLFitness::afterAllEvaluations → NO_COVERAGE

358

1.1
Location : afterAllEvaluations
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/OpenCLExecutionContext::device → NO_COVERAGE

360

1.1
Location : afterAllEvaluations
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::clearStaticData → NO_COVERAGE

378

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

2.2
Location : of
Killed by : none
removed call to net/bmahe/genetics4j/gpu/spec/fitness/SingleKernelFitness::<init> → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.20.3