triton-windows 3.3.0a0.post12__cp310-cp310-win_amd64.whl → 3.3.0a0.post13__cp310-cp310-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of triton-windows might be problematic. Click here for more details.

Files changed (99) hide show
  1. triton/_C/libtriton.pyd +0 -0
  2. triton/__init__.py +0 -12
  3. triton/backends/nvidia/compiler.py +3 -1
  4. triton/compiler/compiler.py +4 -4
  5. triton/runtime/build.py +29 -10
  6. triton/runtime/tcc/include/_mingw.h +170 -0
  7. triton/runtime/tcc/include/assert.h +57 -0
  8. triton/runtime/tcc/include/conio.h +409 -0
  9. triton/runtime/tcc/include/ctype.h +281 -0
  10. triton/runtime/tcc/include/dir.h +31 -0
  11. triton/runtime/tcc/include/direct.h +68 -0
  12. triton/runtime/tcc/include/dirent.h +135 -0
  13. triton/runtime/tcc/include/dos.h +55 -0
  14. triton/runtime/tcc/include/errno.h +75 -0
  15. triton/runtime/tcc/include/excpt.h +123 -0
  16. triton/runtime/tcc/include/fcntl.h +52 -0
  17. triton/runtime/tcc/include/fenv.h +108 -0
  18. triton/runtime/tcc/include/float.h +57 -0
  19. triton/runtime/tcc/include/inttypes.h +297 -0
  20. triton/runtime/tcc/include/io.h +418 -0
  21. triton/runtime/tcc/include/limits.h +111 -0
  22. triton/runtime/tcc/include/locale.h +91 -0
  23. triton/runtime/tcc/include/malloc.h +181 -0
  24. triton/runtime/tcc/include/math.h +737 -0
  25. triton/runtime/tcc/include/mem.h +13 -0
  26. triton/runtime/tcc/include/memory.h +40 -0
  27. triton/runtime/tcc/include/process.h +176 -0
  28. triton/runtime/tcc/include/sec_api/conio_s.h +42 -0
  29. triton/runtime/tcc/include/sec_api/crtdbg_s.h +19 -0
  30. triton/runtime/tcc/include/sec_api/io_s.h +33 -0
  31. triton/runtime/tcc/include/sec_api/mbstring_s.h +52 -0
  32. triton/runtime/tcc/include/sec_api/search_s.h +25 -0
  33. triton/runtime/tcc/include/sec_api/stdio_s.h +145 -0
  34. triton/runtime/tcc/include/sec_api/stdlib_s.h +67 -0
  35. triton/runtime/tcc/include/sec_api/stralign_s.h +30 -0
  36. triton/runtime/tcc/include/sec_api/string_s.h +41 -0
  37. triton/runtime/tcc/include/sec_api/sys/timeb_s.h +34 -0
  38. triton/runtime/tcc/include/sec_api/tchar_s.h +266 -0
  39. triton/runtime/tcc/include/sec_api/time_s.h +61 -0
  40. triton/runtime/tcc/include/sec_api/wchar_s.h +128 -0
  41. triton/runtime/tcc/include/setjmp.h +160 -0
  42. triton/runtime/tcc/include/share.h +28 -0
  43. triton/runtime/tcc/include/signal.h +63 -0
  44. triton/runtime/tcc/include/stdarg.h +79 -0
  45. triton/runtime/tcc/include/stdbool.h +11 -0
  46. triton/runtime/tcc/include/stddef.h +54 -0
  47. triton/runtime/tcc/include/stdint.h +212 -0
  48. triton/runtime/tcc/include/stdio.h +429 -0
  49. triton/runtime/tcc/include/stdlib.h +580 -0
  50. triton/runtime/tcc/include/string.h +164 -0
  51. triton/runtime/tcc/include/sys/fcntl.h +13 -0
  52. triton/runtime/tcc/include/sys/file.h +14 -0
  53. triton/runtime/tcc/include/sys/locking.h +30 -0
  54. triton/runtime/tcc/include/sys/stat.h +290 -0
  55. triton/runtime/tcc/include/sys/time.h +69 -0
  56. triton/runtime/tcc/include/sys/timeb.h +133 -0
  57. triton/runtime/tcc/include/sys/types.h +118 -0
  58. triton/runtime/tcc/include/sys/unistd.h +14 -0
  59. triton/runtime/tcc/include/sys/utime.h +146 -0
  60. triton/runtime/tcc/include/tcc/tcc_libm.h +201 -0
  61. triton/runtime/tcc/include/tcclib.h +80 -0
  62. triton/runtime/tcc/include/tchar.h +1102 -0
  63. triton/runtime/tcc/include/time.h +287 -0
  64. triton/runtime/tcc/include/vadefs.h +11 -0
  65. triton/runtime/tcc/include/values.h +4 -0
  66. triton/runtime/tcc/include/varargs.h +12 -0
  67. triton/runtime/tcc/include/wchar.h +873 -0
  68. triton/runtime/tcc/include/wctype.h +172 -0
  69. triton/runtime/tcc/include/winapi/basetsd.h +149 -0
  70. triton/runtime/tcc/include/winapi/basetyps.h +85 -0
  71. triton/runtime/tcc/include/winapi/guiddef.h +156 -0
  72. triton/runtime/tcc/include/winapi/poppack.h +8 -0
  73. triton/runtime/tcc/include/winapi/pshpack1.h +8 -0
  74. triton/runtime/tcc/include/winapi/pshpack2.h +8 -0
  75. triton/runtime/tcc/include/winapi/pshpack4.h +8 -0
  76. triton/runtime/tcc/include/winapi/pshpack8.h +8 -0
  77. triton/runtime/tcc/include/winapi/winbase.h +2951 -0
  78. triton/runtime/tcc/include/winapi/wincon.h +301 -0
  79. triton/runtime/tcc/include/winapi/windef.h +293 -0
  80. triton/runtime/tcc/include/winapi/windows.h +127 -0
  81. triton/runtime/tcc/include/winapi/winerror.h +3166 -0
  82. triton/runtime/tcc/include/winapi/wingdi.h +4080 -0
  83. triton/runtime/tcc/include/winapi/winnt.h +5835 -0
  84. triton/runtime/tcc/include/winapi/winreg.h +272 -0
  85. triton/runtime/tcc/include/winapi/winuser.h +5651 -0
  86. triton/runtime/tcc/include/winapi/winver.h +160 -0
  87. triton/runtime/tcc/lib/cuda.def +697 -0
  88. triton/runtime/tcc/lib/gdi32.def +337 -0
  89. triton/runtime/tcc/lib/kernel32.def +770 -0
  90. triton/runtime/tcc/lib/libtcc1-64.a +0 -0
  91. triton/runtime/tcc/lib/msvcrt.def +1399 -0
  92. triton/runtime/tcc/lib/python3.def +810 -0
  93. triton/runtime/tcc/lib/user32.def +658 -0
  94. triton/runtime/tcc/libtcc.dll +0 -0
  95. triton/runtime/tcc/tcc.exe +0 -0
  96. {triton_windows-3.3.0a0.post12.dist-info → triton_windows-3.3.0a0.post13.dist-info}/METADATA +1 -1
  97. {triton_windows-3.3.0a0.post12.dist-info → triton_windows-3.3.0a0.post13.dist-info}/RECORD +99 -9
  98. {triton_windows-3.3.0a0.post12.dist-info → triton_windows-3.3.0a0.post13.dist-info}/WHEEL +0 -0
  99. {triton_windows-3.3.0a0.post12.dist-info → triton_windows-3.3.0a0.post13.dist-info}/top_level.txt +0 -0
