PlatformReader.java

1
package net.bmahe.genetics4j.gpu.opencl;
2
3
import java.util.Objects;
4
5
import org.apache.commons.lang3.StringUtils;
6
import org.apache.logging.log4j.LogManager;
7
import org.apache.logging.log4j.Logger;
8
import org.jocl.CL;
9
import org.jocl.cl_platform_id;
10
11
import net.bmahe.genetics4j.gpu.opencl.model.Platform;
12
import net.bmahe.genetics4j.gpu.opencl.model.PlatformProfile;
13
14
public class PlatformReader {
15
	public static final Logger logger = LogManager.getLogger(PlatformReader.class);
16
17
	public static final String PROFILE_FULL_STR = "FULL_PROFILE";
18
	public static final String PROFILE_EMBEDDED = "EMBEDDED_PROFILE";
19
20
	public Platform read(final cl_platform_id platformId) {
21
		Objects.requireNonNull(platformId);
22
23 1 1. read : removed call to net/bmahe/genetics4j/gpu/opencl/model/Platform::builder → NO_COVERAGE
		final var platformBuilder = Platform.builder();
24
25 2 1. read : replaced call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::platformId with receiver → NO_COVERAGE
2. read : removed call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::platformId → NO_COVERAGE
		platformBuilder.platformId(platformId);
26
27 2 1. read : Substituted 2306 with 2307 → NO_COVERAGE
2. read : removed call to net/bmahe/genetics4j/gpu/opencl/PlatformUtils::getStringParameter → NO_COVERAGE
		final String platformName = PlatformUtils.getStringParameter(platformId, CL.CL_PLATFORM_NAME);
28 2 1. read : removed call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::name → NO_COVERAGE
2. read : replaced call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::name with receiver → NO_COVERAGE
		platformBuilder.name(platformName);
29
30 2 1. read : removed call to net/bmahe/genetics4j/gpu/opencl/PlatformUtils::getStringParameter → NO_COVERAGE
2. read : Substituted 2307 with 2308 → NO_COVERAGE
		final String platformVendor = PlatformUtils.getStringParameter(platformId, CL.CL_PLATFORM_VENDOR);
31 2 1. read : removed call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::vendor → NO_COVERAGE
2. read : replaced call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::vendor with receiver → NO_COVERAGE
		platformBuilder.vendor(platformVendor);
32
33 2 1. read : removed call to net/bmahe/genetics4j/gpu/opencl/PlatformUtils::getStringParameter → NO_COVERAGE
2. read : Substituted 2305 with 2306 → NO_COVERAGE
		final String platformVersion = PlatformUtils.getStringParameter(platformId, CL.CL_PLATFORM_VERSION);
34 2 1. read : removed call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::version → NO_COVERAGE
2. read : replaced call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::version with receiver → NO_COVERAGE
		platformBuilder.version(platformVersion);
35
36 2 1. read : Substituted 2308 with 2309 → NO_COVERAGE
2. read : removed call to net/bmahe/genetics4j/gpu/opencl/PlatformUtils::getStringParameter → NO_COVERAGE
		final String platformExtensions = PlatformUtils.getStringParameter(platformId, CL.CL_PLATFORM_EXTENSIONS);
37 4 1. read : removed conditional - replaced equality check with false → NO_COVERAGE
2. read : removed call to org/apache/commons/lang3/StringUtils::isNotBlank → NO_COVERAGE
3. read : removed conditional - replaced equality check with true → NO_COVERAGE
4. read : negated conditional → NO_COVERAGE
		if (StringUtils.isNotBlank(platformExtensions)) {
38 1 1. read : removed call to java/lang/String::split → NO_COVERAGE
			final String[] platformExtensionsArr = platformExtensions.split(StringUtils.SPACE);
39 4 1. read : removed conditional - replaced comparison check with false → NO_COVERAGE
2. read : removed conditional - replaced comparison check with true → NO_COVERAGE
3. read : negated conditional → NO_COVERAGE
4. read : changed conditional boundary → NO_COVERAGE
			if (platformExtensionsArr.length > 0) {
40 2 1. read : replaced call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::addExtensions with receiver → NO_COVERAGE
2. read : removed call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::addExtensions → NO_COVERAGE
				platformBuilder.addExtensions(platformExtensionsArr);
41
			}
42
		}
43
44 2 1. read : Substituted 2304 with 2305 → NO_COVERAGE
2. read : removed call to net/bmahe/genetics4j/gpu/opencl/PlatformUtils::getStringParameter → NO_COVERAGE
		final String platformProfileStr = PlatformUtils.getStringParameter(platformId, CL.CL_PLATFORM_PROFILE);
45 3 1. read : RemoveSwitch 1 (case value 1) → NO_COVERAGE
2. read : RemoveSwitch 0 (case value 0) → NO_COVERAGE
3. read : Changed switch default to be first case → NO_COVERAGE
		final var platformProfile = switch (platformProfileStr) {
46
			case PROFILE_FULL_STR -> PlatformProfile.FULL_PROFILE;
47
			case PROFILE_EMBEDDED -> PlatformProfile.FULL_PROFILE;
48 1 1. read : removed call to java/lang/IllegalArgumentException::<init> → NO_COVERAGE
			default -> throw new IllegalArgumentException("Unexpected value: " + platformProfileStr);
49
		};
50 2 1. read : replaced call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::profile with receiver → NO_COVERAGE
2. read : removed call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::profile → NO_COVERAGE
		platformBuilder.profile(platformProfile);
51
52 1 1. read : removed call to net/bmahe/genetics4j/gpu/opencl/PlatformUtils::numDevices → NO_COVERAGE
		final int numDevices = PlatformUtils.numDevices(platformId);
53 2 1. read : replaced call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::numDevices with receiver → NO_COVERAGE
2. read : removed call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::numDevices → NO_COVERAGE
		platformBuilder.numDevices(numDevices);
54
55 2 1. read : removed call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::build → NO_COVERAGE
2. read : replaced return value with null for net/bmahe/genetics4j/gpu/opencl/PlatformReader::read → NO_COVERAGE
		return platformBuilder.build();
56
	}
57
}

