-
Notifications
You must be signed in to change notification settings - Fork 185
/
Directory.Build.targets
135 lines (122 loc) · 7.68 KB
/
Directory.Build.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<Project>
<!-- We copy over the LibTorch native binaries in order to run tests. This can probably be automated better. -->
<!-- These lists are duplicated in redist/... with file splitting added for package prep -->
<ItemGroup Condition="'$(TestUsesLibTorch)' == 'true' and '$(SkipNative)' != 'true' ">
<NativeAssemblyReference Include="LibTorchSharp" />
</ItemGroup>
<!-- Windows CPU libtorch binary list used for examples and testing -->
<ItemGroup Condition="'$(NativeTargetArchitecture)' == 'x64' and '$(OS)' == 'Windows_NT' and '$(TestUsesLibTorch)' == 'true' and ('$(TestCuda)' != 'true' or '$(SkipCuda)' == 'true') and '$(SkipNative)' != 'true' ">
<NativeAssemblyReference Include="asmjit" />
<NativeAssemblyReference Include="c10" />
<NativeAssemblyReference Include="fbgemm" />
<NativeAssemblyReference Include="fbjni" />
<NativeAssemblyReference Include="libiomp5md" />
<NativeAssemblyReference Include="libiompstubs5md" />
<NativeAssemblyReference Include="pytorch_jni" />
<NativeAssemblyReference Include="torch" />
<NativeAssemblyReference Include="torch_cpu" />
<NativeAssemblyReference Include="torch_global_deps" />
<NativeAssemblyReference Include="uv" />
</ItemGroup>
<!-- Windows CUDA 11.3 libtorch binary list used for examples and testing -->
<ItemGroup Condition="'$(NativeTargetArchitecture)' == 'x64' and '$(OS)' == 'Windows_NT' and '$(TestUsesLibTorch)' == 'true' and ('$(TestCuda)' == 'true' and '$(SkipCuda)' != 'true') and '$(SkipNative)' != 'true' ">
<NativeAssemblyReference Include="c10" Variant="cuda\" />
<NativeAssemblyReference Include="asmjit" Variant="cuda\" />
<NativeAssemblyReference Include="c10_cuda" Variant="cuda\" />
<NativeAssemblyReference Include="caffe2_nvrtc" Variant="cuda\" />
<NativeAssemblyReference Include="cublas64_12" Variant="cuda\" />
<NativeAssemblyReference Include="cublasLt64_12" Variant="cuda\" />
<NativeAssemblyReference Include="cudart64_12" Variant="cuda\" />
<NativeAssemblyReference Include="cudnn_adv_infer64_8" Variant="cuda\" />
<NativeAssemblyReference Include="cudnn_adv_train64_8" Variant="cuda\" />
<NativeAssemblyReference Include="cudnn_cnn_infer64_8" Variant="cuda\" />
<NativeAssemblyReference Include="cudnn_cnn_train64_8" Variant="cuda\" />
<NativeAssemblyReference Include="cudnn_ops_infer64_8" Variant="cuda\" />
<NativeAssemblyReference Include="cudnn_ops_train64_8" Variant="cuda\" />
<NativeAssemblyReference Include="cudnn64_8" Variant="cuda\" />
<NativeAssemblyReference Include="cufft64_11" Variant="cuda\" />
<NativeAssemblyReference Include="cufftw64_11" Variant="cuda\" />
<NativeAssemblyReference Include="curand64_10" Variant="cuda\" />
<NativeAssemblyReference Include="cupti64_2023.1.1" Variant="cuda\" />
<NativeAssemblyReference Include="cusolver64_11" Variant="cuda\" />
<NativeAssemblyReference Include="cusolverMg64_11" Variant="cuda\" />
<NativeAssemblyReference Include="cusparse64_12" Variant="cuda\" />
<NativeAssemblyReference Include="fbgemm" Variant="cuda\" />
<NativeAssemblyReference Include="fbjni" Variant="cuda\" />
<NativeAssemblyReference Include="libiomp5md" Variant="cuda\" />
<NativeAssemblyReference Include="libiompstubs5md" Variant="cuda\" />
<NativeAssemblyReference Include="nvrtc64_120_0" Variant="cuda\" />
<NativeAssemblyReference Include="nvrtc-builtins64_121" Variant="cuda\" />
<NativeAssemblyReference Include="nvToolsExt64_1" Variant="cuda\" />
<NativeAssemblyReference Include="nvJitLink_120_0" Variant="cuda\" />
<NativeAssemblyReference Include="pytorch_jni" Variant="cuda\" />
<NativeAssemblyReference Include="torch" Variant="cuda\" />
<NativeAssemblyReference Include="torch_cpu" Variant="cuda\" />
<NativeAssemblyReference Include="torch_cuda" Variant="cuda\" />
<NativeAssemblyReference Include="torch_global_deps" Variant="cuda\" />
<NativeAssemblyReference Include="uv" Variant="cuda\" />
<NativeAssemblyReference Include="zlibwapi" Variant="cuda\" />
</ItemGroup>
<!-- Mac x64 libtorch binary list used for examples and testing -->
<ItemGroup Condition="'$(NativeTargetArchitecture)' == 'x64' and $([MSBuild]::IsOSPlatform('osx')) and '$(TestUsesLibTorch)' == 'true' and '$(SkipNative)' != 'true' ">
<NativeAssemblyReference Include="backend_with_compiler" />
<NativeAssemblyReference Include="c10" />
<NativeAssemblyReference Include="fbjni" />
<NativeAssemblyReference Include="iomp5" />
<NativeAssemblyReference Include="jitbackend_test" />
<NativeAssemblyReference Include="pytorch_jni" />
<NativeAssemblyReference Include="shm" />
<NativeAssemblyReference Include="torch" />
<NativeAssemblyReference Include="torch_cpu" />
<NativeAssemblyReference Include="torch_global_deps" />
<NativeAssemblyReference Include="torch_python" />
<NativeAssemblyReference Include="torchbind_test" />
</ItemGroup>
<!-- Mac arm64 libtorch binary list used for examples and testing -->
<ItemGroup Condition="'$(NativeTargetArchitecture)' == 'arm64'and $([MSBuild]::IsOSPlatform('osx')) and '$(TestUsesLibTorch)' == 'true' and '$(SkipNative)' != 'true' ">
<NativeAssemblyReference Include="c10" />
<NativeAssemblyReference Include="shm" />
<NativeAssemblyReference Include="torch" />
<NativeAssemblyReference Include="torch_cpu" />
<NativeAssemblyReference Include="torch_global_deps" />
</ItemGroup>
<!-- Linux CPU libtorch binary list used for examples and testing -->
<ItemGroup Condition="'$(NativeTargetArchitecture)' == 'x64' and $([MSBuild]::IsOSPlatform('linux')) and '$(TestUsesLibTorch)' == 'true' and '$(SkipNative)' != 'true' ">
<NativeAssemblyReference Include="backend_with_compiler" />
<NativeAssemblyReference Include="c10" />
<NativeAssemblyReference Include="jitbackend_test" />
<NativeAssemblyReference Include="nnapi_backend" />
<NativeAssemblyReference Include="shm" />
<NativeAssemblyReference Include="torch" />
<NativeAssemblyReference Include="torch_cpu" />
<NativeAssemblyReference Include="torch_global_deps" />
<NativeAssemblyReference Include="torch_python" />
<NativeAssemblyReference Include="torchbind_test" />
<NativeAssemblyReference Include="gomp-98b21ff3" ExtraExtension=".1" />
</ItemGroup>
<Target Name="CopyNativeAssemblies"
BeforeTargets="PrepareForRun"
Condition="'$(SkipTests)' != 'true'">
<PropertyGroup>
<NativeLibPrefix Condition="'$(TargetOS)' == 'linux' OR '$(TargetOS)' == 'mac'">lib</NativeLibPrefix>
<NativeLibExtension Condition="'$(TargetOS)' == 'windows'">.dll</NativeLibExtension>
<NativeLibExtension Condition="'$(TargetOS)' == 'linux'">.so</NativeLibExtension>
<NativeLibExtension Condition="'$(TargetOS)' == 'mac'">.dylib</NativeLibExtension>
</PropertyGroup>
<ItemGroup>
<NativeAssemblyReference>
<FullAssemblyPath>$(NativeOutputPath)%(NativeAssemblyReference.Variant)$(NativeLibPrefix)%(NativeAssemblyReference.Identity)$(NativeLibExtension)%(NativeAssemblyReference.ExtraExtension)</FullAssemblyPath>
</NativeAssemblyReference>
</ItemGroup>
<Copy SourceFiles = "@(NativeAssemblyReference->'%(FullAssemblyPath)')"
DestinationFolder="$(OutputPath)"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
Retries="$(CopyRetryCount)"
SkipUnchangedFiles="true"
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)"
UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)">
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
</Copy>
</Target>
</Project>