triton/_C/libtriton.pyd CHANGED
Binary file
triton/__init__.py CHANGED
@@ -1,18 +1,6 @@
1
1
  """isort:skip_file"""
2
2
  __version__ = '3.3.0'
3
3
 
4
- # Users may not know how to add cl and CUDA to PATH. Let's do it before loading anything
5
- import os
6
- if os.name == "nt":
7
- from .windows_utils import find_cuda, find_msvc_winsdk
8
- msvc_winsdk_inc_dirs, _ = find_msvc_winsdk()
9
- if msvc_winsdk_inc_dirs:
10
- cl_path = msvc_winsdk_inc_dirs[0].replace(r"\include", r"\bin\Hostx64\x64")
11
- os.environ["PATH"] = cl_path + os.pathsep + os.environ["PATH"]
12
- cuda_bin_path, _, _ = find_cuda()
13
- if cuda_bin_path:
14
- os.environ["PATH"] = cuda_bin_path + os.pathsep + os.environ["PATH"]
15
-
16
4
  # ---------------------------------------
17
5
  # Note: import order is significant here.
18
6
 
@@ -32,9 +32,11 @@ def min_dot_size(target: GPUTarget):
32
32
 
33
33
  @functools.lru_cache()
34
34
  def _path_to_binary(binary: str):
