mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Previously, two conditions were necessary to enable differentiable programming: - Using the `-enable-experimental-differentiable-programming` frontend flag. - Importing the `_Differentiation` module. Importing the `_Differentiation` module is the true condition because it contains the required compiler-known `Differentiable` protocol. The frontend flag is redundant and cumbersome. Now, the frontend flag is removed. Importing `_Differentiation` is the only condition.
11 lines
353 B
Swift
11 lines
353 B
Swift
// RUN: %target-swift-frontend -emit-silgen %S/Inputs/noderivative_attr_other_file.swift %s | %FileCheck %s
|
|
|
|
import _Differentiation
|
|
|
|
@differentiable
|
|
func bar(_ x: Float) -> Float {
|
|
return Float(floatToIntNoDerivative(x))
|
|
}
|
|
|
|
// CHECK: sil hidden [_semantics "autodiff.nonvarying"] [ossa] @float_to_int_noderivative : $@convention(thin) (Float) -> Int
|