Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

build: enable building X10 support with SPM #1176

Merged
merged 2 commits into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,21 @@ let package = Package(
.target(
name: "CTensorFlow",
dependencies: []),
.target(
name: "CX10Modules",
dependencies: []),
.target(
name: "TensorFlow",
dependencies: [
"Tensor",
"PythonKit",
"CTensorFlow",
"CX10Modules",
.product(name: "Numerics", package: "swift-numerics"),
],
swiftSettings: [
.define("USING_X10_BACKEND"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From offline discussion: it seems like we can remove the USING_X10_BACKEND flag and checks soon, since that is the only path forward for enabling SwiftPM builds for tensorflow/swift-apis.

.define("DEFAULT_BACKEND_EAGER"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it's possible to eventually enable non-DEFAULT_BACKEND_EAGER builds via SwiftPM?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible, but requires an API break; I'd want such a switch to be planned (and communicated) prior to executing.

]),
.target(
name: "Experimental",
Expand Down
1 change: 1 addition & 0 deletions Sources/CX10Modules/include/device_wrapper.h
1 change: 1 addition & 0 deletions Sources/CX10Modules/include/module.modulemap
1 change: 1 addition & 0 deletions Sources/CX10Modules/include/xla_tensor_tf_ops.h
1 change: 1 addition & 0 deletions Sources/CX10Modules/include/xla_tensor_wrapper.h
15 changes: 15 additions & 0 deletions Sources/CX10Modules/shim.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright 2019 The TensorFlow Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

extern int _;
35 changes: 0 additions & 35 deletions Sources/TensorFlow/Core/Device.swift

This file was deleted.

1 change: 1 addition & 0 deletions Sources/TensorFlow/X10/APIs/CrossReplicaSum.swift
1 change: 1 addition & 0 deletions Sources/TensorFlow/X10/APIs/DeviceScope.swift
1 change: 1 addition & 0 deletions Sources/TensorFlow/X10/APIs/RawOpsManual.swift
1 change: 1 addition & 0 deletions Sources/TensorFlow/X10/Device.swift
1 change: 1 addition & 0 deletions Sources/TensorFlow/X10/RawOpsXLAGenerated.swift
1 change: 1 addition & 0 deletions Sources/TensorFlow/X10/XLAScalarType.swift
1 change: 1 addition & 0 deletions Sources/TensorFlow/X10/XLATensor.swift