35
- binary += sysconfig.get_config_var("EXE")
36
35
  paths = [
37
36
  os.environ.get(f"TRITON_{binary.upper()}_PATH", ""),
37
+ ]
38
+ binary += sysconfig.get_config_var("EXE")
39
+ paths += [
38
40
  os.path.join(os.path.dirname(__file__), "bin", binary),
39
41
  ]
40
42
  if os.name == "nt":
@@ -65,10 +65,10 @@ class ASTSource:
65
65
  self.attrs = attrs or dict()
66
66
  if isinstance(self.signature, str):
67
67
  self.signature = {k: v.strip() for k, v in enumerate(self.signature.split(","))}
68
- # else:
69
- # for k in self.signature.keys():
70
- # if not isinstance(k, str):
71
- # raise TypeError("Signature keys must be string")
68
+ else:
69
+ for k in self.signature.keys():
70
+ if not isinstance(k, str):
71
+ raise TypeError("Signature keys must be string")
72
72
 
73
73
  def hash(self):
74
74
  sorted_sig = [v for k, v in sorted(self.signature.items())]
triton/runtime/build.py CHANGED
@@ -7,8 +7,31 @@ if os.name == "nt":
7
7
  from triton.windows_utils import find_msvc_winsdk, find_python
8
8
 
9
9
 
10
+ def get_cc():
11
+ cc = os.environ.get("CC")
12
+ if cc is None:
13
+ # Bundled TinyCC
14
+ cc = os.path.join(sysconfig.get_paths()["platlib"], "triton", "runtime", "tcc", "tcc.exe")
15
+ if not os.path.exists(cc):
16
+ cc = None
17
+ if cc is None:
18
+ cc = shutil.which("cl")
19
+ if cc is None:
20
+ cc = shutil.which("gcc")
21
+ if cc is None:
22
+ cc = shutil.which("clang")
23
+ if cc is None:
24
+ raise RuntimeError("Failed to find C compiler. Please specify via CC environment variable.")
25
+ return cc
26
+
27
+
28
+ def is_msvc(cc):
29
+ cc = os.path.basename(cc).lower()
30
+ return cc == "cl" or cc == "cl.exe"
31
+
32
+
10
33
  def _cc_cmd(cc, src, out, include_dirs, library_dirs, libraries):
11
- if cc.lower().endswith("cl") or cc.lower().endswith("cl.exe"):
34
+ if is_msvc(cc):
12
35
  out_base = os.path.splitext(out)[0]
13
36
  cc_cmd = [cc, src, "/nologo", "/O2", "/LD", "/wd4819"]
14
37
  cc_cmd += [f"/I{dir}" for dir in include_dirs if dir is not None]
@@ -32,15 +55,7 @@ def _build(name, src, srcdir, library_dirs, include_dirs, libraries):
32
55
  suffix = sysconfig.get_config_var('EXT_SUFFIX')
33
56
  so = os.path.join(srcdir, '{name}{suffix}'.format(name=name, suffix=suffix))
34
57
  # try to avoid setuptools if possible
35
- cc = os.environ.get("CC")
36
- if cc is None:
37
- # TODO: support more things here.
38
- cl = shutil.which("cl")
39
- gcc = shutil.which("gcc")
40
- clang = shutil.which("clang")
41
- cc = cl if cl is not None else gcc if gcc is not None else clang
42
- if cc is None:
43
- raise RuntimeError("Failed to find C compiler. Please specify via CC environment variable.")
58
+ cc = get_cc()
44
59
  # This function was renamed and made public in Python 3.10
45
60
  if hasattr(sysconfig, 'get_default_scheme'):
46
61
  scheme = sysconfig.get_default_scheme()
@@ -55,7 +70,11 @@ def _build(name, src, srcdir, library_dirs, include_dirs, libraries):
55
70
  include_dirs = include_dirs + [srcdir, py_include_dir, *custom_backend_dirs]
56
71
  if os.name == "nt":
57
72
  library_dirs += find_python()
73
+ # Link against Python stable ABI
74
+ # libraries is modified in place
75
+ if "python3" not in libraries:
58
76
  libraries += ["python3"]
77
+ if is_msvc(cc):
59
78
  msvc_winsdk_inc_dirs, msvc_winsdk_lib_dirs = find_msvc_winsdk()
60
79
  include_dirs += msvc_winsdk_inc_dirs
61
80
  library_dirs += msvc_winsdk_lib_dirs
