forked from dotnet/TorchSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.targets
134 lines (122 loc) · 7.69 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
<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="caffe2_detectron_ops" />
<NativeAssemblyReference Include="caffe2_module_test_dynamic" />
<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_detectron_ops_gpu" Variant="cuda\" />
<NativeAssemblyReference Include="caffe2_module_test_dynamic" Variant="cuda\" />
<NativeAssemblyReference Include="caffe2_nvrtc" Variant="cuda\" />
<NativeAssemblyReference Include="cublas64_11" Variant="cuda\" />
<NativeAssemblyReference Include="cublasLt64_11" Variant="cuda\" />
<NativeAssemblyReference Include="cudart64_110" 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_10" Variant="cuda\" />
<NativeAssemblyReference Include="cufftw64_10" Variant="cuda\" />
<NativeAssemblyReference Include="curand64_10" Variant="cuda\" />
<NativeAssemblyReference Include="cusolver64_11" Variant="cuda\" />
<NativeAssemblyReference Include="cusolverMg64_11" Variant="cuda\" />
<NativeAssemblyReference Include="cusparse64_11" Variant="cuda\" />
<NativeAssemblyReference Include="fbgemm" Variant="cuda\" />
<NativeAssemblyReference Include="libiomp5md" Variant="cuda\" />
<NativeAssemblyReference Include="libiompstubs5md" Variant="cuda\" />
<NativeAssemblyReference Include="nvrtc64_112_0" Variant="cuda\" />
<NativeAssemblyReference Include="nvrtc-builtins64_113" Variant="cuda\" />
<NativeAssemblyReference Include="nvToolsExt64_1" 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_cuda_cpp" Variant="cuda\" />
<NativeAssemblyReference Include="torch_cuda_cu" Variant="cuda\" />
<NativeAssemblyReference Include="torch_global_deps" Variant="cuda\" />
<NativeAssemblyReference Include="uv" Variant="cuda\" />
</ItemGroup>
<!-- Mac libtorch binary list used for examples and testing -->
<ItemGroup Condition="'$(NativeTargetArchitecture)' == 'x64'and $([MSBuild]::IsOSPlatform('osx')) and '$(TestUsesLibTorch)' == 'true' and '$(SkipNative)' != 'true' ">
<NativeAssemblyReference Include="c10" />
<NativeAssemblyReference Include="caffe2_detectron_ops" />
<NativeAssemblyReference Include="caffe2_module_test_dynamic" />
<NativeAssemblyReference Include="caffe2_observers" />
<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>
<!-- 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="caffe2_detectron_ops" />
<NativeAssemblyReference Include="caffe2_module_test_dynamic" />
<NativeAssemblyReference Include="caffe2_observers" />
<NativeAssemblyReference Include="fbjni" />
<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" />
<NativeAssemblyReference Include="gomp-a34b3233" 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>