Skip to content

Commit bd4730f

Browse files
JaapWijnenJaap Wijnen
andauthored
Mark Differentiation related FloatingPoint methods with @inlinable for more optimization opportunities (#78806)
Co-authored-by: Jaap Wijnen <[email protected]>
1 parent 5a29c92 commit bd4730f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

stdlib/public/Differentiation/FloatingPointDifferentiation.swift.gyb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ extension ${Self}: Differentiable {
4242
public typealias TangentVector = ${Self}
4343

4444
${Availability(bits)}
45+
@inlinable
4546
public mutating func move(by offset: TangentVector) {
4647
self += offset
4748
}
@@ -95,15 +96,15 @@ extension ${Self} {
9596
/// Derivatives of standard unary operators.
9697
${Availability(bits)}
9798
extension ${Self} {
98-
@usableFromInline
99+
@inlinable
99100
@_transparent
100101
@derivative(of: -)
101102
static func _vjpNegate(x: ${Self})
102103
-> (value: ${Self}, pullback: (${Self}) -> ${Self}) {
103104
return (-x, { v in -v })
104105
}
105106

106-
@usableFromInline
107+
@inlinable
107108
@_transparent
108109
@derivative(of: -)
109110
static func _jvpNegate(x: ${Self})

0 commit comments

Comments
 (0)