Mutations

23

1.1
Location : read
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/model/Platform::builder → NO_COVERAGE

25

1.1
Location : read
Killed by : none
replaced call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::platformId with receiver → NO_COVERAGE

2.2
Location : read
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::platformId → NO_COVERAGE

27

1.1
Location : read
Killed by : none
Substituted 2306 with 2307 → NO_COVERAGE

2.2
Location : read
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/PlatformUtils::getStringParameter → NO_COVERAGE

28

1.1
Location : read
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::name → NO_COVERAGE

2.2
Location : read
Killed by : none
replaced call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::name with receiver → NO_COVERAGE

30

1.1
Location : read
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/PlatformUtils::getStringParameter → NO_COVERAGE

2.2
Location : read
Killed by : none
Substituted 2307 with 2308 → NO_COVERAGE

31

1.1
Location : read
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::vendor → NO_COVERAGE

2.2
Location : read
Killed by : none
replaced call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::vendor with receiver → NO_COVERAGE

33

1.1
Location : read
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/PlatformUtils::getStringParameter → NO_COVERAGE

2.2
Location : read
Killed by : none
Substituted 2305 with 2306 → NO_COVERAGE

34

1.1
Location : read
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::version → NO_COVERAGE

2.2
Location : read
Killed by : none
replaced call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::version with receiver → NO_COVERAGE

36

1.1
Location : read
Killed by : none
Substituted 2308 with 2309 → NO_COVERAGE

2.2
Location : read
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/PlatformUtils::getStringParameter → NO_COVERAGE

37

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

2.2
Location : read
Killed by : none
removed call to org/apache/commons/lang3/StringUtils::isNotBlank → NO_COVERAGE

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

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

38

1.1
Location : read
Killed by : none
removed call to java/lang/String::split → NO_COVERAGE

39

1.1
Location : read
Killed by : none
removed conditional - replaced comparison check with false → NO_COVERAGE

2.2
Location : read
Killed by : none
removed conditional - replaced comparison check with true → NO_COVERAGE

3.3
Location : read
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location : read
Killed by : none
changed conditional boundary → NO_COVERAGE

40

1.1
Location : read
Killed by : none
replaced call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::addExtensions with receiver → NO_COVERAGE

2.2
Location : read
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::addExtensions → NO_COVERAGE

44

1.1
Location : read
Killed by : none
Substituted 2304 with 2305 → NO_COVERAGE

2.2
Location : read
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/PlatformUtils::getStringParameter → NO_COVERAGE

45

1.1
Location : read
Killed by : none
RemoveSwitch 1 (case value 1) → NO_COVERAGE

2.2
Location : read
Killed by : none
RemoveSwitch 0 (case value 0) → NO_COVERAGE

3.3
Location : read
Killed by : none
Changed switch default to be first case → NO_COVERAGE

48

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

50

1.1
Location : read
Killed by : none
replaced call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::profile with receiver → NO_COVERAGE

2.2
Location : read
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::profile → NO_COVERAGE

52

1.1
Location : read
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/PlatformUtils::numDevices → NO_COVERAGE

53

1.1
Location : read
Killed by : none
replaced call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::numDevices with receiver → NO_COVERAGE

2.2
Location : read
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::numDevices → NO_COVERAGE

55

1.1
Location : read
Killed by : none
removed call to net/bmahe/genetics4j/gpu/opencl/model/ImmutablePlatform$Builder::build → NO_COVERAGE

2.2
Location : read
Killed by : none
replaced return value with null for net/bmahe/genetics4j/gpu/opencl/PlatformReader::read → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.25.7 support