Skip to content

Commit 3329bd5

Browse files
committed
add feedback
1 parent 6cec508 commit 3329bd5

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Sources/CodeGeneratorExecutable/CodeGenerator.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,7 @@ struct CodeGenerator {
4242
let simdType = "SIMD\(simdWidth)<\(floatingPointType)>"
4343

4444
// no simd methods exist for simd size >= 16 and scalar > Float so we don't add acceleration to those.
45-
let simdAccelerated: Bool
46-
if simdWidth > 16 || (simdWidth == 16 && floatingPointType == "Double") {
47-
simdAccelerated = false
48-
}
49-
else {
50-
simdAccelerated = true
51-
}
45+
let simdAccelerated = simdWidth < 16 || (simdWidth == 16 && floatingPointType == "Float")
5246

5347
// Generate RealFunctions implementations on concrete SIMD types to attach derivatives to
5448
let realFunctionsExtensionCode = RealFunctionsGenerator.realFunctionsExtension(

Tests/RealModuleDifferentiableTests/RealModuleDifferentiableTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import Testing
44

55
@Suite
66
struct TestRegisteredDerivatives {
7-
// These tests are more about the derivatives being correctly registered than the correct values. We're only checking the first value for simds since we run the computation on the same values and only checking the first result makes using `.isApproximatelyEqual(to:)` a lot easier.
7+
// These tests are more about the derivatives being correctly registered than the correct values. We're only checking the first value
8+
// for simds since we run the computation on the same values and only checking the first result makes using `.isApproximatelyEqual(to:)`
9+
// a lot easier.
810
@Test
911
func
1012
testExp()

0 commit comments

Comments
 (0)