Skip to content

Commit 48d2cd6

Browse files
committed
Merge remote-tracking branch 'origin/main' into move-cmake-to-common
2 parents 5f4d27b + 3ce9687 commit 48d2cd6

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

build2cmake/src/torch/kernel.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fn render_kernel_component(
5151
Ok(())
5252
}
5353

54-
pub fn render_kernel_component_cpu(
54+
fn render_kernel_component_cpu(
5555
env: &Environment,
5656
kernel_name: &str,
5757
kernel: &Kernel,
@@ -134,7 +134,7 @@ fn render_kernel_component_cuda(
134134
Ok(())
135135
}
136136

137-
pub fn render_kernel_component_metal(
137+
fn render_kernel_component_metal(
138138
env: &Environment,
139139
kernel_name: &str,
140140
kernel: &Kernel,
@@ -159,7 +159,7 @@ pub fn render_kernel_component_metal(
159159
Ok(())
160160
}
161161

162-
pub fn render_kernel_component_xpu(
162+
fn render_kernel_component_xpu(
163163
env: &Environment,
164164
kernel_name: &str,
165165
kernel: &Kernel,

builder/lib/build-sets.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
nixpkgs,
33
rust-overlay,
4-
torchVersions,
54
}:
65

76
let
@@ -16,7 +15,7 @@ let
1615

1716
# All build configurations supported by Torch.
1817
buildConfigs =
19-
system:
18+
torchVersions: system:
2019
let
2120
filterMap = f: xs: builtins.filter (x: x != null) (builtins.map f xs);
2221
systemBuildConfigs = filterMap (version: if version.system == system then version else null) (
@@ -30,7 +29,8 @@ let
3029
in
3130
rec {
3231
mkBuildSets =
33-
systems: lib.concatMap (system: builtins.map mkBuildSet (buildConfigs system)) systems;
32+
torchVersions: systems:
33+
lib.concatMap (system: builtins.map mkBuildSet (buildConfigs torchVersions system)) systems;
3434

3535
# Partition into an attrset { <system> = [ <buildset> ...]; ... }.
3636
partitionBuildSetsBySystem = lib.foldl (

flake.nix

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
inherit
2424
(import ./builder/lib/build-sets.nix {
2525
inherit nixpkgs rust-overlay;
26-
torchVersions = torchVersions';
2726
})
2827
mkBuildSets
2928
partitionBuildSetsBySystem
@@ -39,7 +38,7 @@
3938

4039
torchVersions' = import ./builder/versions.nix;
4140

42-
defaultBuildSets = mkBuildSets systems;
41+
defaultBuildSets = mkBuildSets torchVersions' systems;
4342
defaultBuildSetsPerSystem = partitionBuildSetsBySystem defaultBuildSets;
4443

4544
mkBuildPerSystem =
@@ -90,7 +89,7 @@
9089
(builtins.isFunction torchVersions)
9190
|| abort "`torchVersions` must be a function taking one argument (the default version set)";
9291
let
93-
buildSets = mkBuildSets systems;
92+
buildSets = mkBuildSets (torchVersions torchVersions') systems;
9493
buildSetPerSystem = partitionBuildSetsBySystem buildSets;
9594
buildPerSystem = mkBuildPerSystem buildSetPerSystem;
9695
in
@@ -110,8 +109,8 @@
110109
buildSets = buildSetPerSystem.${system};
111110
}
112111
);
113-
}
114-
// defaultBuildPerSystem;
112+
};
113+
#// defaultBuildPerSystem;
115114
in
116115
flake-utils.lib.eachSystem systems (
117116
system:

0 commit comments

Comments
 (0)