Skip to content

Commit 5f3052f

Browse files
Marc Rasirxwei
authored andcommitted
#ifdef differentiation benchmarks so they only exist when differentiation is enabled
1 parent 7c5de89 commit 5f3052f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

benchmark/single-source/Differentiation.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
import TestsUtils
13+
#if canImport(_Differentiation)
1414

15+
import TestsUtils
1516
import _Differentiation
1617

1718
public let Differentiation = [
@@ -68,3 +69,5 @@ public func run_DifferentiationArraySum(N: Int) {
6869
blackHole(valueWithGradient(at: onesArray, in: sum))
6970
}
7071
}
72+
73+
#endif

benchmark/utils/main.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ import DictionaryOfAnyHashableStrings
6969
import DictionaryRemove
7070
import DictionarySubscriptDefault
7171
import DictionarySwap
72+
#if canImport(_Differentiation)
7273
import Differentiation
74+
#endif
7375
import Diffing
7476
import DiffingMyers
7577
import DropFirst
@@ -259,7 +261,9 @@ registerBenchmark(DictionaryOfAnyHashableStrings)
259261
registerBenchmark(DictionaryRemove)
260262
registerBenchmark(DictionarySubscriptDefault)
261263
registerBenchmark(DictionarySwap)
264+
#if canImport(_Differentiation)
262265
registerBenchmark(Differentiation)
266+
#endif
263267
registerBenchmark(Diffing)
264268
registerBenchmark(DiffingMyers)
265269
registerBenchmark(DropFirst)

0 commit comments

Comments
 (0)