@@ -0,0 +1,170 @@
1
+ /*
2
+ * _mingw.h
3
+ *
4
+ * This file is for TinyCC and not part of the Mingw32 package.
5
+ *
6
+ * THIS SOFTWARE IS NOT COPYRIGHTED
7
+ *
8
+ * This source code is offered for use in the public domain. You may
9
+ * use, modify or distribute it freely.
10
+ *
11
+ * This code is distributed in the hope that it will be useful but
12
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
13
+ * DISCLAIMED. This includes but is not limited to warranties of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
+ *
16
+ */
17
+
18
+ #ifndef __MINGW_H
19
+ #define __MINGW_H
20
+
21
+ /* some winapi files define these before including _mingw.h --> */
22
+ #undef __cdecl
23
+ #undef _X86_
24
+ #undef WIN32
25
+ /* <-- */
26
+
27
+ #include <stddef.h>
28
+ #include <stdarg.h>
29
+
30
+ #define __int8 char
31
+ #define __int16 short
32
+ #define __int32 int
33
+ #define __int64 long long
34
+ #define _HAVE_INT64
35
+
36
+ #define __cdecl
37
+ #define __declspec(x) __attribute__((x))
38
+ #define __unaligned __attribute__((packed))
39
+ #define __fastcall __attribute__((fastcall))
40
+
41
+ #define __MSVCRT__ 1
42
+ #undef _MSVCRT_
43
+ #define __MINGW_IMPORT extern __declspec(dllimport)
44
+ #define __MINGW_ATTRIB_NORETURN
45
+ #define __MINGW_ATTRIB_CONST
46
+ #define __MINGW_ATTRIB_DEPRECATED
47
+ #define __MINGW_ATTRIB_MALLOC
48
+ #define __MINGW_ATTRIB_PURE
49
+ #define __MINGW_ATTRIB_NONNULL(arg)
50
+ #define __MINGW_NOTHROW
51
+ #define __GNUC_VA_LIST
52
+
53
+ #define _CRTIMP extern
54
+ #define __CRT_INLINE extern __inline__
55
+
56
+ #define _CRT_ALIGN(x) __attribute__((aligned(x)))
57
+ #define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
58
+ #define _CRT_PACKING 8
59
+ #define __CRT_UNALIGNED
60
+ #define _CONST_RETURN
61
+
62
+ #ifndef _TRUNCATE
63
+ #define _TRUNCATE ((size_t)-1)
64
+ #endif
65
+
66
+ #define __CRT_STRINGIZE(_Value) #_Value
67
+ #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
68
+ #define __CRT_WIDE(_String) L ## _String
69
+ #define _CRT_WIDE(_String) __CRT_WIDE(_String)
70
+
71
+ #ifdef _WIN64
72
+ #define __stdcall
73
+ #define _AMD64_ 1
74
+ #define __x86_64 1
75
+ #define _M_X64 100 /* Visual Studio */
76
+ #define _M_AMD64 100 /* Visual Studio */
77
+ #define USE_MINGW_SETJMP_TWO_ARGS
78
+ #define mingw_getsp tinyc_getbp
79
+ #define __TRY__
80
+ #else
81
+ #define __stdcall __attribute__((__stdcall__))
82
+ #define _X86_ 1
83
+ #define _M_IX86 300 /* Visual Studio */
84
+ #define WIN32 1
85
+ #define _USE_32BIT_TIME_T
86
+ #ifdef __arm__
87
+ #define __TRY__
88
+ #else
89
+ #define __TRY__ void __try__(void**), *_sehrec[6]; __try__(_sehrec);
90
+ #endif
91
+ #endif
92
+
93
+ /* in stddef.h */
94
+ #define _SIZE_T_DEFINED
95
+ #define _SSIZE_T_DEFINED
96
+ #define _PTRDIFF_T_DEFINED
97
+ #define _WCHAR_T_DEFINED
98
+ #define _UINTPTR_T_DEFINED
99
+ #define _INTPTR_T_DEFINED
100
+ #define _INTEGRAL_MAX_BITS 64
101
+
102
+ #ifndef _TIME32_T_DEFINED
103
+ #define _TIME32_T_DEFINED
104
+ typedef long __time32_t;
105
+ #endif
106
+
107
+ #ifndef _TIME64_T_DEFINED
108
+ #define _TIME64_T_DEFINED
109
+ typedef long long __time64_t;
110
+ #endif
111
+
112
+ #ifndef _TIME_T_DEFINED
113
+ #define _TIME_T_DEFINED
114
+ #ifdef _USE_32BIT_TIME_T
115
+ typedef __time32_t time_t;
116
+ #else
117
+ typedef __time64_t time_t;
118
+ #endif
119
+ #endif
120
+
121
+ #ifndef _WCTYPE_T_DEFINED
122
+ #define _WCTYPE_T_DEFINED
123
+ typedef wchar_t wctype_t;
124
+ #endif
125
+
126
+ #ifndef _WINT_T
127
+ #define _WINT_T
128
+ typedef __WINT_TYPE__ wint_t;
129
+ #endif
130
+
131
+ typedef int errno_t;
132
+ #define _ERRCODE_DEFINED
133
+
134
+ typedef struct threadlocaleinfostruct *pthreadlocinfo;
135
+ typedef struct threadmbcinfostruct *pthreadmbcinfo;
136
+ typedef struct localeinfo_struct _locale_tstruct,*_locale_t;
137
+
138
+ /* for winapi */
139
+ #define _ANONYMOUS_UNION
140
+ #define _ANONYMOUS_STRUCT
141
+ #define DECLSPEC_NORETURN
142
+ #define DECLARE_STDCALL_P(type) __stdcall type
143
+ #define NOSERVICE 1
144
+ #define NOMCX 1
145
+ #define NOIME 1
146
+ #define __INTRIN_H_
147
+ #ifndef DUMMYUNIONNAME
148
+ # define DUMMYUNIONNAME
149
+ # define DUMMYUNIONNAME1
150
+ # define DUMMYUNIONNAME2
151
+ # define DUMMYUNIONNAME3
152
+ # define DUMMYUNIONNAME4
153
+ # define DUMMYUNIONNAME5
154
+ #endif
155
+ #ifndef DUMMYSTRUCTNAME
156
+ # define DUMMYSTRUCTNAME
157
+ #endif
158
+ #ifndef WINVER
159
+ # define WINVER 0x0502
160
+ #endif
161
+ #ifndef _WIN32_WINNT
162
+ # define _WIN32_WINNT 0x502
163
+ #endif
164
+
165
+ #define __C89_NAMELESS
166
+ #define __MINGW_EXTENSION
167
+ #define WINAPI_FAMILY_PARTITION(X) 1
168
+ #define MINGW_HAS_SECURE_API
169
+
170
+ #endif /* __MINGW_H */
@@ -0,0 +1,57 @@
1
+ /**
2
+ * This file has no copyright assigned and is placed in the Public Domain.
3
+ * This file is part of the w64 mingw-runtime package.
4
+ * No warranty is given; refer to the file DISCLAIMER within this package.
5
+ */
6
+ #ifndef __ASSERT_H_
7
+ #define __ASSERT_H_
8
+
9
+ #include <_mingw.h>
10
+ #ifdef __cplusplus
11
+ #include <stdlib.h>
12
+ #endif
13
+
14
+ #ifdef NDEBUG
15
+ #ifndef assert
16
+ #define assert(_Expression) ((void)0)
17
+ #endif
18
+ #else
19
+
20
+ #ifndef _CRT_TERMINATE_DEFINED
21
+ #define _CRT_TERMINATE_DEFINED
22
+ void __cdecl __MINGW_NOTHROW exit(int _Code) __MINGW_ATTRIB_NORETURN;
23
+ _CRTIMP void __cdecl __MINGW_NOTHROW _exit(int _Code) __MINGW_ATTRIB_NORETURN;
24
+ #if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
25
+ /* C99 function name */
26
+ void __cdecl _Exit(int) __MINGW_ATTRIB_NORETURN;
27
+ __CRT_INLINE __MINGW_ATTRIB_NORETURN void __cdecl _Exit(int status)
28
+ { _exit(status); }
29
+ #endif
30
+
31
+ #pragma push_macro("abort")
32
+ #undef abort
33
+ void __cdecl __declspec(noreturn) abort(void);
34
+ #pragma pop_macro("abort")
35
+
36
+ #endif
37
+
38
+ #ifdef __cplusplus
39
+ extern "C" {
40
+ #endif
41
+
42
+
43
+ extern void __cdecl _wassert(const wchar_t *_Message,const wchar_t *_File,unsigned _Line);
44
+ extern void __cdecl _assert(const char *, const char *, unsigned);
45
+
46
+ #ifdef __cplusplus
47
+ }
48
+ #endif
49
+
50
+ #ifndef assert
51
+ //#define assert(_Expression) (void)((!!(_Expression)) || (_wassert(_CRT_WIDE(#_Expression),_CRT_WIDE(__FILE__),__LINE__),0))
52
+ #define assert(e) ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__))
53
+ #endif
54
+
55
+ #endif
56
+
57
+ #endif