2828import argparse
2929import os
3030import pathlib
31+ import platform
3132import re
3233import shutil
3334import subprocess
@@ -83,6 +84,12 @@ def sed(pattern, replace, source, dest=None):
8384 required = False ,
8485 help = "Include linux specific artifacts." ,
8586 )
87+ parser .add_argument (
88+ "--windows" ,
89+ action = "store_true" ,
90+ required = False ,
91+ help = "Include windows specific artifacts." ,
92+ )
8693 parser .add_argument (
8794 "--perf-analyzer" ,
8895 type = str ,
@@ -118,7 +125,7 @@ def sed(pattern, replace, source, dest=None):
118125 cpdir ("tritonhttpclient" , os .path .join (FLAGS .whl_dir , "tritonhttpclient" ))
119126 if os .path .isdir ("tritongrpcclient" ):
120127 cpdir ("tritongrpcclient" , os .path .join (FLAGS .whl_dir , "tritongrpcclient" ))
121- if FLAGS .linux :
128+ if FLAGS .linux or FLAGS . windows :
122129 if os .path .isdir ("tritonshmutils" ):
123130 cpdir ("tritonshmutils" , os .path .join (FLAGS .whl_dir , "tritonshmutils" ))
124131
@@ -194,6 +201,21 @@ def sed(pattern, replace, source, dest=None):
194201 if not os .path .exists (os .path .join (FLAGS .whl_dir , "perf_client" )):
195202 os .symlink ("perf_analyzer" , os .path .join (FLAGS .whl_dir , "perf_client" ))
196203
204+ if FLAGS .windows :
205+ cpdir (
206+ "tritonclient/utils/shared_memory" ,
207+ os .path .join (FLAGS .whl_dir , "tritonclient/utils/shared_memory" ),
208+ )
209+ shutil .copyfile (
210+ "tritonclient/utils/Release/cshm.dll" ,
211+ os .path .join (FLAGS .whl_dir , "tritonclient/utils/shared_memory/cshm.dll" ),
212+ )
213+ # FIXME: Enable when Windows supports GPU tensors
214+ # cpdir(
215+ # "tritonclient/utils/cuda_shared_memory",
216+ # os.path.join(FLAGS.whl_dir, "tritonclient/utils/cuda_shared_memory"),
217+ # )
218+
197219 shutil .copyfile ("LICENSE.txt" , os .path .join (FLAGS .whl_dir , "LICENSE.txt" ))
198220 shutil .copyfile ("setup.py" , os .path .join (FLAGS .whl_dir , "setup.py" ))
199221 cpdir ("requirements" , os .path .join (FLAGS .whl_dir , "requirements" ))
@@ -208,6 +230,9 @@ def sed(pattern, replace, source, dest=None):
208230 else :
209231 platform_name = "manylinux1_x86_64"
210232 args = ["python3" , "setup.py" , "bdist_wheel" , "--plat-name" , platform_name ]
233+ elif FLAGS .windows and platform .uname ().machine == "AMD64" :
234+ platform_name = "win_amd64"
235+ args = ["python3" , "setup.py" , "bdist_wheel" , "--plat-name" , platform_name ]
211236 else :
212237 args = ["python3" , "setup.py" , "bdist_wheel" ]
213238
0 commit comments