Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +8 -0
- mplug_owl2/compiler_compat/ld +3 -0
- mplug_owl2/lib/libbz2.a +3 -0
- mplug_owl2/lib/libffi.so.8 +0 -0
- mplug_owl2/lib/libformw.so.6 +0 -0
- mplug_owl2/lib/libpanelw.so +0 -0
- mplug_owl2/lib/libpanelw.so.6 +0 -0
- mplug_owl2/lib/libquadmath.so.0 +3 -0
- mplug_owl2/lib/libreadline.a +3 -0
- mplug_owl2/lib/libreadline.so.8.2 +3 -0
- mplug_owl2/lib/libsqlite3.so +3 -0
- mplug_owl2/lib/libstdc++.so.6 +3 -0
- mplug_owl2/lib/libtclstub8.6.a +0 -0
- mplug_owl2/lib/libz.so +3 -0
- mplug_owl2/lib/tcl8.6/auto.tcl +648 -0
- mplug_owl2/lib/tcl8.6/encoding/cp1252.enc +20 -0
- mplug_owl2/lib/tcl8.6/encoding/cp860.enc +20 -0
- mplug_owl2/lib/tcl8.6/encoding/euc-kr.enc +1533 -0
- mplug_owl2/lib/tcl8.6/encoding/macCroatian.enc +20 -0
- mplug_owl2/lib/tcl8.6/http1.0/http.tcl +377 -0
- mplug_owl2/lib/tcl8.6/http1.0/pkgIndex.tcl +11 -0
- mplug_owl2/lib/tcl8.6/package.tcl +751 -0
- mplug_owl2/lib/tcl8.6/safe.tcl +1289 -0
- mplug_owl2/lib/tcl8.6/tclIndex +79 -0
- mplug_owl2/lib/tcl8.6/word.tcl +154 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/ATenCUDAGeneral.h +9 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/ApplyGridUtils.cuh +47 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/Atomic.cuh +514 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAApplyUtils.cuh +537 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDABlas.h +358 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAConfig.h +19 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAContextLight.h +99 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDADataType.h +105 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDADevice.h +23 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAEvent.h +211 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAGeneratorImpl.h +181 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAGraph.h +89 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAGraphsUtils.cuh +53 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDASparse.h +75 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDASparseBlas.h +318 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDASparseDescriptors.h +288 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDATensorMethods.cuh +15 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAUtils.h +20 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CachingHostAllocator.h +37 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/DeviceUtils.cuh +121 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/EmptyTensor.h +44 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/Exceptions.h +205 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/NumericLimits.cuh +121 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/PeerToPeerAccess.h +11 -0
- pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/PhiloxUtils.cuh +4 -0
.gitattributes
CHANGED
|
@@ -674,3 +674,11 @@ llava_video/lib/python3.10/site-packages/matplotlib/backends/_tkagg.cpython-310-
|
|
| 674 |
llava_video/lib/python3.10/site-packages/matplotlib/__pycache__/widgets.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 675 |
llava_video/lib/python3.10/site-packages/matplotlib/__pycache__/colors.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 676 |
moondream/bin/python filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 674 |
llava_video/lib/python3.10/site-packages/matplotlib/__pycache__/widgets.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 675 |
llava_video/lib/python3.10/site-packages/matplotlib/__pycache__/colors.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
|
| 676 |
moondream/bin/python filter=lfs diff=lfs merge=lfs -text
|
| 677 |
+
mplug_owl2/compiler_compat/ld filter=lfs diff=lfs merge=lfs -text
|
| 678 |
+
mplug_owl2/lib/libreadline.so.8.2 filter=lfs diff=lfs merge=lfs -text
|
| 679 |
+
mplug_owl2/lib/libstdc++.so.6 filter=lfs diff=lfs merge=lfs -text
|
| 680 |
+
mplug_owl2/lib/libz.so filter=lfs diff=lfs merge=lfs -text
|
| 681 |
+
mplug_owl2/lib/libreadline.a filter=lfs diff=lfs merge=lfs -text
|
| 682 |
+
mplug_owl2/lib/libbz2.a filter=lfs diff=lfs merge=lfs -text
|
| 683 |
+
mplug_owl2/lib/libsqlite3.so filter=lfs diff=lfs merge=lfs -text
|
| 684 |
+
mplug_owl2/lib/libquadmath.so.0 filter=lfs diff=lfs merge=lfs -text
|
mplug_owl2/compiler_compat/ld
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aaaab6b3200c6f71e5f2970b01a074c958d5af546e5f43c011192307f69d9cac
|
| 3 |
+
size 2195376
|
mplug_owl2/lib/libbz2.a
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4377dc3d8f7542568b6365cd6bb06970b53c20e9a71b7d54271874f7868be500
|
| 3 |
+
size 264138
|
mplug_owl2/lib/libffi.so.8
ADDED
|
Binary file (72.1 kB). View file
|
|
|
mplug_owl2/lib/libformw.so.6
ADDED
|
Binary file (91.4 kB). View file
|
|
|
mplug_owl2/lib/libpanelw.so
ADDED
|
Binary file (20.7 kB). View file
|
|
|
mplug_owl2/lib/libpanelw.so.6
ADDED
|
Binary file (20.7 kB). View file
|
|
|
mplug_owl2/lib/libquadmath.so.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:10c6fadba4c2f6d77e836a50aadbd92e95b137a85eb01b1ca183b50d8f39a2c6
|
| 3 |
+
size 1009408
|
mplug_owl2/lib/libreadline.a
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:34edb0aaf24f86fa37e869bb46389534179d560e141a744b15d854497148663a
|
| 3 |
+
size 749782
|
mplug_owl2/lib/libreadline.so.8.2
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0b6a9d66a73115c872272bb479c8f29df1bf7d9b16e5913e083d64b7753ce1c6
|
| 3 |
+
size 411464
|
mplug_owl2/lib/libsqlite3.so
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:71932eb5bf89092fbd2c900601fc9f24aa184d65038aaec2445fd11b1d923327
|
| 3 |
+
size 1543808
|
mplug_owl2/lib/libstdc++.so.6
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4f045231ff3a95c2fbfde450575f0ef45d23e95be15193c8729b521fc363ece4
|
| 3 |
+
size 17981480
|
mplug_owl2/lib/libtclstub8.6.a
ADDED
|
Binary file (8.39 kB). View file
|
|
|
mplug_owl2/lib/libz.so
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0b0e682a9dc7fd4895a6783288f851b793dc89633f28714027974fa4d66f3914
|
| 3 |
+
size 124744
|
mplug_owl2/lib/tcl8.6/auto.tcl
ADDED
|
@@ -0,0 +1,648 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# auto.tcl --
|
| 2 |
+
#
|
| 3 |
+
# utility procs formerly in init.tcl dealing with auto execution of commands
|
| 4 |
+
# and can be auto loaded themselves.
|
| 5 |
+
#
|
| 6 |
+
# Copyright (c) 1991-1993 The Regents of the University of California.
|
| 7 |
+
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
|
| 8 |
+
#
|
| 9 |
+
# See the file "license.terms" for information on usage and redistribution of
|
| 10 |
+
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 11 |
+
#
|
| 12 |
+
|
| 13 |
+
# auto_reset --
|
| 14 |
+
#
|
| 15 |
+
# Destroy all cached information for auto-loading and auto-execution, so that
|
| 16 |
+
# the information gets recomputed the next time it's needed. Also delete any
|
| 17 |
+
# commands that are listed in the auto-load index.
|
| 18 |
+
#
|
| 19 |
+
# Arguments:
|
| 20 |
+
# None.
|
| 21 |
+
|
| 22 |
+
proc auto_reset {} {
|
| 23 |
+
global auto_execs auto_index auto_path
|
| 24 |
+
if {[array exists auto_index]} {
|
| 25 |
+
foreach cmdName [array names auto_index] {
|
| 26 |
+
set fqcn [namespace which $cmdName]
|
| 27 |
+
if {$fqcn eq ""} {
|
| 28 |
+
continue
|
| 29 |
+
}
|
| 30 |
+
rename $fqcn {}
|
| 31 |
+
}
|
| 32 |
+
}
|
| 33 |
+
unset -nocomplain auto_execs auto_index ::tcl::auto_oldpath
|
| 34 |
+
if {[catch {llength $auto_path}]} {
|
| 35 |
+
set auto_path [list [info library]]
|
| 36 |
+
} elseif {[info library] ni $auto_path} {
|
| 37 |
+
lappend auto_path [info library]
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
# tcl_findLibrary --
|
| 42 |
+
#
|
| 43 |
+
# This is a utility for extensions that searches for a library directory
|
| 44 |
+
# using a canonical searching algorithm. A side effect is to source the
|
| 45 |
+
# initialization script and set a global library variable.
|
| 46 |
+
#
|
| 47 |
+
# Arguments:
|
| 48 |
+
# basename Prefix of the directory name, (e.g., "tk")
|
| 49 |
+
# version Version number of the package, (e.g., "8.0")
|
| 50 |
+
# patch Patchlevel of the package, (e.g., "8.0.3")
|
| 51 |
+
# initScript Initialization script to source (e.g., tk.tcl)
|
| 52 |
+
# enVarName environment variable to honor (e.g., TK_LIBRARY)
|
| 53 |
+
# varName Global variable to set when done (e.g., tk_library)
|
| 54 |
+
|
| 55 |
+
proc tcl_findLibrary {basename version patch initScript enVarName varName} {
|
| 56 |
+
upvar #0 $varName the_library
|
| 57 |
+
global auto_path env tcl_platform
|
| 58 |
+
|
| 59 |
+
set dirs {}
|
| 60 |
+
set errors {}
|
| 61 |
+
|
| 62 |
+
# The C application may have hardwired a path, which we honor
|
| 63 |
+
|
| 64 |
+
if {[info exists the_library] && $the_library ne ""} {
|
| 65 |
+
lappend dirs $the_library
|
| 66 |
+
} else {
|
| 67 |
+
# Do the canonical search
|
| 68 |
+
|
| 69 |
+
# 1. From an environment variable, if it exists. Placing this first
|
| 70 |
+
# gives the end-user ultimate control to work-around any bugs, or
|
| 71 |
+
# to customize.
|
| 72 |
+
|
| 73 |
+
if {[info exists env($enVarName)]} {
|
| 74 |
+
lappend dirs $env($enVarName)
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
# 2. In the package script directory registered within the
|
| 78 |
+
# configuration of the package itself.
|
| 79 |
+
|
| 80 |
+
catch {
|
| 81 |
+
lappend dirs [::${basename}::pkgconfig get scriptdir,runtime]
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
# 3. Relative to auto_path directories. This checks relative to the
|
| 85 |
+
# Tcl library as well as allowing loading of libraries added to the
|
| 86 |
+
# auto_path that is not relative to the core library or binary paths.
|
| 87 |
+
foreach d $auto_path {
|
| 88 |
+
lappend dirs [file join $d $basename$version]
|
| 89 |
+
if {$tcl_platform(platform) eq "unix"
|
| 90 |
+
&& $tcl_platform(os) eq "Darwin"} {
|
| 91 |
+
# 4. On MacOSX, check the Resources/Scripts subdir too
|
| 92 |
+
lappend dirs [file join $d $basename$version Resources Scripts]
|
| 93 |
+
}
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
# 3. Various locations relative to the executable
|
| 97 |
+
# ../lib/foo1.0 (From bin directory in install hierarchy)
|
| 98 |
+
# ../../lib/foo1.0 (From bin/arch directory in install hierarchy)
|
| 99 |
+
# ../library (From unix directory in build hierarchy)
|
| 100 |
+
#
|
| 101 |
+
# Remaining locations are out of date (when relevant, they ought to be
|
| 102 |
+
# covered by the $::auto_path seach above) and disabled.
|
| 103 |
+
#
|
| 104 |
+
# ../../library (From unix/arch directory in build hierarchy)
|
| 105 |
+
# ../../foo1.0.1/library
|
| 106 |
+
# (From unix directory in parallel build hierarchy)
|
| 107 |
+
# ../../../foo1.0.1/library
|
| 108 |
+
# (From unix/arch directory in parallel build hierarchy)
|
| 109 |
+
|
| 110 |
+
set parentDir [file dirname [file dirname [info nameofexecutable]]]
|
| 111 |
+
set grandParentDir [file dirname $parentDir]
|
| 112 |
+
lappend dirs [file join $parentDir lib $basename$version]
|
| 113 |
+
lappend dirs [file join $grandParentDir lib $basename$version]
|
| 114 |
+
lappend dirs [file join $parentDir library]
|
| 115 |
+
if {0} {
|
| 116 |
+
lappend dirs [file join $grandParentDir library]
|
| 117 |
+
lappend dirs [file join $grandParentDir $basename$patch library]
|
| 118 |
+
lappend dirs [file join [file dirname $grandParentDir] \
|
| 119 |
+
$basename$patch library]
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
# make $dirs unique, preserving order
|
| 123 |
+
array set seen {}
|
| 124 |
+
foreach i $dirs {
|
| 125 |
+
# Make sure $i is unique under normalization. Avoid repeated [source].
|
| 126 |
+
if {[interp issafe]} {
|
| 127 |
+
# Safe interps have no [file normalize].
|
| 128 |
+
set norm $i
|
| 129 |
+
} else {
|
| 130 |
+
set norm [file normalize $i]
|
| 131 |
+
}
|
| 132 |
+
if {[info exists seen($norm)]} {
|
| 133 |
+
continue
|
| 134 |
+
}
|
| 135 |
+
set seen($norm) {}
|
| 136 |
+
|
| 137 |
+
set the_library $i
|
| 138 |
+
set file [file join $i $initScript]
|
| 139 |
+
|
| 140 |
+
# source everything when in a safe interpreter because we have a
|
| 141 |
+
# source command, but no file exists command
|
| 142 |
+
|
| 143 |
+
if {[interp issafe] || [file exists $file]} {
|
| 144 |
+
if {![catch {uplevel #0 [list source $file]} msg opts]} {
|
| 145 |
+
return
|
| 146 |
+
}
|
| 147 |
+
append errors "$file: $msg\n"
|
| 148 |
+
append errors [dict get $opts -errorinfo]\n
|
| 149 |
+
}
|
| 150 |
+
}
|
| 151 |
+
unset -nocomplain the_library
|
| 152 |
+
set msg "Can't find a usable $initScript in the following directories: \n"
|
| 153 |
+
append msg " $dirs\n\n"
|
| 154 |
+
append msg "$errors\n\n"
|
| 155 |
+
append msg "This probably means that $basename wasn't installed properly.\n"
|
| 156 |
+
error $msg
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
|
| 160 |
+
# ----------------------------------------------------------------------
|
| 161 |
+
# auto_mkindex
|
| 162 |
+
# ----------------------------------------------------------------------
|
| 163 |
+
# The following procedures are used to generate the tclIndex file from Tcl
|
| 164 |
+
# source files. They use a special safe interpreter to parse Tcl source
|
| 165 |
+
# files, writing out index entries as "proc" commands are encountered. This
|
| 166 |
+
# implementation won't work in a safe interpreter, since a safe interpreter
|
| 167 |
+
# can't create the special parser and mess with its commands.
|
| 168 |
+
|
| 169 |
+
if {[interp issafe]} {
|
| 170 |
+
return ;# Stop sourcing the file here
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
# auto_mkindex --
|
| 174 |
+
# Regenerate a tclIndex file from Tcl source files. Takes as argument the
|
| 175 |
+
# name of the directory in which the tclIndex file is to be placed, followed
|
| 176 |
+
# by any number of glob patterns to use in that directory to locate all of the
|
| 177 |
+
# relevant files.
|
| 178 |
+
#
|
| 179 |
+
# Arguments:
|
| 180 |
+
# dir - Name of the directory in which to create an index.
|
| 181 |
+
|
| 182 |
+
# args - Any number of additional arguments giving the names of files
|
| 183 |
+
# within dir. If no additional are given auto_mkindex will look
|
| 184 |
+
# for *.tcl.
|
| 185 |
+
|
| 186 |
+
proc auto_mkindex {dir args} {
|
| 187 |
+
if {[interp issafe]} {
|
| 188 |
+
error "can't generate index within safe interpreter"
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
set oldDir [pwd]
|
| 192 |
+
cd $dir
|
| 193 |
+
|
| 194 |
+
append index "# Tcl autoload index file, version 2.0\n"
|
| 195 |
+
append index "# This file is generated by the \"auto_mkindex\" command\n"
|
| 196 |
+
append index "# and sourced to set up indexing information for one or\n"
|
| 197 |
+
append index "# more commands. Typically each line is a command that\n"
|
| 198 |
+
append index "# sets an element in the auto_index array, where the\n"
|
| 199 |
+
append index "# element name is the name of a command and the value is\n"
|
| 200 |
+
append index "# a script that loads the command.\n\n"
|
| 201 |
+
if {![llength $args]} {
|
| 202 |
+
set args *.tcl
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
auto_mkindex_parser::init
|
| 206 |
+
foreach file [lsort [glob -- {*}$args]] {
|
| 207 |
+
try {
|
| 208 |
+
append index [auto_mkindex_parser::mkindex $file]
|
| 209 |
+
} on error {msg opts} {
|
| 210 |
+
cd $oldDir
|
| 211 |
+
return -options $opts $msg
|
| 212 |
+
}
|
| 213 |
+
}
|
| 214 |
+
auto_mkindex_parser::cleanup
|
| 215 |
+
|
| 216 |
+
set fid [open "tclIndex" w]
|
| 217 |
+
puts -nonewline $fid $index
|
| 218 |
+
close $fid
|
| 219 |
+
cd $oldDir
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
# Original version of auto_mkindex that just searches the source code for
|
| 223 |
+
# "proc" at the beginning of the line.
|
| 224 |
+
|
| 225 |
+
proc auto_mkindex_old {dir args} {
|
| 226 |
+
set oldDir [pwd]
|
| 227 |
+
cd $dir
|
| 228 |
+
set dir [pwd]
|
| 229 |
+
append index "# Tcl autoload index file, version 2.0\n"
|
| 230 |
+
append index "# This file is generated by the \"auto_mkindex\" command\n"
|
| 231 |
+
append index "# and sourced to set up indexing information for one or\n"
|
| 232 |
+
append index "# more commands. Typically each line is a command that\n"
|
| 233 |
+
append index "# sets an element in the auto_index array, where the\n"
|
| 234 |
+
append index "# element name is the name of a command and the value is\n"
|
| 235 |
+
append index "# a script that loads the command.\n\n"
|
| 236 |
+
if {![llength $args]} {
|
| 237 |
+
set args *.tcl
|
| 238 |
+
}
|
| 239 |
+
foreach file [lsort [glob -- {*}$args]] {
|
| 240 |
+
set f ""
|
| 241 |
+
set error [catch {
|
| 242 |
+
set f [open $file]
|
| 243 |
+
fconfigure $f -eofchar "\x1A {}"
|
| 244 |
+
while {[gets $f line] >= 0} {
|
| 245 |
+
if {[regexp {^proc[ ]+([^ ]*)} $line match procName]} {
|
| 246 |
+
set procName [lindex [auto_qualify $procName "::"] 0]
|
| 247 |
+
append index "set [list auto_index($procName)]"
|
| 248 |
+
append index " \[list source \[file join \$dir [list $file]\]\]\n"
|
| 249 |
+
}
|
| 250 |
+
}
|
| 251 |
+
close $f
|
| 252 |
+
} msg opts]
|
| 253 |
+
if {$error} {
|
| 254 |
+
catch {close $f}
|
| 255 |
+
cd $oldDir
|
| 256 |
+
return -options $opts $msg
|
| 257 |
+
}
|
| 258 |
+
}
|
| 259 |
+
set f ""
|
| 260 |
+
set error [catch {
|
| 261 |
+
set f [open tclIndex w]
|
| 262 |
+
puts -nonewline $f $index
|
| 263 |
+
close $f
|
| 264 |
+
cd $oldDir
|
| 265 |
+
} msg opts]
|
| 266 |
+
if {$error} {
|
| 267 |
+
catch {close $f}
|
| 268 |
+
cd $oldDir
|
| 269 |
+
error $msg $info $code
|
| 270 |
+
return -options $opts $msg
|
| 271 |
+
}
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
# Create a safe interpreter that can be used to parse Tcl source files
|
| 275 |
+
# generate a tclIndex file for autoloading. This interp contains commands for
|
| 276 |
+
# things that need index entries. Each time a command is executed, it writes
|
| 277 |
+
# an entry out to the index file.
|
| 278 |
+
|
| 279 |
+
namespace eval auto_mkindex_parser {
|
| 280 |
+
variable parser "" ;# parser used to build index
|
| 281 |
+
variable index "" ;# maintains index as it is built
|
| 282 |
+
variable scriptFile "" ;# name of file being processed
|
| 283 |
+
variable contextStack "" ;# stack of namespace scopes
|
| 284 |
+
variable imports "" ;# keeps track of all imported cmds
|
| 285 |
+
variable initCommands ;# list of commands that create aliases
|
| 286 |
+
if {![info exists initCommands]} {
|
| 287 |
+
set initCommands [list]
|
| 288 |
+
}
|
| 289 |
+
|
| 290 |
+
proc init {} {
|
| 291 |
+
variable parser
|
| 292 |
+
variable initCommands
|
| 293 |
+
|
| 294 |
+
if {![interp issafe]} {
|
| 295 |
+
set parser [interp create -safe]
|
| 296 |
+
$parser hide info
|
| 297 |
+
$parser hide rename
|
| 298 |
+
$parser hide proc
|
| 299 |
+
$parser hide namespace
|
| 300 |
+
$parser hide eval
|
| 301 |
+
$parser hide puts
|
| 302 |
+
foreach ns [$parser invokehidden namespace children ::] {
|
| 303 |
+
# MUST NOT DELETE "::tcl" OR BAD THINGS HAPPEN!
|
| 304 |
+
if {$ns eq "::tcl"} continue
|
| 305 |
+
$parser invokehidden namespace delete $ns
|
| 306 |
+
}
|
| 307 |
+
foreach cmd [$parser invokehidden info commands ::*] {
|
| 308 |
+
$parser invokehidden rename $cmd {}
|
| 309 |
+
}
|
| 310 |
+
$parser invokehidden proc unknown {args} {}
|
| 311 |
+
|
| 312 |
+
# We'll need access to the "namespace" command within the
|
| 313 |
+
# interp. Put it back, but move it out of the way.
|
| 314 |
+
|
| 315 |
+
$parser expose namespace
|
| 316 |
+
$parser invokehidden rename namespace _%@namespace
|
| 317 |
+
$parser expose eval
|
| 318 |
+
$parser invokehidden rename eval _%@eval
|
| 319 |
+
|
| 320 |
+
# Install all the registered pseudo-command implementations
|
| 321 |
+
|
| 322 |
+
foreach cmd $initCommands {
|
| 323 |
+
eval $cmd
|
| 324 |
+
}
|
| 325 |
+
}
|
| 326 |
+
}
|
| 327 |
+
proc cleanup {} {
|
| 328 |
+
variable parser
|
| 329 |
+
interp delete $parser
|
| 330 |
+
unset parser
|
| 331 |
+
}
|
| 332 |
+
}
|
| 333 |
+
|
| 334 |
+
# auto_mkindex_parser::mkindex --
|
| 335 |
+
#
|
| 336 |
+
# Used by the "auto_mkindex" command to create a "tclIndex" file for the given
|
| 337 |
+
# Tcl source file. Executes the commands in the file, and handles things like
|
| 338 |
+
# the "proc" command by adding an entry for the index file. Returns a string
|
| 339 |
+
# that represents the index file.
|
| 340 |
+
#
|
| 341 |
+
# Arguments:
|
| 342 |
+
# file Name of Tcl source file to be indexed.
|
| 343 |
+
|
| 344 |
+
proc auto_mkindex_parser::mkindex {file} {
|
| 345 |
+
variable parser
|
| 346 |
+
variable index
|
| 347 |
+
variable scriptFile
|
| 348 |
+
variable contextStack
|
| 349 |
+
variable imports
|
| 350 |
+
|
| 351 |
+
set scriptFile $file
|
| 352 |
+
|
| 353 |
+
set fid [open $file]
|
| 354 |
+
fconfigure $fid -eofchar "\x1A {}"
|
| 355 |
+
set contents [read $fid]
|
| 356 |
+
close $fid
|
| 357 |
+
|
| 358 |
+
# There is one problem with sourcing files into the safe interpreter:
|
| 359 |
+
# references like "$x" will fail since code is not really being executed
|
| 360 |
+
# and variables do not really exist. To avoid this, we replace all $ with
|
| 361 |
+
# \0 (literally, the null char) later, when getting proc names we will
|
| 362 |
+
# have to reverse this replacement, in case there were any $ in the proc
|
| 363 |
+
# name. This will cause a problem if somebody actually tries to have a \0
|
| 364 |
+
# in their proc name. Too bad for them.
|
| 365 |
+
set contents [string map [list \$ \0] $contents]
|
| 366 |
+
|
| 367 |
+
set index ""
|
| 368 |
+
set contextStack ""
|
| 369 |
+
set imports ""
|
| 370 |
+
|
| 371 |
+
$parser eval $contents
|
| 372 |
+
|
| 373 |
+
foreach name $imports {
|
| 374 |
+
catch {$parser eval [list _%@namespace forget $name]}
|
| 375 |
+
}
|
| 376 |
+
return $index
|
| 377 |
+
}
|
| 378 |
+
|
| 379 |
+
# auto_mkindex_parser::hook command
|
| 380 |
+
#
|
| 381 |
+
# Registers a Tcl command to evaluate when initializing the child interpreter
|
| 382 |
+
# used by the mkindex parser. The command is evaluated in the parent
|
| 383 |
+
# interpreter, and can use the variable auto_mkindex_parser::parser to get to
|
| 384 |
+
# the child
|
| 385 |
+
|
| 386 |
+
proc auto_mkindex_parser::hook {cmd} {
|
| 387 |
+
variable initCommands
|
| 388 |
+
|
| 389 |
+
lappend initCommands $cmd
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
# auto_mkindex_parser::slavehook command
|
| 393 |
+
#
|
| 394 |
+
# Registers a Tcl command to evaluate when initializing the child interpreter
|
| 395 |
+
# used by the mkindex parser. The command is evaluated in the child
|
| 396 |
+
# interpreter.
|
| 397 |
+
|
| 398 |
+
proc auto_mkindex_parser::slavehook {cmd} {
|
| 399 |
+
variable initCommands
|
| 400 |
+
|
| 401 |
+
# The $parser variable is defined to be the name of the child interpreter
|
| 402 |
+
# when this command is used later.
|
| 403 |
+
|
| 404 |
+
lappend initCommands "\$parser eval [list $cmd]"
|
| 405 |
+
}
|
| 406 |
+
|
| 407 |
+
# auto_mkindex_parser::command --
|
| 408 |
+
#
|
| 409 |
+
# Registers a new command with the "auto_mkindex_parser" interpreter that
|
| 410 |
+
# parses Tcl files. These commands are fake versions of things like the
|
| 411 |
+
# "proc" command. When you execute them, they simply write out an entry to a
|
| 412 |
+
# "tclIndex" file for auto-loading.
|
| 413 |
+
#
|
| 414 |
+
# This procedure allows extensions to register their own commands with the
|
| 415 |
+
# auto_mkindex facility. For example, a package like [incr Tcl] might
|
| 416 |
+
# register a "class" command so that class definitions could be added to a
|
| 417 |
+
# "tclIndex" file for auto-loading.
|
| 418 |
+
#
|
| 419 |
+
# Arguments:
|
| 420 |
+
# name Name of command recognized in Tcl files.
|
| 421 |
+
# arglist Argument list for command.
|
| 422 |
+
# body Implementation of command to handle indexing.
|
| 423 |
+
|
| 424 |
+
proc auto_mkindex_parser::command {name arglist body} {
|
| 425 |
+
hook [list auto_mkindex_parser::commandInit $name $arglist $body]
|
| 426 |
+
}
|
| 427 |
+
|
| 428 |
+
# auto_mkindex_parser::commandInit --
|
| 429 |
+
#
|
| 430 |
+
# This does the actual work set up by auto_mkindex_parser::command. This is
|
| 431 |
+
# called when the interpreter used by the parser is created.
|
| 432 |
+
#
|
| 433 |
+
# Arguments:
|
| 434 |
+
# name Name of command recognized in Tcl files.
|
| 435 |
+
# arglist Argument list for command.
|
| 436 |
+
# body Implementation of command to handle indexing.
|
| 437 |
+
|
| 438 |
+
proc auto_mkindex_parser::commandInit {name arglist body} {
|
| 439 |
+
variable parser
|
| 440 |
+
|
| 441 |
+
set ns [namespace qualifiers $name]
|
| 442 |
+
set tail [namespace tail $name]
|
| 443 |
+
if {$ns eq ""} {
|
| 444 |
+
set fakeName [namespace current]::_%@fake_$tail
|
| 445 |
+
} else {
|
| 446 |
+
set fakeName [namespace current]::[string map {:: _} _%@fake_$name]
|
| 447 |
+
}
|
| 448 |
+
proc $fakeName $arglist $body
|
| 449 |
+
|
| 450 |
+
# YUK! Tcl won't let us alias fully qualified command names, so we can't
|
| 451 |
+
# handle names like "::itcl::class". Instead, we have to build procs with
|
| 452 |
+
# the fully qualified names, and have the procs point to the aliases.
|
| 453 |
+
|
| 454 |
+
if {[string match *::* $name]} {
|
| 455 |
+
set exportCmd [list _%@namespace export [namespace tail $name]]
|
| 456 |
+
$parser eval [list _%@namespace eval $ns $exportCmd]
|
| 457 |
+
|
| 458 |
+
# The following proc definition does not work if you want to tolerate
|
| 459 |
+
# space or something else diabolical in the procedure name, (i.e.,
|
| 460 |
+
# space in $alias). The following does not work:
|
| 461 |
+
# "_%@eval {$alias} \$args"
|
| 462 |
+
# because $alias gets concat'ed to $args. The following does not work
|
| 463 |
+
# because $cmd is somehow undefined
|
| 464 |
+
# "set cmd {$alias} \; _%@eval {\$cmd} \$args"
|
| 465 |
+
# A gold star to someone that can make test autoMkindex-3.3 work
|
| 466 |
+
# properly
|
| 467 |
+
|
| 468 |
+
set alias [namespace tail $fakeName]
|
| 469 |
+
$parser invokehidden proc $name {args} "_%@eval {$alias} \$args"
|
| 470 |
+
$parser alias $alias $fakeName
|
| 471 |
+
} else {
|
| 472 |
+
$parser alias $name $fakeName
|
| 473 |
+
}
|
| 474 |
+
return
|
| 475 |
+
}
|
| 476 |
+
|
| 477 |
+
# auto_mkindex_parser::fullname --
|
| 478 |
+
#
|
| 479 |
+
# Used by commands like "proc" within the auto_mkindex parser. Returns the
|
| 480 |
+
# qualified namespace name for the "name" argument. If the "name" does not
|
| 481 |
+
# start with "::", elements are added from the current namespace stack to
|
| 482 |
+
# produce a qualified name. Then, the name is examined to see whether or not
|
| 483 |
+
# it should really be qualified. If the name has more than the leading "::",
|
| 484 |
+
# it is returned as a fully qualified name. Otherwise, it is returned as a
|
| 485 |
+
# simple name. That way, the Tcl autoloader will recognize it properly.
|
| 486 |
+
#
|
| 487 |
+
# Arguments:
|
| 488 |
+
# name - Name that is being added to index.
|
| 489 |
+
|
| 490 |
+
proc auto_mkindex_parser::fullname {name} {
|
| 491 |
+
variable contextStack
|
| 492 |
+
|
| 493 |
+
if {![string match ::* $name]} {
|
| 494 |
+
foreach ns $contextStack {
|
| 495 |
+
set name "${ns}::$name"
|
| 496 |
+
if {[string match ::* $name]} {
|
| 497 |
+
break
|
| 498 |
+
}
|
| 499 |
+
}
|
| 500 |
+
}
|
| 501 |
+
|
| 502 |
+
if {[namespace qualifiers $name] eq ""} {
|
| 503 |
+
set name [namespace tail $name]
|
| 504 |
+
} elseif {![string match ::* $name]} {
|
| 505 |
+
set name "::$name"
|
| 506 |
+
}
|
| 507 |
+
|
| 508 |
+
# Earlier, mkindex replaced all $'s with \0. Now, we have to reverse that
|
| 509 |
+
# replacement.
|
| 510 |
+
return [string map [list \0 \$] $name]
|
| 511 |
+
}
|
| 512 |
+
|
| 513 |
+
# auto_mkindex_parser::indexEntry --
|
| 514 |
+
#
|
| 515 |
+
# Used by commands like "proc" within the auto_mkindex parser to add a
|
| 516 |
+
# correctly-quoted entry to the index. This is shared code so it is done
|
| 517 |
+
# *right*, in one place.
|
| 518 |
+
#
|
| 519 |
+
# Arguments:
|
| 520 |
+
# name - Name that is being added to index.
|
| 521 |
+
|
| 522 |
+
proc auto_mkindex_parser::indexEntry {name} {
|
| 523 |
+
variable index
|
| 524 |
+
variable scriptFile
|
| 525 |
+
|
| 526 |
+
# We convert all metacharacters to their backslashed form, and pre-split
|
| 527 |
+
# the file name that we know about (which will be a proper list, and so
|
| 528 |
+
# correctly quoted).
|
| 529 |
+
|
| 530 |
+
set name [string range [list \}[fullname $name]] 2 end]
|
| 531 |
+
set filenameParts [file split $scriptFile]
|
| 532 |
+
|
| 533 |
+
append index [format \
|
| 534 |
+
{set auto_index(%s) [list source [file join $dir %s]]%s} \
|
| 535 |
+
$name $filenameParts \n]
|
| 536 |
+
return
|
| 537 |
+
}
|
| 538 |
+
|
| 539 |
+
if {[llength $::auto_mkindex_parser::initCommands]} {
|
| 540 |
+
return
|
| 541 |
+
}
|
| 542 |
+
|
| 543 |
+
# Register all of the procedures for the auto_mkindex parser that will build
|
| 544 |
+
# the "tclIndex" file.
|
| 545 |
+
|
| 546 |
+
# AUTO MKINDEX: proc name arglist body
|
| 547 |
+
# Adds an entry to the auto index list for the given procedure name.
|
| 548 |
+
|
| 549 |
+
auto_mkindex_parser::command proc {name args} {
|
| 550 |
+
indexEntry $name
|
| 551 |
+
}
|
| 552 |
+
|
| 553 |
+
# Conditionally add support for Tcl byte code files. There are some tricky
|
| 554 |
+
# details here. First, we need to get the tbcload library initialized in the
|
| 555 |
+
# current interpreter. We cannot load tbcload into the child until we have
|
| 556 |
+
# done so because it needs access to the tcl_patchLevel variable. Second,
|
| 557 |
+
# because the package index file may defer loading the library until we invoke
|
| 558 |
+
# a command, we need to explicitly invoke auto_load to force it to be loaded.
|
| 559 |
+
# This should be a noop if the package has already been loaded
|
| 560 |
+
|
| 561 |
+
auto_mkindex_parser::hook {
|
| 562 |
+
try {
|
| 563 |
+
package require tbcload
|
| 564 |
+
} on error {} {
|
| 565 |
+
# OK, don't have it so do nothing
|
| 566 |
+
} on ok {} {
|
| 567 |
+
if {[namespace which -command tbcload::bcproc] eq ""} {
|
| 568 |
+
auto_load tbcload::bcproc
|
| 569 |
+
}
|
| 570 |
+
load {} tbcload $auto_mkindex_parser::parser
|
| 571 |
+
|
| 572 |
+
# AUTO MKINDEX: tbcload::bcproc name arglist body
|
| 573 |
+
# Adds an entry to the auto index list for the given precompiled
|
| 574 |
+
# procedure name.
|
| 575 |
+
|
| 576 |
+
auto_mkindex_parser::commandInit tbcload::bcproc {name args} {
|
| 577 |
+
indexEntry $name
|
| 578 |
+
}
|
| 579 |
+
}
|
| 580 |
+
}
|
| 581 |
+
|
| 582 |
+
# AUTO MKINDEX: namespace eval name command ?arg arg...?
|
| 583 |
+
# Adds the namespace name onto the context stack and evaluates the associated
|
| 584 |
+
# body of commands.
|
| 585 |
+
#
|
| 586 |
+
# AUTO MKINDEX: namespace import ?-force? pattern ?pattern...?
|
| 587 |
+
# Performs the "import" action in the parser interpreter. This is important
|
| 588 |
+
# for any commands contained in a namespace that affect the index. For
|
| 589 |
+
# example, a script may say "itcl::class ...", or it may import "itcl::*" and
|
| 590 |
+
# then say "class ...". This procedure does the import operation, but keeps
|
| 591 |
+
# track of imported patterns so we can remove the imports later.
|
| 592 |
+
|
| 593 |
+
auto_mkindex_parser::command namespace {op args} {
|
| 594 |
+
switch -- $op {
|
| 595 |
+
eval {
|
| 596 |
+
variable parser
|
| 597 |
+
variable contextStack
|
| 598 |
+
|
| 599 |
+
set name [lindex $args 0]
|
| 600 |
+
set args [lrange $args 1 end]
|
| 601 |
+
|
| 602 |
+
set contextStack [linsert $contextStack 0 $name]
|
| 603 |
+
$parser eval [list _%@namespace eval $name] $args
|
| 604 |
+
set contextStack [lrange $contextStack 1 end]
|
| 605 |
+
}
|
| 606 |
+
import {
|
| 607 |
+
variable parser
|
| 608 |
+
variable imports
|
| 609 |
+
foreach pattern $args {
|
| 610 |
+
if {$pattern ne "-force"} {
|
| 611 |
+
lappend imports $pattern
|
| 612 |
+
}
|
| 613 |
+
}
|
| 614 |
+
catch {$parser eval "_%@namespace import $args"}
|
| 615 |
+
}
|
| 616 |
+
ensemble {
|
| 617 |
+
variable parser
|
| 618 |
+
variable contextStack
|
| 619 |
+
if {[lindex $args 0] eq "create"} {
|
| 620 |
+
set name ::[join [lreverse $contextStack] ::]
|
| 621 |
+
catch {
|
| 622 |
+
set name [dict get [lrange $args 1 end] -command]
|
| 623 |
+
if {![string match ::* $name]} {
|
| 624 |
+
set name ::[join [lreverse $contextStack] ::]$name
|
| 625 |
+
}
|
| 626 |
+
regsub -all ::+ $name :: name
|
| 627 |
+
}
|
| 628 |
+
# create artificial proc to force an entry in the tclIndex
|
| 629 |
+
$parser eval [list ::proc $name {} {}]
|
| 630 |
+
}
|
| 631 |
+
}
|
| 632 |
+
}
|
| 633 |
+
}
|
| 634 |
+
|
| 635 |
+
# AUTO MKINDEX: oo::class create name ?definition?
|
| 636 |
+
# Adds an entry to the auto index list for the given class name.
|
| 637 |
+
auto_mkindex_parser::command oo::class {op name {body ""}} {
|
| 638 |
+
if {$op eq "create"} {
|
| 639 |
+
indexEntry $name
|
| 640 |
+
}
|
| 641 |
+
}
|
| 642 |
+
auto_mkindex_parser::command class {op name {body ""}} {
|
| 643 |
+
if {$op eq "create"} {
|
| 644 |
+
indexEntry $name
|
| 645 |
+
}
|
| 646 |
+
}
|
| 647 |
+
|
| 648 |
+
return
|
mplug_owl2/lib/tcl8.6/encoding/cp1252.enc
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Encoding file: cp1252, single-byte
|
| 2 |
+
S
|
| 3 |
+
003F 0 1
|
| 4 |
+
00
|
| 5 |
+
0000000100020003000400050006000700080009000A000B000C000D000E000F
|
| 6 |
+
0010001100120013001400150016001700180019001A001B001C001D001E001F
|
| 7 |
+
0020002100220023002400250026002700280029002A002B002C002D002E002F
|
| 8 |
+
0030003100320033003400350036003700380039003A003B003C003D003E003F
|
| 9 |
+
0040004100420043004400450046004700480049004A004B004C004D004E004F
|
| 10 |
+
0050005100520053005400550056005700580059005A005B005C005D005E005F
|
| 11 |
+
0060006100620063006400650066006700680069006A006B006C006D006E006F
|
| 12 |
+
0070007100720073007400750076007700780079007A007B007C007D007E007F
|
| 13 |
+
20AC0081201A0192201E20262020202102C62030016020390152008D017D008F
|
| 14 |
+
009020182019201C201D20222013201402DC21220161203A0153009D017E0178
|
| 15 |
+
00A000A100A200A300A400A500A600A700A800A900AA00AB00AC00AD00AE00AF
|
| 16 |
+
00B000B100B200B300B400B500B600B700B800B900BA00BB00BC00BD00BE00BF
|
| 17 |
+
00C000C100C200C300C400C500C600C700C800C900CA00CB00CC00CD00CE00CF
|
| 18 |
+
00D000D100D200D300D400D500D600D700D800D900DA00DB00DC00DD00DE00DF
|
| 19 |
+
00E000E100E200E300E400E500E600E700E800E900EA00EB00EC00ED00EE00EF
|
| 20 |
+
00F000F100F200F300F400F500F600F700F800F900FA00FB00FC00FD00FE00FF
|
mplug_owl2/lib/tcl8.6/encoding/cp860.enc
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Encoding file: cp860, single-byte
|
| 2 |
+
S
|
| 3 |
+
003F 0 1
|
| 4 |
+
00
|
| 5 |
+
0000000100020003000400050006000700080009000A000B000C000D000E000F
|
| 6 |
+
0010001100120013001400150016001700180019001A001B001C001D001E001F
|
| 7 |
+
0020002100220023002400250026002700280029002A002B002C002D002E002F
|
| 8 |
+
0030003100320033003400350036003700380039003A003B003C003D003E003F
|
| 9 |
+
0040004100420043004400450046004700480049004A004B004C004D004E004F
|
| 10 |
+
0050005100520053005400550056005700580059005A005B005C005D005E005F
|
| 11 |
+
0060006100620063006400650066006700680069006A006B006C006D006E006F
|
| 12 |
+
0070007100720073007400750076007700780079007A007B007C007D007E007F
|
| 13 |
+
00C700FC00E900E200E300E000C100E700EA00CA00E800CD00D400EC00C300C2
|
| 14 |
+
00C900C000C800F400F500F200DA00F900CC00D500DC00A200A300D920A700D3
|
| 15 |
+
00E100ED00F300FA00F100D100AA00BA00BF00D200AC00BD00BC00A100AB00BB
|
| 16 |
+
259125922593250225242561256225562555256325512557255D255C255B2510
|
| 17 |
+
25142534252C251C2500253C255E255F255A25542569256625602550256C2567
|
| 18 |
+
2568256425652559255825522553256B256A2518250C25882584258C25902580
|
| 19 |
+
03B100DF039303C003A303C300B503C403A6039803A903B4221E03C603B52229
|
| 20 |
+
226100B1226522642320232100F7224800B0221900B7221A207F00B225A000A0
|
mplug_owl2/lib/tcl8.6/encoding/euc-kr.enc
ADDED
|
@@ -0,0 +1,1533 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Encoding file: euc-kr, multi-byte
|
| 2 |
+
M
|
| 3 |
+
003F 0 90
|
| 4 |
+
00
|
| 5 |
+
0000000100020003000400050006000700080009000A000B000C000D000E000F
|
| 6 |
+
0010001100120013001400150016001700180019001A001B001C001D001E001F
|
| 7 |
+
0020002100220023002400250026002700280029002A002B002C002D002E002F
|
| 8 |
+
0030003100320033003400350036003700380039003A003B003C003D003E003F
|
| 9 |
+
0040004100420043004400450046004700480049004A004B004C004D004E004F
|
| 10 |
+
0050005100520053005400550056005700580059005A005B005C005D005E005F
|
| 11 |
+
0060006100620063006400650066006700680069006A006B006C006D006E006F
|
| 12 |
+
0070007100720073007400750076007700780079007A007B007C007D007E007F
|
| 13 |
+
0080008100820083008400850086008700880089008A008B008C008D008E008F
|
| 14 |
+
0090009100920093009400950096009700980099009A009B009C009D009E009F
|
| 15 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 16 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 17 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 18 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 19 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 20 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 21 |
+
A1
|
| 22 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 23 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 24 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 25 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 26 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 27 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 28 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 29 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 30 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 31 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 32 |
+
000030003001300200B72025202600A8300300AD20152225FF3C223C20182019
|
| 33 |
+
201C201D3014301530083009300A300B300C300D300E300F3010301100B100D7
|
| 34 |
+
00F7226022642265221E223400B0203220332103212BFFE0FFE1FFE526422640
|
| 35 |
+
222022A52312220222072261225200A7203B2606260525CB25CF25CE25C725C6
|
| 36 |
+
25A125A025B325B225BD25BC219221902191219321943013226A226B221A223D
|
| 37 |
+
221D2235222B222C2208220B2286228722822283222A222922272228FFE20000
|
| 38 |
+
A2
|
| 39 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 40 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 41 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 42 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 43 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 44 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 45 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 46 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 47 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 48 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 49 |
+
000021D221D42200220300B4FF5E02C702D802DD02DA02D900B802DB00A100BF
|
| 50 |
+
02D0222E2211220F00A42109203025C125C025B725B626642660266126652667
|
| 51 |
+
2663229925C825A325D025D1259225A425A525A825A725A625A92668260F260E
|
| 52 |
+
261C261E00B62020202121952197219921962198266D2669266A266C327F321C
|
| 53 |
+
211633C7212233C233D821210000000000000000000000000000000000000000
|
| 54 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 55 |
+
A3
|
| 56 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 57 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 58 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 59 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 60 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 61 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 62 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 63 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 64 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 65 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 66 |
+
0000FF01FF02FF03FF04FF05FF06FF07FF08FF09FF0AFF0BFF0CFF0DFF0EFF0F
|
| 67 |
+
FF10FF11FF12FF13FF14FF15FF16FF17FF18FF19FF1AFF1BFF1CFF1DFF1EFF1F
|
| 68 |
+
FF20FF21FF22FF23FF24FF25FF26FF27FF28FF29FF2AFF2BFF2CFF2DFF2EFF2F
|
| 69 |
+
FF30FF31FF32FF33FF34FF35FF36FF37FF38FF39FF3AFF3BFFE6FF3DFF3EFF3F
|
| 70 |
+
FF40FF41FF42FF43FF44FF45FF46FF47FF48FF49FF4AFF4BFF4CFF4DFF4EFF4F
|
| 71 |
+
FF50FF51FF52FF53FF54FF55FF56FF57FF58FF59FF5AFF5BFF5CFF5DFFE30000
|
| 72 |
+
A4
|
| 73 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 74 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 75 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 76 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 77 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 78 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 79 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 80 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 81 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 82 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 83 |
+
0000313131323133313431353136313731383139313A313B313C313D313E313F
|
| 84 |
+
3140314131423143314431453146314731483149314A314B314C314D314E314F
|
| 85 |
+
3150315131523153315431553156315731583159315A315B315C315D315E315F
|
| 86 |
+
3160316131623163316431653166316731683169316A316B316C316D316E316F
|
| 87 |
+
3170317131723173317431753176317731783179317A317B317C317D317E317F
|
| 88 |
+
3180318131823183318431853186318731883189318A318B318C318D318E0000
|
| 89 |
+
A5
|
| 90 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 91 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 92 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 93 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 94 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 95 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 96 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 97 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 98 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 99 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 100 |
+
0000217021712172217321742175217621772178217900000000000000000000
|
| 101 |
+
2160216121622163216421652166216721682169000000000000000000000000
|
| 102 |
+
0000039103920393039403950396039703980399039A039B039C039D039E039F
|
| 103 |
+
03A003A103A303A403A503A603A703A803A90000000000000000000000000000
|
| 104 |
+
000003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF
|
| 105 |
+
03C003C103C303C403C503C603C703C803C90000000000000000000000000000
|
| 106 |
+
A6
|
| 107 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 108 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 109 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 110 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 111 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 112 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 113 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 114 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 115 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 116 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 117 |
+
000025002502250C251025182514251C252C25242534253C25012503250F2513
|
| 118 |
+
251B251725232533252B253B254B2520252F25282537253F251D253025252538
|
| 119 |
+
254225122511251A251925162515250E250D251E251F25212522252625272529
|
| 120 |
+
252A252D252E25312532253525362539253A253D253E25402541254325442545
|
| 121 |
+
2546254725482549254A00000000000000000000000000000000000000000000
|
| 122 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 123 |
+
A7
|
| 124 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 125 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 126 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 127 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 128 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 129 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 130 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 131 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 132 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 133 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 134 |
+
00003395339633972113339833C433A333A433A533A63399339A339B339C339D
|
| 135 |
+
339E339F33A033A133A233CA338D338E338F33CF3388338933C833A733A833B0
|
| 136 |
+
33B133B233B333B433B533B633B733B833B93380338133823383338433BA33BB
|
| 137 |
+
33BC33BD33BE33BF33903391339233933394212633C033C1338A338B338C33D6
|
| 138 |
+
33C533AD33AE33AF33DB33A933AA33AB33AC33DD33D033D333C333C933DC33C6
|
| 139 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 140 |
+
A8
|
| 141 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 142 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 143 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 144 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 145 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 146 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 147 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 148 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 149 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 150 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 151 |
+
000000C600D000AA0126000001320000013F014100D8015200BA00DE0166014A
|
| 152 |
+
00003260326132623263326432653266326732683269326A326B326C326D326E
|
| 153 |
+
326F3270327132723273327432753276327732783279327A327B24D024D124D2
|
| 154 |
+
24D324D424D524D624D724D824D924DA24DB24DC24DD24DE24DF24E024E124E2
|
| 155 |
+
24E324E424E524E624E724E824E9246024612462246324642465246624672468
|
| 156 |
+
2469246A246B246C246D246E00BD2153215400BC00BE215B215C215D215E0000
|
| 157 |
+
A9
|
| 158 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 159 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 160 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 161 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 162 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 163 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 164 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 165 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 166 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 167 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 168 |
+
000000E6011100F001270131013301380140014200F8015300DF00FE0167014B
|
| 169 |
+
01493200320132023203320432053206320732083209320A320B320C320D320E
|
| 170 |
+
320F3210321132123213321432153216321732183219321A321B249C249D249E
|
| 171 |
+
249F24A024A124A224A324A424A524A624A724A824A924AA24AB24AC24AD24AE
|
| 172 |
+
24AF24B024B124B224B324B424B5247424752476247724782479247A247B247C
|
| 173 |
+
247D247E247F24802481248200B900B200B32074207F20812082208320840000
|
| 174 |
+
AA
|
| 175 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 176 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 177 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 178 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 179 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 180 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 181 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 182 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 183 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 184 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 185 |
+
0000304130423043304430453046304730483049304A304B304C304D304E304F
|
| 186 |
+
3050305130523053305430553056305730583059305A305B305C305D305E305F
|
| 187 |
+
3060306130623063306430653066306730683069306A306B306C306D306E306F
|
| 188 |
+
3070307130723073307430753076307730783079307A307B307C307D307E307F
|
| 189 |
+
3080308130823083308430853086308730883089308A308B308C308D308E308F
|
| 190 |
+
3090309130923093000000000000000000000000000000000000000000000000
|
| 191 |
+
AB
|
| 192 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 193 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 194 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 195 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 196 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 197 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 198 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 199 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 200 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 201 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 202 |
+
000030A130A230A330A430A530A630A730A830A930AA30AB30AC30AD30AE30AF
|
| 203 |
+
30B030B130B230B330B430B530B630B730B830B930BA30BB30BC30BD30BE30BF
|
| 204 |
+
30C030C130C230C330C430C530C630C730C830C930CA30CB30CC30CD30CE30CF
|
| 205 |
+
30D030D130D230D330D430D530D630D730D830D930DA30DB30DC30DD30DE30DF
|
| 206 |
+
30E030E130E230E330E430E530E630E730E830E930EA30EB30EC30ED30EE30EF
|
| 207 |
+
30F030F130F230F330F430F530F6000000000000000000000000000000000000
|
| 208 |
+
AC
|
| 209 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 210 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 211 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 212 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 213 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 214 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 215 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 216 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 217 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 218 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 219 |
+
000004100411041204130414041504010416041704180419041A041B041C041D
|
| 220 |
+
041E041F0420042104220423042404250426042704280429042A042B042C042D
|
| 221 |
+
042E042F00000000000000000000000000000000000000000000000000000000
|
| 222 |
+
000004300431043204330434043504510436043704380439043A043B043C043D
|
| 223 |
+
043E043F0440044104420443044404450446044704480449044A044B044C044D
|
| 224 |
+
044E044F00000000000000000000000000000000000000000000000000000000
|
| 225 |
+
B0
|
| 226 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 227 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 228 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 229 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 230 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 231 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 232 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 233 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 234 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 235 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 236 |
+
0000AC00AC01AC04AC07AC08AC09AC0AAC10AC11AC12AC13AC14AC15AC16AC17
|
| 237 |
+
AC19AC1AAC1BAC1CAC1DAC20AC24AC2CAC2DAC2FAC30AC31AC38AC39AC3CAC40
|
| 238 |
+
AC4BAC4DAC54AC58AC5CAC70AC71AC74AC77AC78AC7AAC80AC81AC83AC84AC85
|
| 239 |
+
AC86AC89AC8AAC8BAC8CAC90AC94AC9CAC9DAC9FACA0ACA1ACA8ACA9ACAAACAC
|
| 240 |
+
ACAFACB0ACB8ACB9ACBBACBCACBDACC1ACC4ACC8ACCCACD5ACD7ACE0ACE1ACE4
|
| 241 |
+
ACE7ACE8ACEAACECACEFACF0ACF1ACF3ACF5ACF6ACFCACFDAD00AD04AD060000
|
| 242 |
+
B1
|
| 243 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 244 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 245 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 246 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 247 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 248 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 249 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 250 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 251 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 252 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 253 |
+
0000AD0CAD0DAD0FAD11AD18AD1CAD20AD29AD2CAD2DAD34AD35AD38AD3CAD44
|
| 254 |
+
AD45AD47AD49AD50AD54AD58AD61AD63AD6CAD6DAD70AD73AD74AD75AD76AD7B
|
| 255 |
+
AD7CAD7DAD7FAD81AD82AD88AD89AD8CAD90AD9CAD9DADA4ADB7ADC0ADC1ADC4
|
| 256 |
+
ADC8ADD0ADD1ADD3ADDCADE0ADE4ADF8ADF9ADFCADFFAE00AE01AE08AE09AE0B
|
| 257 |
+
AE0DAE14AE30AE31AE34AE37AE38AE3AAE40AE41AE43AE45AE46AE4AAE4CAE4D
|
| 258 |
+
AE4EAE50AE54AE56AE5CAE5DAE5FAE60AE61AE65AE68AE69AE6CAE70AE780000
|
| 259 |
+
B2
|
| 260 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 261 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 262 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 263 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 264 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 265 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 266 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 267 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 268 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 269 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 270 |
+
0000AE79AE7BAE7CAE7DAE84AE85AE8CAEBCAEBDAEBEAEC0AEC4AECCAECDAECF
|
| 271 |
+
AED0AED1AED8AED9AEDCAEE8AEEBAEEDAEF4AEF8AEFCAF07AF08AF0DAF10AF2C
|
| 272 |
+
AF2DAF30AF32AF34AF3CAF3DAF3FAF41AF42AF43AF48AF49AF50AF5CAF5DAF64
|
| 273 |
+
AF65AF79AF80AF84AF88AF90AF91AF95AF9CAFB8AFB9AFBCAFC0AFC7AFC8AFC9
|
| 274 |
+
AFCBAFCDAFCEAFD4AFDCAFE8AFE9AFF0AFF1AFF4AFF8B000B001B004B00CB010
|
| 275 |
+
B014B01CB01DB028B044B045B048B04AB04CB04EB053B054B055B057B0590000
|
| 276 |
+
B3
|
| 277 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 278 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 279 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 280 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 281 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 282 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 283 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 284 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 285 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 286 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 287 |
+
0000B05DB07CB07DB080B084B08CB08DB08FB091B098B099B09AB09CB09FB0A0
|
| 288 |
+
B0A1B0A2B0A8B0A9B0ABB0ACB0ADB0AEB0AFB0B1B0B3B0B4B0B5B0B8B0BCB0C4
|
| 289 |
+
B0C5B0C7B0C8B0C9B0D0B0D1B0D4B0D8B0E0B0E5B108B109B10BB10CB110B112
|
| 290 |
+
B113B118B119B11BB11CB11DB123B124B125B128B12CB134B135B137B138B139
|
| 291 |
+
B140B141B144B148B150B151B154B155B158B15CB160B178B179B17CB180B182
|
| 292 |
+
B188B189B18BB18DB192B193B194B198B19CB1A8B1CCB1D0B1D4B1DCB1DD0000
|
| 293 |
+
B4
|
| 294 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 295 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 296 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 297 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 298 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 299 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 300 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 301 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 302 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 303 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 304 |
+
0000B1DFB1E8B1E9B1ECB1F0B1F9B1FBB1FDB204B205B208B20BB20CB214B215
|
| 305 |
+
B217B219B220B234B23CB258B25CB260B268B269B274B275B27CB284B285B289
|
| 306 |
+
B290B291B294B298B299B29AB2A0B2A1B2A3B2A5B2A6B2AAB2ACB2B0B2B4B2C8
|
| 307 |
+
B2C9B2CCB2D0B2D2B2D8B2D9B2DBB2DDB2E2B2E4B2E5B2E6B2E8B2EBB2ECB2ED
|
| 308 |
+
B2EEB2EFB2F3B2F4B2F5B2F7B2F8B2F9B2FAB2FBB2FFB300B301B304B308B310
|
| 309 |
+
B311B313B314B315B31CB354B355B356B358B35BB35CB35EB35FB364B3650000
|
| 310 |
+
B5
|
| 311 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 312 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 313 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 314 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 315 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 316 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 317 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 318 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 319 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 320 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 321 |
+
0000B367B369B36BB36EB370B371B374B378B380B381B383B384B385B38CB390
|
| 322 |
+
B394B3A0B3A1B3A8B3ACB3C4B3C5B3C8B3CBB3CCB3CEB3D0B3D4B3D5B3D7B3D9
|
| 323 |
+
B3DBB3DDB3E0B3E4B3E8B3FCB410B418B41CB420B428B429B42BB434B450B451
|
| 324 |
+
B454B458B460B461B463B465B46CB480B488B49DB4A4B4A8B4ACB4B5B4B7B4B9
|
| 325 |
+
B4C0B4C4B4C8B4D0B4D5B4DCB4DDB4E0B4E3B4E4B4E6B4ECB4EDB4EFB4F1B4F8
|
| 326 |
+
B514B515B518B51BB51CB524B525B527B528B529B52AB530B531B534B5380000
|
| 327 |
+
B6
|
| 328 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 329 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 330 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 331 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 332 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 333 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 334 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 335 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 336 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 337 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 338 |
+
0000B540B541B543B544B545B54BB54CB54DB550B554B55CB55DB55FB560B561
|
| 339 |
+
B5A0B5A1B5A4B5A8B5AAB5ABB5B0B5B1B5B3B5B4B5B5B5BBB5BCB5BDB5C0B5C4
|
| 340 |
+
B5CCB5CDB5CFB5D0B5D1B5D8B5ECB610B611B614B618B625B62CB634B648B664
|
| 341 |
+
B668B69CB69DB6A0B6A4B6ABB6ACB6B1B6D4B6F0B6F4B6F8B700B701B705B728
|
| 342 |
+
B729B72CB72FB730B738B739B73BB744B748B74CB754B755B760B764B768B770
|
| 343 |
+
B771B773B775B77CB77DB780B784B78CB78DB78FB790B791B792B796B7970000
|
| 344 |
+
B7
|
| 345 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 346 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 347 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 348 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 349 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 350 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 351 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 352 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 353 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 354 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 355 |
+
0000B798B799B79CB7A0B7A8B7A9B7ABB7ACB7ADB7B4B7B5B7B8B7C7B7C9B7EC
|
| 356 |
+
B7EDB7F0B7F4B7FCB7FDB7FFB800B801B807B808B809B80CB810B818B819B81B
|
| 357 |
+
B81DB824B825B828B82CB834B835B837B838B839B840B844B851B853B85CB85D
|
| 358 |
+
B860B864B86CB86DB86FB871B878B87CB88DB8A8B8B0B8B4B8B8B8C0B8C1B8C3
|
| 359 |
+
B8C5B8CCB8D0B8D4B8DDB8DFB8E1B8E8B8E9B8ECB8F0B8F8B8F9B8FBB8FDB904
|
| 360 |
+
B918B920B93CB93DB940B944B94CB94FB951B958B959B95CB960B968B9690000
|
| 361 |
+
B8
|
| 362 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 363 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 364 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 365 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 366 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 367 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 368 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 369 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 370 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 371 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 372 |
+
0000B96BB96DB974B975B978B97CB984B985B987B989B98AB98DB98EB9ACB9AD
|
| 373 |
+
B9B0B9B4B9BCB9BDB9BFB9C1B9C8B9C9B9CCB9CEB9CFB9D0B9D1B9D2B9D8B9D9
|
| 374 |
+
B9DBB9DDB9DEB9E1B9E3B9E4B9E5B9E8B9ECB9F4B9F5B9F7B9F8B9F9B9FABA00
|
| 375 |
+
BA01BA08BA15BA38BA39BA3CBA40BA42BA48BA49BA4BBA4DBA4EBA53BA54BA55
|
| 376 |
+
BA58BA5CBA64BA65BA67BA68BA69BA70BA71BA74BA78BA83BA84BA85BA87BA8C
|
| 377 |
+
BAA8BAA9BAABBAACBAB0BAB2BAB8BAB9BABBBABDBAC4BAC8BAD8BAD9BAFC0000
|
| 378 |
+
B9
|
| 379 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 380 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 381 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 382 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 383 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 384 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 385 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 386 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 387 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 388 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 389 |
+
0000BB00BB04BB0DBB0FBB11BB18BB1CBB20BB29BB2BBB34BB35BB36BB38BB3B
|
| 390 |
+
BB3CBB3DBB3EBB44BB45BB47BB49BB4DBB4FBB50BB54BB58BB61BB63BB6CBB88
|
| 391 |
+
BB8CBB90BBA4BBA8BBACBBB4BBB7BBC0BBC4BBC8BBD0BBD3BBF8BBF9BBFCBBFF
|
| 392 |
+
BC00BC02BC08BC09BC0BBC0CBC0DBC0FBC11BC14BC15BC16BC17BC18BC1BBC1C
|
| 393 |
+
BC1DBC1EBC1FBC24BC25BC27BC29BC2DBC30BC31BC34BC38BC40BC41BC43BC44
|
| 394 |
+
BC45BC49BC4CBC4DBC50BC5DBC84BC85BC88BC8BBC8CBC8EBC94BC95BC970000
|
| 395 |
+
BA
|
| 396 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 397 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 398 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 399 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 400 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 401 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 402 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 403 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 404 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 405 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 406 |
+
0000BC99BC9ABCA0BCA1BCA4BCA7BCA8BCB0BCB1BCB3BCB4BCB5BCBCBCBDBCC0
|
| 407 |
+
BCC4BCCDBCCFBCD0BCD1BCD5BCD8BCDCBCF4BCF5BCF6BCF8BCFCBD04BD05BD07
|
| 408 |
+
BD09BD10BD14BD24BD2CBD40BD48BD49BD4CBD50BD58BD59BD64BD68BD80BD81
|
| 409 |
+
BD84BD87BD88BD89BD8ABD90BD91BD93BD95BD99BD9ABD9CBDA4BDB0BDB8BDD4
|
| 410 |
+
BDD5BDD8BDDCBDE9BDF0BDF4BDF8BE00BE03BE05BE0CBE0DBE10BE14BE1CBE1D
|
| 411 |
+
BE1FBE44BE45BE48BE4CBE4EBE54BE55BE57BE59BE5ABE5BBE60BE61BE640000
|
| 412 |
+
BB
|
| 413 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 414 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 415 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 416 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 417 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 418 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 419 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 420 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 421 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 422 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 423 |
+
0000BE68BE6ABE70BE71BE73BE74BE75BE7BBE7CBE7DBE80BE84BE8CBE8DBE8F
|
| 424 |
+
BE90BE91BE98BE99BEA8BED0BED1BED4BED7BED8BEE0BEE3BEE4BEE5BEECBF01
|
| 425 |
+
BF08BF09BF18BF19BF1BBF1CBF1DBF40BF41BF44BF48BF50BF51BF55BF94BFB0
|
| 426 |
+
BFC5BFCCBFCDBFD0BFD4BFDCBFDFBFE1C03CC051C058C05CC060C068C069C090
|
| 427 |
+
C091C094C098C0A0C0A1C0A3C0A5C0ACC0ADC0AFC0B0C0B3C0B4C0B5C0B6C0BC
|
| 428 |
+
C0BDC0BFC0C0C0C1C0C5C0C8C0C9C0CCC0D0C0D8C0D9C0DBC0DCC0DDC0E40000
|
| 429 |
+
BC
|
| 430 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 431 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 432 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 433 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 434 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 435 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 436 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 437 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 438 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 439 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 440 |
+
0000C0E5C0E8C0ECC0F4C0F5C0F7C0F9C100C104C108C110C115C11CC11DC11E
|
| 441 |
+
C11FC120C123C124C126C127C12CC12DC12FC130C131C136C138C139C13CC140
|
| 442 |
+
C148C149C14BC14CC14DC154C155C158C15CC164C165C167C168C169C170C174
|
| 443 |
+
C178C185C18CC18DC18EC190C194C196C19CC19DC19FC1A1C1A5C1A8C1A9C1AC
|
| 444 |
+
C1B0C1BDC1C4C1C8C1CCC1D4C1D7C1D8C1E0C1E4C1E8C1F0C1F1C1F3C1FCC1FD
|
| 445 |
+
C200C204C20CC20DC20FC211C218C219C21CC21FC220C228C229C22BC22D0000
|
| 446 |
+
BD
|
| 447 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 448 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 449 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 450 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 451 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 452 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 453 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 454 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 455 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 456 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 457 |
+
0000C22FC231C232C234C248C250C251C254C258C260C265C26CC26DC270C274
|
| 458 |
+
C27CC27DC27FC281C288C289C290C298C29BC29DC2A4C2A5C2A8C2ACC2ADC2B4
|
| 459 |
+
C2B5C2B7C2B9C2DCC2DDC2E0C2E3C2E4C2EBC2ECC2EDC2EFC2F1C2F6C2F8C2F9
|
| 460 |
+
C2FBC2FCC300C308C309C30CC30DC313C314C315C318C31CC324C325C328C329
|
| 461 |
+
C345C368C369C36CC370C372C378C379C37CC37DC384C388C38CC3C0C3D8C3D9
|
| 462 |
+
C3DCC3DFC3E0C3E2C3E8C3E9C3EDC3F4C3F5C3F8C408C410C424C42CC4300000
|
| 463 |
+
BE
|
| 464 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 465 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 466 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 467 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 468 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 469 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 470 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 471 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 472 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 473 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 474 |
+
0000C434C43CC43DC448C464C465C468C46CC474C475C479C480C494C49CC4B8
|
| 475 |
+
C4BCC4E9C4F0C4F1C4F4C4F8C4FAC4FFC500C501C50CC510C514C51CC528C529
|
| 476 |
+
C52CC530C538C539C53BC53DC544C545C548C549C54AC54CC54DC54EC553C554
|
| 477 |
+
C555C557C558C559C55DC55EC560C561C564C568C570C571C573C574C575C57C
|
| 478 |
+
C57DC580C584C587C58CC58DC58FC591C595C597C598C59CC5A0C5A9C5B4C5B5
|
| 479 |
+
C5B8C5B9C5BBC5BCC5BDC5BEC5C4C5C5C5C6C5C7C5C8C5C9C5CAC5CCC5CE0000
|
| 480 |
+
BF
|
| 481 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 482 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 483 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 484 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 485 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 486 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 487 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 488 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 489 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 490 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 491 |
+
0000C5D0C5D1C5D4C5D8C5E0C5E1C5E3C5E5C5ECC5EDC5EEC5F0C5F4C5F6C5F7
|
| 492 |
+
C5FCC5FDC5FEC5FFC600C601C605C606C607C608C60CC610C618C619C61BC61C
|
| 493 |
+
C624C625C628C62CC62DC62EC630C633C634C635C637C639C63BC640C641C644
|
| 494 |
+
C648C650C651C653C654C655C65CC65DC660C66CC66FC671C678C679C67CC680
|
| 495 |
+
C688C689C68BC68DC694C695C698C69CC6A4C6A5C6A7C6A9C6B0C6B1C6B4C6B8
|
| 496 |
+
C6B9C6BAC6C0C6C1C6C3C6C5C6CCC6CDC6D0C6D4C6DCC6DDC6E0C6E1C6E80000
|
| 497 |
+
C0
|
| 498 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 499 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 500 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 501 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 502 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 503 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 504 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 505 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 506 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 507 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 508 |
+
0000C6E9C6ECC6F0C6F8C6F9C6FDC704C705C708C70CC714C715C717C719C720
|
| 509 |
+
C721C724C728C730C731C733C735C737C73CC73DC740C744C74AC74CC74DC74F
|
| 510 |
+
C751C752C753C754C755C756C757C758C75CC760C768C76BC774C775C778C77C
|
| 511 |
+
C77DC77EC783C784C785C787C788C789C78AC78EC790C791C794C796C797C798
|
| 512 |
+
C79AC7A0C7A1C7A3C7A4C7A5C7A6C7ACC7ADC7B0C7B4C7BCC7BDC7BFC7C0C7C1
|
| 513 |
+
C7C8C7C9C7CCC7CEC7D0C7D8C7DDC7E4C7E8C7ECC800C801C804C808C80A0000
|
| 514 |
+
C1
|
| 515 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 516 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 517 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 518 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 519 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 520 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 521 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 522 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 523 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 524 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 525 |
+
0000C810C811C813C815C816C81CC81DC820C824C82CC82DC82FC831C838C83C
|
| 526 |
+
C840C848C849C84CC84DC854C870C871C874C878C87AC880C881C883C885C886
|
| 527 |
+
C887C88BC88CC88DC894C89DC89FC8A1C8A8C8BCC8BDC8C4C8C8C8CCC8D4C8D5
|
| 528 |
+
C8D7C8D9C8E0C8E1C8E4C8F5C8FCC8FDC900C904C905C906C90CC90DC90FC911
|
| 529 |
+
C918C92CC934C950C951C954C958C960C961C963C96CC970C974C97CC988C989
|
| 530 |
+
C98CC990C998C999C99BC99DC9C0C9C1C9C4C9C7C9C8C9CAC9D0C9D1C9D30000
|
| 531 |
+
C2
|
| 532 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 533 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 534 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 535 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 536 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 537 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 538 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 539 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 540 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 541 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 542 |
+
0000C9D5C9D6C9D9C9DAC9DCC9DDC9E0C9E2C9E4C9E7C9ECC9EDC9EFC9F0C9F1
|
| 543 |
+
C9F8C9F9C9FCCA00CA08CA09CA0BCA0CCA0DCA14CA18CA29CA4CCA4DCA50CA54
|
| 544 |
+
CA5CCA5DCA5FCA60CA61CA68CA7DCA84CA98CABCCABDCAC0CAC4CACCCACDCACF
|
| 545 |
+
CAD1CAD3CAD8CAD9CAE0CAECCAF4CB08CB10CB14CB18CB20CB21CB41CB48CB49
|
| 546 |
+
CB4CCB50CB58CB59CB5DCB64CB78CB79CB9CCBB8CBD4CBE4CBE7CBE9CC0CCC0D
|
| 547 |
+
CC10CC14CC1CCC1DCC21CC22CC27CC28CC29CC2CCC2ECC30CC38CC39CC3B0000
|
| 548 |
+
C3
|
| 549 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 550 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 551 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 552 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 553 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 554 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 555 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 556 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 557 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 558 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 559 |
+
0000CC3CCC3DCC3ECC44CC45CC48CC4CCC54CC55CC57CC58CC59CC60CC64CC66
|
| 560 |
+
CC68CC70CC75CC98CC99CC9CCCA0CCA8CCA9CCABCCACCCADCCB4CCB5CCB8CCBC
|
| 561 |
+
CCC4CCC5CCC7CCC9CCD0CCD4CCE4CCECCCF0CD01CD08CD09CD0CCD10CD18CD19
|
| 562 |
+
CD1BCD1DCD24CD28CD2CCD39CD5CCD60CD64CD6CCD6DCD6FCD71CD78CD88CD94
|
| 563 |
+
CD95CD98CD9CCDA4CDA5CDA7CDA9CDB0CDC4CDCCCDD0CDE8CDECCDF0CDF8CDF9
|
| 564 |
+
CDFBCDFDCE04CE08CE0CCE14CE19CE20CE21CE24CE28CE30CE31CE33CE350000
|
| 565 |
+
C4
|
| 566 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 567 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 568 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 569 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 570 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 571 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 572 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 573 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 574 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 575 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 576 |
+
0000CE58CE59CE5CCE5FCE60CE61CE68CE69CE6BCE6DCE74CE75CE78CE7CCE84
|
| 577 |
+
CE85CE87CE89CE90CE91CE94CE98CEA0CEA1CEA3CEA4CEA5CEACCEADCEC1CEE4
|
| 578 |
+
CEE5CEE8CEEBCEECCEF4CEF5CEF7CEF8CEF9CF00CF01CF04CF08CF10CF11CF13
|
| 579 |
+
CF15CF1CCF20CF24CF2CCF2DCF2FCF30CF31CF38CF54CF55CF58CF5CCF64CF65
|
| 580 |
+
CF67CF69CF70CF71CF74CF78CF80CF85CF8CCFA1CFA8CFB0CFC4CFE0CFE1CFE4
|
| 581 |
+
CFE8CFF0CFF1CFF3CFF5CFFCD000D004D011D018D02DD034D035D038D03C0000
|
| 582 |
+
C5
|
| 583 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 584 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 585 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 586 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 587 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 588 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 589 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 590 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 591 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 592 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 593 |
+
0000D044D045D047D049D050D054D058D060D06CD06DD070D074D07CD07DD081
|
| 594 |
+
D0A4D0A5D0A8D0ACD0B4D0B5D0B7D0B9D0C0D0C1D0C4D0C8D0C9D0D0D0D1D0D3
|
| 595 |
+
D0D4D0D5D0DCD0DDD0E0D0E4D0ECD0EDD0EFD0F0D0F1D0F8D10DD130D131D134
|
| 596 |
+
D138D13AD140D141D143D144D145D14CD14DD150D154D15CD15DD15FD161D168
|
| 597 |
+
D16CD17CD184D188D1A0D1A1D1A4D1A8D1B0D1B1D1B3D1B5D1BAD1BCD1C0D1D8
|
| 598 |
+
D1F4D1F8D207D209D210D22CD22DD230D234D23CD23DD23FD241D248D25C0000
|
| 599 |
+
C6
|
| 600 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 601 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 602 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 603 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 604 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 605 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 606 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 607 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 608 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 609 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 610 |
+
0000D264D280D281D284D288D290D291D295D29CD2A0D2A4D2ACD2B1D2B8D2B9
|
| 611 |
+
D2BCD2BFD2C0D2C2D2C8D2C9D2CBD2D4D2D8D2DCD2E4D2E5D2F0D2F1D2F4D2F8
|
| 612 |
+
D300D301D303D305D30CD30DD30ED310D314D316D31CD31DD31FD320D321D325
|
| 613 |
+
D328D329D32CD330D338D339D33BD33CD33DD344D345D37CD37DD380D384D38C
|
| 614 |
+
D38DD38FD390D391D398D399D39CD3A0D3A8D3A9D3ABD3ADD3B4D3B8D3BCD3C4
|
| 615 |
+
D3C5D3C8D3C9D3D0D3D8D3E1D3E3D3ECD3EDD3F0D3F4D3FCD3FDD3FFD4010000
|
| 616 |
+
C7
|
| 617 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 618 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 619 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 620 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 621 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 622 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 623 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 624 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 625 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 626 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 627 |
+
0000D408D41DD440D444D45CD460D464D46DD46FD478D479D47CD47FD480D482
|
| 628 |
+
D488D489D48BD48DD494D4A9D4CCD4D0D4D4D4DCD4DFD4E8D4ECD4F0D4F8D4FB
|
| 629 |
+
D4FDD504D508D50CD514D515D517D53CD53DD540D544D54CD54DD54FD551D558
|
| 630 |
+
D559D55CD560D565D568D569D56BD56DD574D575D578D57CD584D585D587D588
|
| 631 |
+
D589D590D5A5D5C8D5C9D5CCD5D0D5D2D5D8D5D9D5DBD5DDD5E4D5E5D5E8D5EC
|
| 632 |
+
D5F4D5F5D5F7D5F9D600D601D604D608D610D611D613D614D615D61CD6200000
|
| 633 |
+
C8
|
| 634 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 635 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 636 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 637 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 638 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 639 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 640 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 641 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 642 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 643 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 644 |
+
0000D624D62DD638D639D63CD640D645D648D649D64BD64DD651D654D655D658
|
| 645 |
+
D65CD667D669D670D671D674D683D685D68CD68DD690D694D69DD69FD6A1D6A8
|
| 646 |
+
D6ACD6B0D6B9D6BBD6C4D6C5D6C8D6CCD6D1D6D4D6D7D6D9D6E0D6E4D6E8D6F0
|
| 647 |
+
D6F5D6FCD6FDD700D704D711D718D719D71CD720D728D729D72BD72DD734D735
|
| 648 |
+
D738D73CD744D747D749D750D751D754D756D757D758D759D760D761D763D765
|
| 649 |
+
D769D76CD770D774D77CD77DD781D788D789D78CD790D798D799D79BD79D0000
|
| 650 |
+
CA
|
| 651 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 652 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 653 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 654 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 655 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 656 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 657 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 658 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 659 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 660 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 661 |
+
00004F3D4F73504750F952A053EF547554E556095AC15BB6668767B667B767EF
|
| 662 |
+
6B4C73C275C27A3C82DB8304885788888A368CC88DCF8EFB8FE699D5523B5374
|
| 663 |
+
5404606A61646BBC73CF811A89BA89D295A34F83520A58BE597859E65E725E79
|
| 664 |
+
61C763C0674667EC687F6F97764E770B78F57A087AFF7C21809D826E82718AEB
|
| 665 |
+
95934E6B559D66F76E3478A37AED845B8910874E97A852D8574E582A5D4C611F
|
| 666 |
+
61BE6221656267D16A446E1B751875B376E377B07D3A90AF945194529F950000
|
| 667 |
+
CB
|
| 668 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 669 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 670 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 671 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 672 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 673 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 674 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 675 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 676 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 677 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 678 |
+
000053235CAC753280DB92409598525B580859DC5CA15D175EB75F3A5F4A6177
|
| 679 |
+
6C5F757A75867CE07D737DB17F8C81548221859189418B1B92FC964D9C474ECB
|
| 680 |
+
4EF7500B51F1584F6137613E6168653969EA6F1175A5768676D67B8782A584CB
|
| 681 |
+
F90093A7958B55805BA25751F9017CB37FB991B5502853BB5C455DE862D2636E
|
| 682 |
+
64DA64E76E2070AC795B8DDD8E1EF902907D924592F84E7E4EF650655DFE5EFA
|
| 683 |
+
61066957817186548E4793759A2B4E5E5091677068405109528D52926AA20000
|
| 684 |
+
CC
|
| 685 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 686 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 687 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 688 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 689 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 690 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 691 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 692 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 693 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 694 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 695 |
+
000077BC92109ED452AB602F8FF2504861A963ED64CA683C6A846FC0818889A1
|
| 696 |
+
96945805727D72AC75047D797E6D80A9898B8B7490639D5162896C7A6F547D50
|
| 697 |
+
7F3A8A23517C614A7B9D8B199257938C4EAC4FD3501E50BE510652C152CD537F
|
| 698 |
+
577058835E9A5F91617661AC64CE656C666F66BB66F468976D87708570F1749F
|
| 699 |
+
74A574CA75D9786C78EC7ADF7AF67D457D938015803F811B83968B668F159015
|
| 700 |
+
93E1980398389A5A9BE84FC25553583A59515B635C4660B86212684268B00000
|
| 701 |
+
CD
|
| 702 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 703 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 704 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 705 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 706 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 707 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 708 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 709 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 710 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 711 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 712 |
+
000068E86EAA754C767878CE7A3D7CFB7E6B7E7C8A088AA18C3F968E9DC453E4
|
| 713 |
+
53E9544A547156FA59D15B645C3B5EAB62F765376545657266A067AF69C16CBD
|
| 714 |
+
75FC7690777E7A3F7F94800380A1818F82E682FD83F085C1883188B48AA5F903
|
| 715 |
+
8F9C932E96C798679AD89F1354ED659B66F2688F7A408C379D6056F057645D11
|
| 716 |
+
660668B168CD6EFE7428889E9BE46C68F9049AA84F9B516C5171529F5B545DE5
|
| 717 |
+
6050606D62F163A7653B73D97A7A86A38CA2978F4E325BE16208679C74DC0000
|
| 718 |
+
CE
|
| 719 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 720 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 721 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 722 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 723 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 724 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 725 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 726 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 727 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 728 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 729 |
+
000079D183D38A878AB28DE8904E934B98465ED369E885FF90EDF90551A05B98
|
| 730 |
+
5BEC616368FA6B3E704C742F74D87BA17F5083C589C08CAB95DC9928522E605D
|
| 731 |
+
62EC90024F8A5149532158D95EE366E06D38709A72C273D67B5080F1945B5366
|
| 732 |
+
639B7F6B4E565080584A58DE602A612762D069D09B415B8F7D1880B18F5F4EA4
|
| 733 |
+
50D154AC55AC5B0C5DA05DE7652A654E68216A4B72E1768E77EF7D5E7FF981A0
|
| 734 |
+
854E86DF8F038F4E90CA99039A559BAB4E184E454E5D4EC74FF1517752FE0000
|
| 735 |
+
CF
|
| 736 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 737 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 738 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 739 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 740 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 741 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 742 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 743 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 744 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 745 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 746 |
+
0000534053E353E5548E5614577557A25BC75D875ED061FC62D8655167B867E9
|
| 747 |
+
69CB6B506BC66BEC6C426E9D707872D77396740377BF77E97A767D7F800981FC
|
| 748 |
+
8205820A82DF88628B338CFC8EC0901190B1926492B699D29A459CE99DD79F9C
|
| 749 |
+
570B5C4083CA97A097AB9EB4541B7A987FA488D98ECD90E158005C4863987A9F
|
| 750 |
+
5BAE5F137A797AAE828E8EAC5026523852F85377570862F363726B0A6DC37737
|
| 751 |
+
53A5735785688E7695D5673A6AC36F708A6D8ECC994BF90666776B788CB40000
|
| 752 |
+
D0
|
| 753 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 754 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 755 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 756 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 757 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 758 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 759 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 760 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 761 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 762 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 763 |
+
00009B3CF90753EB572D594E63C669FB73EA78457ABA7AC57CFE8475898F8D73
|
| 764 |
+
903595A852FB574775477B6083CC921EF9086A58514B524B5287621F68D86975
|
| 765 |
+
969950C552A452E461C365A4683969FF747E7B4B82B983EB89B28B398FD19949
|
| 766 |
+
F9094ECA599764D266116A8E7434798179BD82A9887E887F895FF90A93264F0B
|
| 767 |
+
53CA602562716C727D1A7D664E98516277DC80AF4F014F0E5176518055DC5668
|
| 768 |
+
573B57FA57FC5914594759935BC45C905D0E5DF15E7E5FCC628065D765E30000
|
| 769 |
+
D1
|
| 770 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 771 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 772 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 773 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 774 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 775 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 776 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 777 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 778 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 779 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 780 |
+
0000671E671F675E68CB68C46A5F6B3A6C236C7D6C826DC773987426742A7482
|
| 781 |
+
74A37578757F788178EF794179477948797A7B957D007DBA7F888006802D808C
|
| 782 |
+
8A188B4F8C488D779321932498E299519A0E9A0F9A659E927DCA4F76540962EE
|
| 783 |
+
685491D155AB513AF90BF90C5A1C61E6F90D62CF62FFF90EF90FF910F911F912
|
| 784 |
+
F91390A3F914F915F916F917F9188AFEF919F91AF91BF91C6696F91D7156F91E
|
| 785 |
+
F91F96E3F920634F637A5357F921678F69606E73F9227537F923F924F9250000
|
| 786 |
+
D2
|
| 787 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 788 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 789 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 790 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 791 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 792 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 793 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 794 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 795 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 796 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 797 |
+
00007D0DF926F927887256CA5A18F928F929F92AF92BF92C4E43F92D51675948
|
| 798 |
+
67F08010F92E59735E74649A79CA5FF5606C62C8637B5BE75BD752AAF92F5974
|
| 799 |
+
5F296012F930F931F9327459F933F934F935F936F937F93899D1F939F93AF93B
|
| 800 |
+
F93CF93DF93EF93FF940F941F942F9436FC3F944F94581BF8FB260F1F946F947
|
| 801 |
+
8166F948F9495C3FF94AF94BF94CF94DF94EF94FF950F9515AE98A25677B7D10
|
| 802 |
+
F952F953F954F955F956F95780FDF958F9595C3C6CE5533F6EBA591A83360000
|
| 803 |
+
D3
|
| 804 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 805 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 806 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 807 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 808 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 809 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 810 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 811 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 812 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 813 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 814 |
+
00004E394EB64F4655AE571858C75F5665B765E66A806BB56E4D77ED7AEF7C1E
|
| 815 |
+
7DDE86CB88929132935B64BB6FBE737A75B890545556574D61BA64D466C76DE1
|
| 816 |
+
6E5B6F6D6FB975F0804381BD854189838AC78B5A931F6C9375537B548E0F905D
|
| 817 |
+
5510580258585E626207649E68E075767CD687B39EE84EE35788576E59275C0D
|
| 818 |
+
5CB15E365F85623464E173B381FA888B8CB8968A9EDB5B855FB760B350125200
|
| 819 |
+
52305716583558575C0E5C605CF65D8B5EA65F9260BC63116389641768430000
|
| 820 |
+
D4
|
| 821 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 822 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 823 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 824 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 825 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 826 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 827 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 828 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 829 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 830 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 831 |
+
000068F96AC26DD86E216ED46FE471FE76DC777979B17A3B840489A98CED8DF3
|
| 832 |
+
8E4890039014905390FD934D967697DC6BD27006725872A27368776379BF7BE4
|
| 833 |
+
7E9B8B8058A960C7656665FD66BE6C8C711E71C98C5A98134E6D7A814EDD51AC
|
| 834 |
+
51CD52D5540C61A76771685068DF6D1E6F7C75BC77B37AE580F484639285515C
|
| 835 |
+
6597675C679375D87AC78373F95A8C469017982D5C6F81C0829A9041906F920D
|
| 836 |
+
5F975D9D6A5971C8767B7B4985E48B0491279A30558761F6F95B76697F850000
|
| 837 |
+
D5
|
| 838 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 839 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 840 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 841 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 842 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 843 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 844 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 845 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 846 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 847 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 848 |
+
0000863F87BA88F8908FF95C6D1B70D973DE7D61843DF95D916A99F1F95E4E82
|
| 849 |
+
53756B046B12703E721B862D9E1E524C8FA35D5064E5652C6B166FEB7C437E9C
|
| 850 |
+
85CD896489BD62C981D8881F5ECA67176D6A72FC7405746F878290DE4F865D0D
|
| 851 |
+
5FA0840A51B763A075654EAE5006516951C968816A117CAE7CB17CE7826F8AD2
|
| 852 |
+
8F1B91CF4FB6513752F554425EEC616E623E65C56ADA6FFE792A85DC882395AD
|
| 853 |
+
9A629A6A9E979ECE529B66C66B77701D792B8F6297426190620065236F230000
|
| 854 |
+
D6
|
| 855 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 856 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 857 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 858 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 859 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 860 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 861 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 862 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 863 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 864 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 865 |
+
0000714974897DF4806F84EE8F269023934A51BD521752A36D0C70C888C25EC9
|
| 866 |
+
65826BAE6FC27C3E73754EE44F3656F9F95F5CBA5DBA601C73B27B2D7F9A7FCE
|
| 867 |
+
8046901E923496F6974898189F614F8B6FA779AE91B496B752DEF960648864C4
|
| 868 |
+
6AD36F5E7018721076E780018606865C8DEF8F0597329B6F9DFA9E75788C797F
|
| 869 |
+
7DA083C993049E7F9E938AD658DF5F046727702774CF7C60807E512170287262
|
| 870 |
+
78CA8CC28CDA8CF496F74E8650DA5BEE5ED6659971CE764277AD804A84FC0000
|
| 871 |
+
D7
|
| 872 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 873 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 874 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 875 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 876 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 877 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 878 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 879 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 880 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 881 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 882 |
+
0000907C9B279F8D58D85A415C626A136DDA6F0F763B7D2F7E37851E893893E4
|
| 883 |
+
964B528965D267F369B46D416E9C700F7409746075597624786B8B2C985E516D
|
| 884 |
+
622E96784F96502B5D196DEA7DB88F2A5F8B61446817F961968652D2808B51DC
|
| 885 |
+
51CC695E7A1C7DBE83F196754FDA52295398540F550E5C6560A7674E68A86D6C
|
| 886 |
+
728172F874067483F96275E27C6C7F797FB8838988CF88E191CC91D096E29BC9
|
| 887 |
+
541D6F7E71D0749885FA8EAA96A39C579E9F67976DCB743381E89716782C0000
|
| 888 |
+
D8
|
| 889 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 890 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 891 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 892 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 893 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 894 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 895 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 896 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 897 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 898 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 899 |
+
00007ACB7B207C926469746A75F278BC78E899AC9B549EBB5BDE5E556F20819C
|
| 900 |
+
83AB90884E07534D5A295DD25F4E6162633D666966FC6EFF6F2B7063779E842C
|
| 901 |
+
8513883B8F1399459C3B551C62B9672B6CAB8309896A977A4EA159845FD85FD9
|
| 902 |
+
671B7DB27F548292832B83BD8F1E909957CB59B95A925BD06627679A68856BCF
|
| 903 |
+
71647F758CB78CE390819B4581088C8A964C9A409EA55B5F6C13731B76F276DF
|
| 904 |
+
840C51AA8993514D519552C968C96C94770477207DBF7DEC97629EB56EC50000
|
| 905 |
+
D9
|
| 906 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 907 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 908 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 909 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 910 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 911 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 912 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 913 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 914 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 915 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 916 |
+
0000851151A5540D547D660E669D69276E9F76BF7791831784C2879F91699298
|
| 917 |
+
9CF488824FAE519252DF59C65E3D61556478647966AE67D06A216BCD6BDB725F
|
| 918 |
+
72617441773877DB801782BC83058B008B288C8C67286C90726776EE77667A46
|
| 919 |
+
9DA96B7F6C92592267268499536F589359995EDF63CF663467736E3A732B7AD7
|
| 920 |
+
82D7932852D95DEB61AE61CB620A62C764AB65E069596B666BCB712173F7755D
|
| 921 |
+
7E46821E8302856A8AA38CBF97279D6158A89ED85011520E543B554F65870000
|
| 922 |
+
DA
|
| 923 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 924 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 925 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 926 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 927 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 928 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 929 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 930 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 931 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 932 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 933 |
+
00006C767D0A7D0B805E868A958096EF52FF6C95726954735A9A5C3E5D4B5F4C
|
| 934 |
+
5FAE672A68B669636E3C6E4477097C737F8E85878B0E8FF797619EF45CB760B6
|
| 935 |
+
610D61AB654F65FB65FC6C116CEF739F73C97DE195945BC6871C8B10525D535A
|
| 936 |
+
62CD640F64B267346A386CCA73C0749E7B947C957E1B818A823685848FEB96F9
|
| 937 |
+
99C14F34534A53CD53DB62CC642C6500659169C36CEE6F5873ED7554762276E4
|
| 938 |
+
76FC78D078FB792C7D46822C87E08FD4981298EF52C362D464A56E246F510000
|
| 939 |
+
DB
|
| 940 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 941 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 942 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 943 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 944 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 945 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 946 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 947 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 948 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 949 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 950 |
+
0000767C8DCB91B192629AEE9B435023508D574A59A85C285E475F77623F653E
|
| 951 |
+
65B965C16609678B699C6EC278C57D2180AA8180822B82B384A1868C8A2A8B17
|
| 952 |
+
90A696329F90500D4FF3F96357F95F9862DC6392676F6E43711976C380CC80DA
|
| 953 |
+
88F488F589198CE08F29914D966A4F2F4F705E1B67CF6822767D767E9B445E61
|
| 954 |
+
6A0A716971D4756AF9647E41854385E998DC4F107B4F7F7095A551E15E0668B5
|
| 955 |
+
6C3E6C4E6CDB72AF7BC483036CD5743A50FB528858C164D86A9774A776560000
|
| 956 |
+
DC
|
| 957 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 958 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 959 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 960 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 961 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 962 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 963 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 964 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 965 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 966 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 967 |
+
000078A7861795E29739F965535E5F018B8A8FA88FAF908A522577A59C499F08
|
| 968 |
+
4E19500251755C5B5E77661E663A67C468C570B3750175C579C97ADD8F279920
|
| 969 |
+
9A084FDD582158315BF6666E6B656D116E7A6F7D73E4752B83E988DC89138B5C
|
| 970 |
+
8F144F0F50D55310535C5B935FA9670D798F8179832F8514890789868F398F3B
|
| 971 |
+
99A59C12672C4E764FF859495C015CEF5CF0636768D270FD71A2742B7E2B84EC
|
| 972 |
+
8702902292D29CF34E0D4ED84FEF50855256526F5426549057E0592B5A660000
|
| 973 |
+
DD
|
| 974 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 975 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 976 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 977 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 978 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 979 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 980 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 981 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 982 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 983 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 984 |
+
00005B5A5B755BCC5E9CF9666276657765A76D6E6EA572367B267C3F7F368150
|
| 985 |
+
8151819A8240829983A98A038CA08CE68CFB8D748DBA90E891DC961C964499D9
|
| 986 |
+
9CE7531752065429567458B35954596E5FFF61A4626E66106C7E711A76C67C89
|
| 987 |
+
7CDE7D1B82AC8CC196F0F9674F5B5F175F7F62C25D29670B68DA787C7E439D6C
|
| 988 |
+
4E1550995315532A535159835A625E8760B2618A624962796590678769A76BD4
|
| 989 |
+
6BD66BD76BD86CB8F968743575FA7812789179D579D87C837DCB7FE180A50000
|
| 990 |
+
DE
|
| 991 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 992 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 993 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 994 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 995 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 996 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 997 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 998 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 999 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1000 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1001 |
+
0000813E81C283F2871A88E88AB98B6C8CBB9119975E98DB9F3B56AC5B2A5F6C
|
| 1002 |
+
658C6AB36BAF6D5C6FF17015725D73AD8CA78CD3983B61916C3780589A014E4D
|
| 1003 |
+
4E8B4E9B4ED54F3A4F3C4F7F4FDF50FF53F253F8550655E356DB58EB59625A11
|
| 1004 |
+
5BEB5BFA5C045DF35E2B5F99601D6368659C65AF67F667FB68AD6B7B6C996CD7
|
| 1005 |
+
6E23700973457802793E7940796079C17BE97D177D728086820D838E84D186C7
|
| 1006 |
+
88DF8A508A5E8B1D8CDC8D668FAD90AA98FC99DF9E9D524AF9696714F96A0000
|
| 1007 |
+
DF
|
| 1008 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1009 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1010 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1011 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1012 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1013 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1014 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1015 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1016 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1017 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1018 |
+
00005098522A5C7165636C5573CA7523759D7B97849C917897304E7764926BBA
|
| 1019 |
+
715E85A94E09F96B674968EE6E17829F8518886B63F76F81921298AF4E0A50B7
|
| 1020 |
+
50CF511F554655AA56175B405C195CE05E385E8A5EA05EC260F368516A616E58
|
| 1021 |
+
723D724072C076F879657BB17FD488F389F48A738C618CDE971C585E74BD8CFD
|
| 1022 |
+
55C7F96C7A617D2282727272751F7525F96D7B19588558FB5DBC5E8F5EB65F90
|
| 1023 |
+
60556292637F654D669166D966F8681668F27280745E7B6E7D6E7DD67F720000
|
| 1024 |
+
E0
|
| 1025 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1026 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1027 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1028 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1029 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1030 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1031 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1032 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1033 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1034 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1035 |
+
000080E5821285AF897F8A93901D92E49ECD9F205915596D5E2D60DC66146673
|
| 1036 |
+
67906C506DC56F5F77F378A984C691CB932B4ED950CA514855845B0B5BA36247
|
| 1037 |
+
657E65CB6E32717D74017444748774BF766C79AA7DDA7E557FA8817A81B38239
|
| 1038 |
+
861A87EC8A758DE3907892919425994D9BAE53685C5169546CC46D296E2B820C
|
| 1039 |
+
859B893B8A2D8AAA96EA9F67526166B96BB27E9687FE8D0D9583965D651D6D89
|
| 1040 |
+
71EEF96E57CE59D35BAC602760FA6210661F665F732973F976DB77017B6C0000
|
| 1041 |
+
E1
|
| 1042 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1043 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1044 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1045 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1046 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1047 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1048 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1049 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1050 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1051 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1052 |
+
00008056807281658AA091924E1652E26B726D177A057B397D30F96F8CB053EC
|
| 1053 |
+
562F58515BB55C0F5C115DE2624063836414662D68B36CBC6D886EAF701F70A4
|
| 1054 |
+
71D27526758F758E76197B117BE07C2B7D207D39852C856D86078A34900D9061
|
| 1055 |
+
90B592B797F69A374FD75C6C675F6D917C9F7E8C8B168D16901F5B6B5DFD640D
|
| 1056 |
+
84C0905C98E173875B8B609A677E6DDE8A1F8AA69001980C5237F9707051788E
|
| 1057 |
+
9396887091D74FEE53D755FD56DA578258FD5AC25B885CAB5CC05E2561010000
|
| 1058 |
+
E2
|
| 1059 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1060 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1061 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1062 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1063 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1064 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1065 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1066 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1067 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1068 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1069 |
+
0000620D624B6388641C653665786A396B8A6C346D196F3171E772E973787407
|
| 1070 |
+
74B27626776179C07A577AEA7CB97D8F7DAC7E617F9E81298331849084DA85EA
|
| 1071 |
+
88968AB08B908F3890429083916C929692B9968B96A796A896D6970098089996
|
| 1072 |
+
9AD39B1A53D4587E59195B705BBF6DD16F5A719F742174B9808583FD5DE15F87
|
| 1073 |
+
5FAA604265EC6812696F6A536B896D356DF373E376FE77AC7B4D7D148123821C
|
| 1074 |
+
834084F485638A628AC49187931E980699B4620C88538FF092655D075D270000
|
| 1075 |
+
E3
|
| 1076 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1077 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1078 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1079 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1080 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1081 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1082 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1083 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1084 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1085 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1086 |
+
00005D69745F819D87686FD562FE7FD2893689724E1E4E5850E752DD5347627F
|
| 1087 |
+
66077E698805965E4F8D5319563659CB5AA45C385C4E5C4D5E025F11604365BD
|
| 1088 |
+
662F664267BE67F4731C77E2793A7FC5849484CD89968A668A698AE18C558C7A
|
| 1089 |
+
57F45BD45F0F606F62ED690D6B966E5C71847BD287558B588EFE98DF98FE4F38
|
| 1090 |
+
4F814FE1547B5A205BB8613C65B0666871FC7533795E7D33814E81E3839885AA
|
| 1091 |
+
85CE87038A0A8EAB8F9BF9718FC559315BA45BE660895BE95C0B5FC36C810000
|
| 1092 |
+
E4
|
| 1093 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1094 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1095 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1096 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1097 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1098 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1099 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1100 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1101 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1102 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1103 |
+
0000F9726DF1700B751A82AF8AF64EC05341F97396D96C0F4E9E4FC45152555E
|
| 1104 |
+
5A255CE86211725982BD83AA86FE88598A1D963F96C599139D099D5D580A5CB3
|
| 1105 |
+
5DBD5E4460E1611563E16A026E2591029354984E9C109F775B895CB86309664F
|
| 1106 |
+
6848773C96C1978D98549B9F65A18B018ECB95BC55355CA95DD65EB56697764C
|
| 1107 |
+
83F495C758D362BC72CE9D284EF0592E600F663B6B8379E79D26539354C057C3
|
| 1108 |
+
5D16611B66D66DAF788D827E969897445384627C63966DB27E0A814B984D0000
|
| 1109 |
+
E5
|
| 1110 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1111 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1112 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1113 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1114 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1115 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1116 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1117 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1118 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1119 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1120 |
+
00006AFB7F4C9DAF9E1A4E5F503B51B6591C60F963F66930723A8036F97491CE
|
| 1121 |
+
5F31F975F9767D0482E5846F84BB85E58E8DF9774F6FF978F97958E45B436059
|
| 1122 |
+
63DA6518656D6698F97A694A6A236D0B7001716C75D2760D79B37A70F97B7F8A
|
| 1123 |
+
F97C8944F97D8B9391C0967DF97E990A57045FA165BC6F01760079A68A9E99AD
|
| 1124 |
+
9B5A9F6C510461B662916A8D81C6504358305F6671098A008AFA5B7C86164FFA
|
| 1125 |
+
513C56B4594463A96DF95DAA696D51864E884F59F97FF980F9815982F9820000
|
| 1126 |
+
E6
|
| 1127 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1128 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1129 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1130 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1131 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1132 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1133 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1134 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1135 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1136 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1137 |
+
0000F9836B5F6C5DF98474B57916F9858207824583398F3F8F5DF9869918F987
|
| 1138 |
+
F988F9894EA6F98A57DF5F796613F98BF98C75AB7E798B6FF98D90069A5B56A5
|
| 1139 |
+
582759F85A1F5BB4F98E5EF6F98FF9906350633BF991693D6C876CBF6D8E6D93
|
| 1140 |
+
6DF56F14F99270DF71367159F99371C371D5F994784F786FF9957B757DE3F996
|
| 1141 |
+
7E2FF997884D8EDFF998F999F99A925BF99B9CF6F99CF99DF99E60856D85F99F
|
| 1142 |
+
71B1F9A0F9A195B153ADF9A2F9A3F9A467D3F9A5708E71307430827682D20000
|
| 1143 |
+
E7
|
| 1144 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1145 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1146 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1147 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1148 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1149 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1150 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1151 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1152 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1153 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1154 |
+
0000F9A695BB9AE59E7D66C4F9A771C18449F9A8F9A9584BF9AAF9AB5DB85F71
|
| 1155 |
+
F9AC6620668E697969AE6C386CF36E366F416FDA701B702F715071DF7370F9AD
|
| 1156 |
+
745BF9AE74D476C87A4E7E93F9AFF9B082F18A608FCEF9B19348F9B29719F9B3
|
| 1157 |
+
F9B44E42502AF9B5520853E166F36C6D6FCA730A777F7A6282AE85DD8602F9B6
|
| 1158 |
+
88D48A638B7D8C6BF9B792B3F9B8971398104E944F0D4FC950B25348543E5433
|
| 1159 |
+
55DA586258BA59675A1B5BE4609FF9B961CA655665FF666468A76C5A6FB30000
|
| 1160 |
+
E8
|
| 1161 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1162 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1163 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1164 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1165 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1166 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1167 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1168 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1169 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1170 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1171 |
+
000070CF71AC73527B7D87088AA49C329F075C4B6C8373447389923A6EAB7465
|
| 1172 |
+
761F7A697E15860A514058C564C174EE751576707FC1909596CD99546E2674E6
|
| 1173 |
+
7AA97AAA81E586D987788A1B5A495B8C5B9B68A169006D6373A97413742C7897
|
| 1174 |
+
7DE97FEB81188155839E8C4C962E981166F05F8065FA67896C6A738B502D5A03
|
| 1175 |
+
6B6A77EE59165D6C5DCD7325754FF9BAF9BB50E551F9582F592D599659DA5BE5
|
| 1176 |
+
F9BCF9BD5DA262D76416649364FEF9BE66DCF9BF6A48F9C071FF7464F9C10000
|
| 1177 |
+
E9
|
| 1178 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1179 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1180 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1181 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1182 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1183 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1184 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1185 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1186 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1187 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1188 |
+
00007A887AAF7E477E5E80008170F9C287EF89818B209059F9C390809952617E
|
| 1189 |
+
6B326D747E1F89258FB14FD150AD519752C757C758895BB95EB8614269956D8C
|
| 1190 |
+
6E676EB6719474627528752C8073833884C98E0A939493DEF9C44E8E4F515076
|
| 1191 |
+
512A53C853CB53F35B875BD35C24611A618265F4725B7397744076C279507991
|
| 1192 |
+
79B97D067FBD828B85D5865E8FC2904790F591EA968596E896E952D65F6765ED
|
| 1193 |
+
6631682F715C7A3690C1980A4E91F9C56A526B9E6F907189801882B885530000
|
| 1194 |
+
EA
|
| 1195 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1196 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1197 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1198 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1199 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1200 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1201 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1202 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1203 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1204 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1205 |
+
0000904B969596F297FB851A9B314E90718A96C45143539F54E15713571257A3
|
| 1206 |
+
5A9B5AC45BC36028613F63F46C856D396E726E907230733F745782D188818F45
|
| 1207 |
+
9060F9C6966298589D1B67088D8A925E4F4D504950DE5371570D59D45A015C09
|
| 1208 |
+
617066906E2D7232744B7DEF80C3840E8466853F875F885B89188B02905597CB
|
| 1209 |
+
9B4F4E734F915112516AF9C7552F55A95B7A5BA55E7C5E7D5EBE60A060DF6108
|
| 1210 |
+
610963C465386709F9C867D467DAF9C9696169626CB96D27F9CA6E38F9CB0000
|
| 1211 |
+
EB
|
| 1212 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1213 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1214 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1215 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1216 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1217 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1218 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1219 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1220 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1221 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1222 |
+
00006FE173367337F9CC745C7531F9CD7652F9CEF9CF7DAD81FE843888D58A98
|
| 1223 |
+
8ADB8AED8E308E42904A903E907A914991C9936EF9D0F9D15809F9D26BD38089
|
| 1224 |
+
80B2F9D3F9D45141596B5C39F9D5F9D66F6473A780E48D07F9D79217958FF9D8
|
| 1225 |
+
F9D9F9DAF9DB807F620E701C7D68878DF9DC57A0606961476BB78ABE928096B1
|
| 1226 |
+
4E59541F6DEB852D967097F398EE63D66CE3909151DD61C981BA9DF94F9D501A
|
| 1227 |
+
51005B9C610F61FF64EC69056BC5759177E37FA98264858F87FB88638ABC0000
|
| 1228 |
+
EC
|
| 1229 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1230 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1231 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1232 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1233 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1234 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1235 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1236 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1237 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1238 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1239 |
+
00008B7091AB4E8C4EE54F0AF9DDF9DE593759E8F9DF5DF25F1B5F5B6021F9E0
|
| 1240 |
+
F9E1F9E2F9E3723E73E5F9E4757075CDF9E579FBF9E6800C8033808482E18351
|
| 1241 |
+
F9E7F9E88CBD8CB39087F9E9F9EA98F4990CF9EBF9EC703776CA7FCA7FCC7FFC
|
| 1242 |
+
8B1A4EBA4EC152035370F9ED54BD56E059FB5BC55F155FCD6E6EF9EEF9EF7D6A
|
| 1243 |
+
8335F9F086938A8DF9F1976D9777F9F2F9F34E004F5A4F7E58F965E56EA29038
|
| 1244 |
+
93B099B94EFB58EC598A59D96041F9F4F9F57A14F9F6834F8CC3516553440000
|
| 1245 |
+
ED
|
| 1246 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1247 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1248 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1249 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1250 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1251 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1252 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1253 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1254 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1255 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1256 |
+
0000F9F7F9F8F9F94ECD52695B5582BF4ED4523A54A859C959FF5B505B575B5C
|
| 1257 |
+
606361486ECB7099716E738674F775B578C17D2B800581EA8328851785C98AEE
|
| 1258 |
+
8CC796CC4F5C52FA56BC65AB6628707C70B872357DBD828D914C96C09D725B71
|
| 1259 |
+
68E76B986F7A76DE5C9166AB6F5B7BB47C2A883696DC4E084ED75320583458BB
|
| 1260 |
+
58EF596C5C075E335E845F35638C66B267566A1F6AA36B0C6F3F7246F9FA7350
|
| 1261 |
+
748B7AE07CA7817881DF81E7838A846C8523859485CF88DD8D1391AC95770000
|
| 1262 |
+
EE
|
| 1263 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1264 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1265 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1266 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1267 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1268 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1269 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1270 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1271 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1272 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1273 |
+
0000969C518D54C957285BB0624D6750683D68936E3D6ED3707D7E2188C18CA1
|
| 1274 |
+
8F099F4B9F4E722D7B8F8ACD931A4F474F4E5132548059D05E9562B56775696E
|
| 1275 |
+
6A176CAE6E1A72D9732A75BD7BB87D3582E783F9845785F78A5B8CAF8E879019
|
| 1276 |
+
90B896CE9F5F52E3540A5AE15BC2645865756EF472C4F9FB76847A4D7B1B7C4D
|
| 1277 |
+
7E3E7FDF837B8B2B8CCA8D648DE18E5F8FEA8FF9906993D14F434F7A50B35168
|
| 1278 |
+
5178524D526A5861587C59605C085C555EDB609B623068136BBF6C086FB10000
|
| 1279 |
+
EF
|
| 1280 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1281 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1282 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1283 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1284 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1285 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1286 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1287 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1288 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1289 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1290 |
+
0000714E742075307538755176727B4C7B8B7BAD7BC67E8F8A6E8F3E8F49923F
|
| 1291 |
+
92939322942B96FB985A986B991E5207622A62986D5976647ACA7BC07D765360
|
| 1292 |
+
5CBE5E976F3870B97C9897119B8E9EDE63A5647A87764E014E954EAD505C5075
|
| 1293 |
+
544859C35B9A5E405EAD5EF75F8160C5633A653F657465CC6676667867FE6968
|
| 1294 |
+
6A896B636C406DC06DE86E1F6E5E701E70A1738E73FD753A775B7887798E7A0B
|
| 1295 |
+
7A7D7CBE7D8E82478A028AEA8C9E912D914A91D8926692CC9320970697560000
|
| 1296 |
+
F0
|
| 1297 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1298 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1299 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1300 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1301 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1302 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1303 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1304 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1305 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1306 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1307 |
+
0000975C98029F0E52365291557C58245E1D5F1F608C63D068AF6FDF796D7B2C
|
| 1308 |
+
81CD85BA88FD8AF88E44918D9664969B973D984C9F4A4FCE514651CB52A95632
|
| 1309 |
+
5F145F6B63AA64CD65E9664166FA66F9671D689D68D769FD6F156F6E716771E5
|
| 1310 |
+
722A74AA773A7956795A79DF7A207A957C977CDF7D447E70808785FB86A48A54
|
| 1311 |
+
8ABF8D998E819020906D91E3963B96D59CE565CF7C078DB393C35B585C0A5352
|
| 1312 |
+
62D9731D50275B975F9E60B0616B68D56DD9742E7A2E7D427D9C7E31816B0000
|
| 1313 |
+
F1
|
| 1314 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1315 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1316 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1317 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1318 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1319 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1320 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1321 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1322 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1323 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1324 |
+
00008E2A8E35937E94184F5057505DE65EA7632B7F6A4E3B4F4F4F8F505A59DD
|
| 1325 |
+
80C4546A546855FE594F5B995DDE5EDA665D673167F1682A6CE86D326E4A6F8D
|
| 1326 |
+
70B773E075877C4C7D027D2C7DA2821F86DB8A3B8A858D708E8A8F339031914E
|
| 1327 |
+
9152944499D07AF97CA54FCA510151C657C85BEF5CFB66596A3D6D5A6E966FEC
|
| 1328 |
+
710C756F7AE388229021907596CB99FF83014E2D4EF2884691CD537D6ADB696B
|
| 1329 |
+
6C41847A589E618E66FE62EF70DD751175C77E5284B88B498D084E4B53EA0000
|
| 1330 |
+
F2
|
| 1331 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1332 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1333 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1334 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1335 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1336 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1337 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1338 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1339 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1340 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1341 |
+
000054AB573057405FD763016307646F652F65E8667A679D67B36B626C606C9A
|
| 1342 |
+
6F2C77E57825794979577D1980A2810281F3829D82B787188A8CF9FC8D048DBE
|
| 1343 |
+
907276F47A197A377E548077550755D45875632F64226649664B686D699B6B84
|
| 1344 |
+
6D256EB173CD746874A1755B75B976E1771E778B79E67E097E1D81FB852F8897
|
| 1345 |
+
8A3A8CD18EEB8FB0903293AD9663967397074F8453F159EA5AC95E19684E74C6
|
| 1346 |
+
75BE79E97A9281A386ED8CEA8DCC8FED659F6715F9FD57F76F577DDD8F2F0000
|
| 1347 |
+
F3
|
| 1348 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1349 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1350 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1351 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1352 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1353 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1354 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1355 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1356 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1357 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1358 |
+
000093F696C65FB561F26F844E144F98501F53C955DF5D6F5DEE6B216B6478CB
|
| 1359 |
+
7B9AF9FE8E498ECA906E6349643E77407A84932F947F9F6A64B06FAF71E674A8
|
| 1360 |
+
74DA7AC47C127E827CB27E988B9A8D0A947D9910994C52395BDF64E6672D7D2E
|
| 1361 |
+
50ED53C358796158615961FA65AC7AD98B928B9650095021527555315A3C5EE0
|
| 1362 |
+
5F706134655E660C663666A269CD6EC46F32731676217A938139825983D684BC
|
| 1363 |
+
50B557F05BC05BE85F6963A178267DB583DC852191C791F5518A67F57B560000
|
| 1364 |
+
F4
|
| 1365 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1366 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1367 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1368 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1369 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1370 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1371 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1372 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1373 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1374 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1375 |
+
00008CAC51C459BB60BD8655501CF9FF52545C3A617D621A62D364F265A56ECC
|
| 1376 |
+
7620810A8E60965F96BB4EDF5343559859295DDD64C56CC96DFA73947A7F821B
|
| 1377 |
+
85A68CE48E10907791E795E1962197C651F854F255865FB964A46F887DB48F1F
|
| 1378 |
+
8F4D943550C95C166CBE6DFB751B77BB7C3D7C648A798AC2581E59BE5E166377
|
| 1379 |
+
7252758A776B8ADC8CBC8F125EF366746DF8807D83C18ACB97519BD6FA005243
|
| 1380 |
+
66FF6D956EEF7DE08AE6902E905E9AD4521D527F54E86194628462DB68A20000
|
| 1381 |
+
F5
|
| 1382 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1383 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1384 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1385 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1386 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1387 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1388 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1389 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1390 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1391 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1392 |
+
00006912695A6A3570927126785D7901790E79D27A0D8096827882D583498549
|
| 1393 |
+
8C828D859162918B91AE4FC356D171ED77D7870089F85BF85FD6675190A853E2
|
| 1394 |
+
585A5BF560A4618164607E3D80708525928364AE50AC5D146700589C62BD63A8
|
| 1395 |
+
690E69786A1E6E6B76BA79CB82BB84298ACF8DA88FFD9112914B919C93109318
|
| 1396 |
+
939A96DB9A369C0D4E11755C795D7AFA7B517BC97E2E84C48E598E748EF89010
|
| 1397 |
+
6625693F744351FA672E9EDC51455FE06C9687F2885D887760B481B584030000
|
| 1398 |
+
F6
|
| 1399 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1400 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1401 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1402 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1403 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1404 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1405 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1406 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1407 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1408 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1409 |
+
00008D0553D6543956345A365C31708A7FE0805A810681ED8DA391899A5F9DF2
|
| 1410 |
+
50744EC453A060FB6E2C5C644F88502455E45CD95E5F606568946CBB6DC471BE
|
| 1411 |
+
75D475F476617A1A7A497DC77DFB7F6E81F486A98F1C96C999B39F52524752C5
|
| 1412 |
+
98ED89AA4E0367D26F064FB55BE267956C886D78741B782791DD937C87C479E4
|
| 1413 |
+
7A315FEB4ED654A4553E58AE59A560F0625362D6673669558235964099B199DD
|
| 1414 |
+
502C53535544577CFA016258FA0264E2666B67DD6FC16FEF742274388A170000
|
| 1415 |
+
F7
|
| 1416 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1417 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1418 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1419 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1420 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1421 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1422 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1423 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1424 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1425 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1426 |
+
000094385451560657665F48619A6B4E705870AD7DBB8A95596A812B63A27708
|
| 1427 |
+
803D8CAA5854642D69BB5B955E116E6FFA038569514C53F0592A6020614B6B86
|
| 1428 |
+
6C706CF07B1E80CE82D48DC690B098B1FA0464C76FA464916504514E5410571F
|
| 1429 |
+
8A0E615F6876FA0575DB7B527D71901A580669CC817F892A9000983950785957
|
| 1430 |
+
59AC6295900F9B2A615D727995D657615A465DF4628A64AD64FA67776CE26D3E
|
| 1431 |
+
722C743678347F7782AD8DDB981752245742677F724874E38CA98FA692110000
|
| 1432 |
+
F8
|
| 1433 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1434 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1435 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1436 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1437 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1438 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1439 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1440 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1441 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1442 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1443 |
+
0000962A516B53ED634C4F695504609665576C9B6D7F724C72FD7A1789878C9D
|
| 1444 |
+
5F6D6F8E70F981A8610E4FBF504F624172477BC77DE87FE9904D97AD9A198CB6
|
| 1445 |
+
576A5E7367B0840D8A5554205B165E635EE25F0A658380BA853D9589965B4F48
|
| 1446 |
+
5305530D530F548654FA57035E036016629B62B16355FA066CE16D6675B17832
|
| 1447 |
+
80DE812F82DE846184B2888D8912900B92EA98FD9B915E4566B466DD70117206
|
| 1448 |
+
FA074FF5527D5F6A615367536A196F0274E2796888688C7998C798C49A430000
|
| 1449 |
+
F9
|
| 1450 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1451 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1452 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1453 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1454 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1455 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1456 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1457 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1458 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1459 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1460 |
+
000054C17A1F69538AF78C4A98A899AE5F7C62AB75B276AE88AB907F96425339
|
| 1461 |
+
5F3C5FC56CCC73CC7562758B7B4682FE999D4E4F903C4E0B4F5553A6590F5EC8
|
| 1462 |
+
66306CB37455837787668CC09050971E9C1558D15B7886508B149DB45BD26068
|
| 1463 |
+
608D65F16C576F226FA3701A7F557FF095919592965097D352728F4451FD542B
|
| 1464 |
+
54B85563558A6ABB6DB57DD88266929C96779E79540854C876D286E495A495D4
|
| 1465 |
+
965C4EA24F0959EE5AE65DF760526297676D68416C866E2F7F38809B822A0000
|
| 1466 |
+
FA
|
| 1467 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1468 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1469 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1470 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1471 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1472 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1473 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1474 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1475 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1476 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1477 |
+
0000FA08FA0998054EA5505554B35793595A5B695BB361C869776D77702387F9
|
| 1478 |
+
89E38A728AE7908299ED9AB852BE683850165E78674F8347884C4EAB541156AE
|
| 1479 |
+
73E6911597FF9909995799995653589F865B8A3161B26AF6737B8ED26B4796AA
|
| 1480 |
+
9A57595572008D6B97694FD45CF45F2661F8665B6CEB70AB738473B973FE7729
|
| 1481 |
+
774D7D437D627E2382378852FA0A8CE29249986F5B517A74884098015ACC4FE0
|
| 1482 |
+
5354593E5CFD633E6D7972F98105810783A292CF98304EA851445211578B0000
|
| 1483 |
+
FB
|
| 1484 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1485 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1486 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1487 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1488 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1489 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1490 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1491 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1492 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1493 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1494 |
+
00005F626CC26ECE7005705070AF719273E97469834A87A28861900890A293A3
|
| 1495 |
+
99A8516E5F5760E0616766B385598E4A91AF978B4E4E4E92547C58D558FA597D
|
| 1496 |
+
5CB55F2762366248660A66676BEB6D696DCF6E566EF86F946FE06FE9705D72D0
|
| 1497 |
+
7425745A74E07693795C7CCA7E1E80E182A6846B84BF864E865F87748B778C6A
|
| 1498 |
+
93AC9800986560D1621691775A5A660F6DF76E3E743F9B425FFD60DA7B0F54C4
|
| 1499 |
+
5F186C5E6CD36D2A70D87D0586798A0C9D3B5316548C5B056A3A706B75750000
|
| 1500 |
+
FC
|
| 1501 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1502 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1503 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1504 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1505 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1506 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1507 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1508 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1509 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1510 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1511 |
+
0000798D79BE82B183EF8A718B418CA89774FA0B64F4652B78BA78BB7A6B4E38
|
| 1512 |
+
559A59505BA65E7B60A363DB6B61666568536E19716574B07D0890849A699C25
|
| 1513 |
+
6D3B6ED1733E8C4195CA51F05E4C5FA8604D60F66130614C6643664469A56CC1
|
| 1514 |
+
6E5F6EC96F62714C749C76877BC17C27835287579051968D9EC3532F56DE5EFB
|
| 1515 |
+
5F8A6062609461F7666667036A9C6DEE6FAE7070736A7E6A81BE833486D48AA8
|
| 1516 |
+
8CC4528373725B966A6B940454EE56865B5D6548658566C9689F6D8D6DC60000
|
| 1517 |
+
FD
|
| 1518 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1519 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1520 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1521 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1522 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1523 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1524 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1525 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1526 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1527 |
+
0000000000000000000000000000000000000000000000000000000000000000
|
| 1528 |
+
0000723B80B491759A4D4FAF5019539A540E543C558955C55E3F5F8C673D7166
|
| 1529 |
+
73DD900552DB52F3586458CE7104718F71FB85B08A13668885A855A76684714A
|
| 1530 |
+
8431534955996BC15F595FBD63EE668971478AF18F1D9EBE4F11643A70CB7566
|
| 1531 |
+
866760648B4E9DF8514751F653086D3680F89ED166156B23709875D554035C79
|
| 1532 |
+
7D078A166B206B3D6B46543860706D3D7FD5820850D651DE559C566B56CD59EC
|
| 1533 |
+
5B095E0C619961986231665E66E6719971B971BA72A779A77A007FB28A700000
|
mplug_owl2/lib/tcl8.6/encoding/macCroatian.enc
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Encoding file: macCroatian, single-byte
|
| 2 |
+
S
|
| 3 |
+
003F 0 1
|
| 4 |
+
00
|
| 5 |
+
0000000100020003000400050006000700080009000A000B000C000D000E000F
|
| 6 |
+
0010001100120013001400150016001700180019001A001B001C001D001E001F
|
| 7 |
+
0020002100220023002400250026002700280029002A002B002C002D002E002F
|
| 8 |
+
0030003100320033003400350036003700380039003A003B003C003D003E003F
|
| 9 |
+
0040004100420043004400450046004700480049004A004B004C004D004E004F
|
| 10 |
+
0050005100520053005400550056005700580059005A005B005C005D005E005F
|
| 11 |
+
0060006100620063006400650066006700680069006A006B006C006D006E006F
|
| 12 |
+
0070007100720073007400750076007700780079007A007B007C007D007E007F
|
| 13 |
+
00C400C500C700C900D100D600DC00E100E000E200E400E300E500E700E900E8
|
| 14 |
+
00EA00EB00ED00EC00EE00EF00F100F300F200F400F600F500FA00F900FB00FC
|
| 15 |
+
202000B000A200A300A7202200B600DF00AE0160212200B400A82260017D00D8
|
| 16 |
+
221E00B122642265220600B522022211220F0161222B00AA00BA03A9017E00F8
|
| 17 |
+
00BF00A100AC221A01922248010600AB010C202600A000C000C300D501520153
|
| 18 |
+
01102014201C201D2018201900F725CAF8FF00A9204420AC2039203A00C600BB
|
| 19 |
+
201300B7201A201E203000C2010700C1010D00C800CD00CE00CF00CC00D300D4
|
| 20 |
+
011100D200DA00DB00D9013102C602DC00AF03C000CB02DA00B800CA00E602C7
|
mplug_owl2/lib/tcl8.6/http1.0/http.tcl
ADDED
|
@@ -0,0 +1,377 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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AD commands.
|
| 3 |
+
# These routines can be used in untrusted code that uses the Safesock
|
| 4 |
+
# security policy.
|
| 5 |
+
# These procedures use a callback interface to avoid using vwait,
|
| 6 |
+
# which is not defined in the safe base.
|
| 7 |
+
#
|
| 8 |
+
# See the http.n man page for documentation
|
| 9 |
+
|
| 10 |
+
package provide http 1.0
|
| 11 |
+
|
| 12 |
+
array set http {
|
| 13 |
+
-accept */*
|
| 14 |
+
-proxyhost {}
|
| 15 |
+
-proxyport {}
|
| 16 |
+
-useragent {Tcl http client package 1.0}
|
| 17 |
+
-proxyfilter httpProxyRequired
|
| 18 |
+
}
|
| 19 |
+
proc http_config {args} {
|
| 20 |
+
global http
|
| 21 |
+
set options [lsort [array names http -*]]
|
| 22 |
+
set usage [join $options ", "]
|
| 23 |
+
if {[llength $args] == 0} {
|
| 24 |
+
set result {}
|
| 25 |
+
foreach name $options {
|
| 26 |
+
lappend result $name $http($name)
|
| 27 |
+
}
|
| 28 |
+
return $result
|
| 29 |
+
}
|
| 30 |
+
regsub -all -- - $options {} options
|
| 31 |
+
set pat ^-([join $options |])$
|
| 32 |
+
if {[llength $args] == 1} {
|
| 33 |
+
set flag [lindex $args 0]
|
| 34 |
+
if {[regexp -- $pat $flag]} {
|
| 35 |
+
return $http($flag)
|
| 36 |
+
} else {
|
| 37 |
+
return -code error "Unknown option $flag, must be: $usage"
|
| 38 |
+
}
|
| 39 |
+
} else {
|
| 40 |
+
foreach {flag value} $args {
|
| 41 |
+
if {[regexp -- $pat $flag]} {
|
| 42 |
+
set http($flag) $value
|
| 43 |
+
} else {
|
| 44 |
+
return -code error "Unknown option $flag, must be: $usage"
|
| 45 |
+
}
|
| 46 |
+
}
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
proc httpFinish { token {errormsg ""} } {
|
| 51 |
+
upvar #0 $token state
|
| 52 |
+
global errorInfo errorCode
|
| 53 |
+
if {[string length $errormsg] != 0} {
|
| 54 |
+
set state(error) [list $errormsg $errorInfo $errorCode]
|
| 55 |
+
set state(status) error
|
| 56 |
+
}
|
| 57 |
+
catch {close $state(sock)}
|
| 58 |
+
catch {after cancel $state(after)}
|
| 59 |
+
if {[info exists state(-command)]} {
|
| 60 |
+
if {[catch {eval $state(-command) {$token}} err]} {
|
| 61 |
+
if {[string length $errormsg] == 0} {
|
| 62 |
+
set state(error) [list $err $errorInfo $errorCode]
|
| 63 |
+
set state(status) error
|
| 64 |
+
}
|
| 65 |
+
}
|
| 66 |
+
unset state(-command)
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
proc http_reset { token {why reset} } {
|
| 70 |
+
upvar #0 $token state
|
| 71 |
+
set state(status) $why
|
| 72 |
+
catch {fileevent $state(sock) readable {}}
|
| 73 |
+
httpFinish $token
|
| 74 |
+
if {[info exists state(error)]} {
|
| 75 |
+
set errorlist $state(error)
|
| 76 |
+
unset state(error)
|
| 77 |
+
eval error $errorlist
|
| 78 |
+
}
|
| 79 |
+
}
|
| 80 |
+
proc http_get { url args } {
|
| 81 |
+
global http
|
| 82 |
+
if {![info exists http(uid)]} {
|
| 83 |
+
set http(uid) 0
|
| 84 |
+
}
|
| 85 |
+
set token http#[incr http(uid)]
|
| 86 |
+
upvar #0 $token state
|
| 87 |
+
http_reset $token
|
| 88 |
+
array set state {
|
| 89 |
+
-blocksize 8192
|
| 90 |
+
-validate 0
|
| 91 |
+
-headers {}
|
| 92 |
+
-timeout 0
|
| 93 |
+
state header
|
| 94 |
+
meta {}
|
| 95 |
+
currentsize 0
|
| 96 |
+
totalsize 0
|
| 97 |
+
type text/html
|
| 98 |
+
body {}
|
| 99 |
+
status ""
|
| 100 |
+
}
|
| 101 |
+
set options {-blocksize -channel -command -handler -headers \
|
| 102 |
+
-progress -query -validate -timeout}
|
| 103 |
+
set usage [join $options ", "]
|
| 104 |
+
regsub -all -- - $options {} options
|
| 105 |
+
set pat ^-([join $options |])$
|
| 106 |
+
foreach {flag value} $args {
|
| 107 |
+
if {[regexp $pat $flag]} {
|
| 108 |
+
# Validate numbers
|
| 109 |
+
if {[info exists state($flag)] && \
|
| 110 |
+
[regexp {^[0-9]+$} $state($flag)] && \
|
| 111 |
+
![regexp {^[0-9]+$} $value]} {
|
| 112 |
+
return -code error "Bad value for $flag ($value), must be integer"
|
| 113 |
+
}
|
| 114 |
+
set state($flag) $value
|
| 115 |
+
} else {
|
| 116 |
+
return -code error "Unknown option $flag, can be: $usage"
|
| 117 |
+
}
|
| 118 |
+
}
|
| 119 |
+
if {! [regexp -nocase {^(http://)?([^/:]+)(:([0-9]+))?(/.*)?$} $url \
|
| 120 |
+
x proto host y port srvurl]} {
|
| 121 |
+
error "Unsupported URL: $url"
|
| 122 |
+
}
|
| 123 |
+
if {[string length $port] == 0} {
|
| 124 |
+
set port 80
|
| 125 |
+
}
|
| 126 |
+
if {[string length $srvurl] == 0} {
|
| 127 |
+
set srvurl /
|
| 128 |
+
}
|
| 129 |
+
if {[string length $proto] == 0} {
|
| 130 |
+
set url http://$url
|
| 131 |
+
}
|
| 132 |
+
set state(url) $url
|
| 133 |
+
if {![catch {$http(-proxyfilter) $host} proxy]} {
|
| 134 |
+
set phost [lindex $proxy 0]
|
| 135 |
+
set pport [lindex $proxy 1]
|
| 136 |
+
}
|
| 137 |
+
if {$state(-timeout) > 0} {
|
| 138 |
+
set state(after) [after $state(-timeout) [list http_reset $token timeout]]
|
| 139 |
+
}
|
| 140 |
+
if {[info exists phost] && [string length $phost]} {
|
| 141 |
+
set srvurl $url
|
| 142 |
+
set s [socket $phost $pport]
|
| 143 |
+
} else {
|
| 144 |
+
set s [socket $host $port]
|
| 145 |
+
}
|
| 146 |
+
set state(sock) $s
|
| 147 |
+
|
| 148 |
+
# Send data in cr-lf format, but accept any line terminators
|
| 149 |
+
|
| 150 |
+
fconfigure $s -translation {auto crlf} -buffersize $state(-blocksize)
|
| 151 |
+
|
| 152 |
+
# The following is disallowed in safe interpreters, but the socket
|
| 153 |
+
# is already in non-blocking mode in that case.
|
| 154 |
+
|
| 155 |
+
catch {fconfigure $s -blocking off}
|
| 156 |
+
set len 0
|
| 157 |
+
set how GET
|
| 158 |
+
if {[info exists state(-query)]} {
|
| 159 |
+
set len [string length $state(-query)]
|
| 160 |
+
if {$len > 0} {
|
| 161 |
+
set how POST
|
| 162 |
+
}
|
| 163 |
+
} elseif {$state(-validate)} {
|
| 164 |
+
set how HEAD
|
| 165 |
+
}
|
| 166 |
+
puts $s "$how $srvurl HTTP/1.0"
|
| 167 |
+
puts $s "Accept: $http(-accept)"
|
| 168 |
+
puts $s "Host: $host"
|
| 169 |
+
puts $s "User-Agent: $http(-useragent)"
|
| 170 |
+
foreach {key value} $state(-headers) {
|
| 171 |
+
regsub -all \[\n\r\] $value {} value
|
| 172 |
+
set key [string trim $key]
|
| 173 |
+
if {[string length $key]} {
|
| 174 |
+
puts $s "$key: $value"
|
| 175 |
+
}
|
| 176 |
+
}
|
| 177 |
+
if {$len > 0} {
|
| 178 |
+
puts $s "Content-Length: $len"
|
| 179 |
+
puts $s "Content-Type: application/x-www-form-urlencoded"
|
| 180 |
+
puts $s ""
|
| 181 |
+
fconfigure $s -translation {auto binary}
|
| 182 |
+
puts -nonewline $s $state(-query)
|
| 183 |
+
} else {
|
| 184 |
+
puts $s ""
|
| 185 |
+
}
|
| 186 |
+
flush $s
|
| 187 |
+
fileevent $s readable [list httpEvent $token]
|
| 188 |
+
if {! [info exists state(-command)]} {
|
| 189 |
+
http_wait $token
|
| 190 |
+
}
|
| 191 |
+
return $token
|
| 192 |
+
}
|
| 193 |
+
proc http_data {token} {
|
| 194 |
+
upvar #0 $token state
|
| 195 |
+
return $state(body)
|
| 196 |
+
}
|
| 197 |
+
proc http_status {token} {
|
| 198 |
+
upvar #0 $token state
|
| 199 |
+
return $state(status)
|
| 200 |
+
}
|
| 201 |
+
proc http_code {token} {
|
| 202 |
+
upvar #0 $token state
|
| 203 |
+
return $state(http)
|
| 204 |
+
}
|
| 205 |
+
proc http_size {token} {
|
| 206 |
+
upvar #0 $token state
|
| 207 |
+
return $state(currentsize)
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
proc httpEvent {token} {
|
| 211 |
+
upvar #0 $token state
|
| 212 |
+
set s $state(sock)
|
| 213 |
+
|
| 214 |
+
if {[eof $s]} {
|
| 215 |
+
httpEof $token
|
| 216 |
+
return
|
| 217 |
+
}
|
| 218 |
+
if {$state(state) == "header"} {
|
| 219 |
+
set n [gets $s line]
|
| 220 |
+
if {$n == 0} {
|
| 221 |
+
set state(state) body
|
| 222 |
+
if {![regexp -nocase ^text $state(type)]} {
|
| 223 |
+
# Turn off conversions for non-text data
|
| 224 |
+
fconfigure $s -translation binary
|
| 225 |
+
if {[info exists state(-channel)]} {
|
| 226 |
+
fconfigure $state(-channel) -translation binary
|
| 227 |
+
}
|
| 228 |
+
}
|
| 229 |
+
if {[info exists state(-channel)] &&
|
| 230 |
+
![info exists state(-handler)]} {
|
| 231 |
+
# Initiate a sequence of background fcopies
|
| 232 |
+
fileevent $s readable {}
|
| 233 |
+
httpCopyStart $s $token
|
| 234 |
+
}
|
| 235 |
+
} elseif {$n > 0} {
|
| 236 |
+
if {[regexp -nocase {^content-type:(.+)$} $line x type]} {
|
| 237 |
+
set state(type) [string trim $type]
|
| 238 |
+
}
|
| 239 |
+
if {[regexp -nocase {^content-length:(.+)$} $line x length]} {
|
| 240 |
+
set state(totalsize) [string trim $length]
|
| 241 |
+
}
|
| 242 |
+
if {[regexp -nocase {^([^:]+):(.+)$} $line x key value]} {
|
| 243 |
+
lappend state(meta) $key $value
|
| 244 |
+
} elseif {[regexp ^HTTP $line]} {
|
| 245 |
+
set state(http) $line
|
| 246 |
+
}
|
| 247 |
+
}
|
| 248 |
+
} else {
|
| 249 |
+
if {[catch {
|
| 250 |
+
if {[info exists state(-handler)]} {
|
| 251 |
+
set n [eval $state(-handler) {$s $token}]
|
| 252 |
+
} else {
|
| 253 |
+
set block [read $s $state(-blocksize)]
|
| 254 |
+
set n [string length $block]
|
| 255 |
+
if {$n >= 0} {
|
| 256 |
+
append state(body) $block
|
| 257 |
+
}
|
| 258 |
+
}
|
| 259 |
+
if {$n >= 0} {
|
| 260 |
+
incr state(currentsize) $n
|
| 261 |
+
}
|
| 262 |
+
} err]} {
|
| 263 |
+
httpFinish $token $err
|
| 264 |
+
} else {
|
| 265 |
+
if {[info exists state(-progress)]} {
|
| 266 |
+
eval $state(-progress) {$token $state(totalsize) $state(currentsize)}
|
| 267 |
+
}
|
| 268 |
+
}
|
| 269 |
+
}
|
| 270 |
+
}
|
| 271 |
+
proc httpCopyStart {s token} {
|
| 272 |
+
upvar #0 $token state
|
| 273 |
+
if {[catch {
|
| 274 |
+
fcopy $s $state(-channel) -size $state(-blocksize) -command \
|
| 275 |
+
[list httpCopyDone $token]
|
| 276 |
+
} err]} {
|
| 277 |
+
httpFinish $token $err
|
| 278 |
+
}
|
| 279 |
+
}
|
| 280 |
+
proc httpCopyDone {token count {error {}}} {
|
| 281 |
+
upvar #0 $token state
|
| 282 |
+
set s $state(sock)
|
| 283 |
+
incr state(currentsize) $count
|
| 284 |
+
if {[info exists state(-progress)]} {
|
| 285 |
+
eval $state(-progress) {$token $state(totalsize) $state(currentsize)}
|
| 286 |
+
}
|
| 287 |
+
if {([string length $error] != 0)} {
|
| 288 |
+
httpFinish $token $error
|
| 289 |
+
} elseif {[eof $s]} {
|
| 290 |
+
httpEof $token
|
| 291 |
+
} else {
|
| 292 |
+
httpCopyStart $s $token
|
| 293 |
+
}
|
| 294 |
+
}
|
| 295 |
+
proc httpEof {token} {
|
| 296 |
+
upvar #0 $token state
|
| 297 |
+
if {$state(state) == "header"} {
|
| 298 |
+
# Premature eof
|
| 299 |
+
set state(status) eof
|
| 300 |
+
} else {
|
| 301 |
+
set state(status) ok
|
| 302 |
+
}
|
| 303 |
+
set state(state) eof
|
| 304 |
+
httpFinish $token
|
| 305 |
+
}
|
| 306 |
+
proc http_wait {token} {
|
| 307 |
+
upvar #0 $token state
|
| 308 |
+
if {![info exists state(status)] || [string length $state(status)] == 0} {
|
| 309 |
+
vwait $token\(status)
|
| 310 |
+
}
|
| 311 |
+
if {[info exists state(error)]} {
|
| 312 |
+
set errorlist $state(error)
|
| 313 |
+
unset state(error)
|
| 314 |
+
eval error $errorlist
|
| 315 |
+
}
|
| 316 |
+
return $state(status)
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
# Call http_formatQuery with an even number of arguments, where the first is
|
| 320 |
+
# a name, the second is a value, the third is another name, and so on.
|
| 321 |
+
|
| 322 |
+
proc http_formatQuery {args} {
|
| 323 |
+
set result ""
|
| 324 |
+
set sep ""
|
| 325 |
+
foreach i $args {
|
| 326 |
+
append result $sep [httpMapReply $i]
|
| 327 |
+
if {$sep != "="} {
|
| 328 |
+
set sep =
|
| 329 |
+
} else {
|
| 330 |
+
set sep &
|
| 331 |
+
}
|
| 332 |
+
}
|
| 333 |
+
return $result
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
# do x-www-urlencoded character mapping
|
| 337 |
+
# The spec says: "non-alphanumeric characters are replaced by '%HH'"
|
| 338 |
+
# 1 leave alphanumerics characters alone
|
| 339 |
+
# 2 Convert every other character to an array lookup
|
| 340 |
+
# 3 Escape constructs that are "special" to the tcl parser
|
| 341 |
+
# 4 "subst" the result, doing all the array substitutions
|
| 342 |
+
|
| 343 |
+
proc httpMapReply {string} {
|
| 344 |
+
global httpFormMap
|
| 345 |
+
set alphanumeric a-zA-Z0-9
|
| 346 |
+
if {![info exists httpFormMap]} {
|
| 347 |
+
|
| 348 |
+
for {set i 1} {$i <= 256} {incr i} {
|
| 349 |
+
set c [format %c $i]
|
| 350 |
+
if {![string match \[$alphanumeric\] $c]} {
|
| 351 |
+
set httpFormMap($c) %[format %.2x $i]
|
| 352 |
+
}
|
| 353 |
+
}
|
| 354 |
+
# These are handled specially
|
| 355 |
+
array set httpFormMap {
|
| 356 |
+
" " + \n %0d%0a
|
| 357 |
+
}
|
| 358 |
+
}
|
| 359 |
+
regsub -all \[^$alphanumeric\] $string {$httpFormMap(&)} string
|
| 360 |
+
regsub -all \n $string {\\n} string
|
| 361 |
+
regsub -all \t $string {\\t} string
|
| 362 |
+
regsub -all {[][{})\\]\)} $string {\\&} string
|
| 363 |
+
return [subst $string]
|
| 364 |
+
}
|
| 365 |
+
|
| 366 |
+
# Default proxy filter.
|
| 367 |
+
proc httpProxyRequired {host} {
|
| 368 |
+
global http
|
| 369 |
+
if {[info exists http(-proxyhost)] && [string length $http(-proxyhost)]} {
|
| 370 |
+
if {![info exists http(-proxyport)] || ![string length $http(-proxyport)]} {
|
| 371 |
+
set http(-proxyport) 8080
|
| 372 |
+
}
|
| 373 |
+
return [list $http(-proxyhost) $http(-proxyport)]
|
| 374 |
+
} else {
|
| 375 |
+
return {}
|
| 376 |
+
}
|
| 377 |
+
}
|
mplug_owl2/lib/tcl8.6/http1.0/pkgIndex.tcl
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Tcl package index file, version 1.0
|
| 2 |
+
# This file is generated by the "pkg_mkIndex" command
|
| 3 |
+
# and sourced either when an application starts up or
|
| 4 |
+
# by a "package unknown" script. It invokes the
|
| 5 |
+
# "package ifneeded" command to set up package-related
|
| 6 |
+
# information so that packages will be loaded automatically
|
| 7 |
+
# in response to "package require" commands. When this
|
| 8 |
+
# script is sourced, the variable $dir must contain the
|
| 9 |
+
# full path name of this file's directory.
|
| 10 |
+
|
| 11 |
+
package ifneeded http 1.0 [list tclPkgSetup $dir http 1.0 {{http.tcl source {httpCopyDone httpCopyStart httpEof httpEvent httpFinish httpMapReply httpProxyRequired http_code http_config http_data http_formatQuery http_get http_reset http_size http_status http_wait}}}]
|
mplug_owl2/lib/tcl8.6/package.tcl
ADDED
|
@@ -0,0 +1,751 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# package.tcl --
|
| 2 |
+
#
|
| 3 |
+
# utility procs formerly in init.tcl which can be loaded on demand
|
| 4 |
+
# for package management.
|
| 5 |
+
#
|
| 6 |
+
# Copyright (c) 1991-1993 The Regents of the University of California.
|
| 7 |
+
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
|
| 8 |
+
#
|
| 9 |
+
# See the file "license.terms" for information on usage and redistribution
|
| 10 |
+
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 11 |
+
#
|
| 12 |
+
|
| 13 |
+
namespace eval tcl::Pkg {}
|
| 14 |
+
|
| 15 |
+
# ::tcl::Pkg::CompareExtension --
|
| 16 |
+
#
|
| 17 |
+
# Used internally by pkg_mkIndex to compare the extension of a file to a given
|
| 18 |
+
# extension. On Windows, it uses a case-insensitive comparison because the
|
| 19 |
+
# file system can be file insensitive.
|
| 20 |
+
#
|
| 21 |
+
# Arguments:
|
| 22 |
+
# fileName name of a file whose extension is compared
|
| 23 |
+
# ext (optional) The extension to compare against; you must
|
| 24 |
+
# provide the starting dot.
|
| 25 |
+
# Defaults to [info sharedlibextension]
|
| 26 |
+
#
|
| 27 |
+
# Results:
|
| 28 |
+
# Returns 1 if the extension matches, 0 otherwise
|
| 29 |
+
|
| 30 |
+
proc tcl::Pkg::CompareExtension {fileName {ext {}}} {
|
| 31 |
+
global tcl_platform
|
| 32 |
+
if {$ext eq ""} {set ext [info sharedlibextension]}
|
| 33 |
+
if {$tcl_platform(platform) eq "windows"} {
|
| 34 |
+
return [string equal -nocase [file extension $fileName] $ext]
|
| 35 |
+
} else {
|
| 36 |
+
# Some unices add trailing numbers after the .so, so
|
| 37 |
+
# we could have something like '.so.1.2'.
|
| 38 |
+
set root $fileName
|
| 39 |
+
while {1} {
|
| 40 |
+
set currExt [file extension $root]
|
| 41 |
+
if {$currExt eq $ext} {
|
| 42 |
+
return 1
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
# The current extension does not match; if it is not a numeric
|
| 46 |
+
# value, quit, as we are only looking to ignore version number
|
| 47 |
+
# extensions. Otherwise we might return 1 in this case:
|
| 48 |
+
# tcl::Pkg::CompareExtension foo.so.bar .so
|
| 49 |
+
# which should not match.
|
| 50 |
+
|
| 51 |
+
if {![string is integer -strict [string range $currExt 1 end]]} {
|
| 52 |
+
return 0
|
| 53 |
+
}
|
| 54 |
+
set root [file rootname $root]
|
| 55 |
+
}
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
# pkg_mkIndex --
|
| 60 |
+
# This procedure creates a package index in a given directory. The package
|
| 61 |
+
# index consists of a "pkgIndex.tcl" file whose contents are a Tcl script that
|
| 62 |
+
# sets up package information with "package require" commands. The commands
|
| 63 |
+
# describe all of the packages defined by the files given as arguments.
|
| 64 |
+
#
|
| 65 |
+
# Arguments:
|
| 66 |
+
# -direct (optional) If this flag is present, the generated
|
| 67 |
+
# code in pkgMkIndex.tcl will cause the package to be
|
| 68 |
+
# loaded when "package require" is executed, rather
|
| 69 |
+
# than lazily when the first reference to an exported
|
| 70 |
+
# procedure in the package is made.
|
| 71 |
+
# -verbose (optional) Verbose output; the name of each file that
|
| 72 |
+
# was successfully processed is printed out. Additionally,
|
| 73 |
+
# if processing of a file failed a message is printed.
|
| 74 |
+
# -load pat (optional) Preload any packages whose names match
|
| 75 |
+
# the pattern. Used to handle DLLs that depend on
|
| 76 |
+
# other packages during their Init procedure.
|
| 77 |
+
# dir - Name of the directory in which to create the index.
|
| 78 |
+
# args - Any number of additional arguments, each giving
|
| 79 |
+
# a glob pattern that matches the names of one or
|
| 80 |
+
# more shared libraries or Tcl script files in
|
| 81 |
+
# dir.
|
| 82 |
+
|
| 83 |
+
proc pkg_mkIndex {args} {
|
| 84 |
+
set usage {"pkg_mkIndex ?-direct? ?-lazy? ?-load pattern? ?-verbose? ?--? dir ?pattern ...?"}
|
| 85 |
+
|
| 86 |
+
set argCount [llength $args]
|
| 87 |
+
if {$argCount < 1} {
|
| 88 |
+
return -code error "wrong # args: should be\n$usage"
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
set more ""
|
| 92 |
+
set direct 1
|
| 93 |
+
set doVerbose 0
|
| 94 |
+
set loadPat ""
|
| 95 |
+
for {set idx 0} {$idx < $argCount} {incr idx} {
|
| 96 |
+
set flag [lindex $args $idx]
|
| 97 |
+
switch -glob -- $flag {
|
| 98 |
+
-- {
|
| 99 |
+
# done with the flags
|
| 100 |
+
incr idx
|
| 101 |
+
break
|
| 102 |
+
}
|
| 103 |
+
-verbose {
|
| 104 |
+
set doVerbose 1
|
| 105 |
+
}
|
| 106 |
+
-lazy {
|
| 107 |
+
set direct 0
|
| 108 |
+
append more " -lazy"
|
| 109 |
+
}
|
| 110 |
+
-direct {
|
| 111 |
+
append more " -direct"
|
| 112 |
+
}
|
| 113 |
+
-load {
|
| 114 |
+
incr idx
|
| 115 |
+
set loadPat [lindex $args $idx]
|
| 116 |
+
append more " -load $loadPat"
|
| 117 |
+
}
|
| 118 |
+
-* {
|
| 119 |
+
return -code error "unknown flag $flag: should be\n$usage"
|
| 120 |
+
}
|
| 121 |
+
default {
|
| 122 |
+
# done with the flags
|
| 123 |
+
break
|
| 124 |
+
}
|
| 125 |
+
}
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
set dir [lindex $args $idx]
|
| 129 |
+
set patternList [lrange $args [expr {$idx + 1}] end]
|
| 130 |
+
if {![llength $patternList]} {
|
| 131 |
+
set patternList [list "*.tcl" "*[info sharedlibextension]"]
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
try {
|
| 135 |
+
set fileList [glob -directory $dir -tails -types {r f} -- \
|
| 136 |
+
{*}$patternList]
|
| 137 |
+
} on error {msg opt} {
|
| 138 |
+
return -options $opt $msg
|
| 139 |
+
}
|
| 140 |
+
foreach file $fileList {
|
| 141 |
+
# For each file, figure out what commands and packages it provides.
|
| 142 |
+
# To do this, create a child interpreter, load the file into the
|
| 143 |
+
# interpreter, and get a list of the new commands and packages that
|
| 144 |
+
# are defined.
|
| 145 |
+
|
| 146 |
+
if {$file eq "pkgIndex.tcl"} {
|
| 147 |
+
continue
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
set c [interp create]
|
| 151 |
+
|
| 152 |
+
# Load into the child any packages currently loaded in the parent
|
| 153 |
+
# interpreter that match the -load pattern.
|
| 154 |
+
|
| 155 |
+
if {$loadPat ne ""} {
|
| 156 |
+
if {$doVerbose} {
|
| 157 |
+
tclLog "currently loaded packages: '[info loaded]'"
|
| 158 |
+
tclLog "trying to load all packages matching $loadPat"
|
| 159 |
+
}
|
| 160 |
+
if {![llength [info loaded]]} {
|
| 161 |
+
tclLog "warning: no packages are currently loaded, nothing"
|
| 162 |
+
tclLog "can possibly match '$loadPat'"
|
| 163 |
+
}
|
| 164 |
+
}
|
| 165 |
+
foreach pkg [info loaded] {
|
| 166 |
+
if {![string match -nocase $loadPat [lindex $pkg 1]]} {
|
| 167 |
+
continue
|
| 168 |
+
}
|
| 169 |
+
if {$doVerbose} {
|
| 170 |
+
tclLog "package [lindex $pkg 1] matches '$loadPat'"
|
| 171 |
+
}
|
| 172 |
+
try {
|
| 173 |
+
load [lindex $pkg 0] [lindex $pkg 1] $c
|
| 174 |
+
} on error err {
|
| 175 |
+
if {$doVerbose} {
|
| 176 |
+
tclLog "warning: load [lindex $pkg 0]\
|
| 177 |
+
[lindex $pkg 1]\nfailed with: $err"
|
| 178 |
+
}
|
| 179 |
+
} on ok {} {
|
| 180 |
+
if {$doVerbose} {
|
| 181 |
+
tclLog "loaded [lindex $pkg 0] [lindex $pkg 1]"
|
| 182 |
+
}
|
| 183 |
+
}
|
| 184 |
+
if {[lindex $pkg 1] eq "Tk"} {
|
| 185 |
+
# Withdraw . if Tk was loaded, to avoid showing a window.
|
| 186 |
+
$c eval [list wm withdraw .]
|
| 187 |
+
}
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
$c eval {
|
| 191 |
+
# Stub out the package command so packages can require other
|
| 192 |
+
# packages.
|
| 193 |
+
|
| 194 |
+
rename package __package_orig
|
| 195 |
+
proc package {what args} {
|
| 196 |
+
switch -- $what {
|
| 197 |
+
require {
|
| 198 |
+
return; # Ignore transitive requires
|
| 199 |
+
}
|
| 200 |
+
default {
|
| 201 |
+
__package_orig $what {*}$args
|
| 202 |
+
}
|
| 203 |
+
}
|
| 204 |
+
}
|
| 205 |
+
proc tclPkgUnknown args {}
|
| 206 |
+
package unknown tclPkgUnknown
|
| 207 |
+
|
| 208 |
+
# Stub out the unknown command so package can call into each other
|
| 209 |
+
# during their initialization.
|
| 210 |
+
|
| 211 |
+
proc unknown {args} {}
|
| 212 |
+
|
| 213 |
+
# Stub out the auto_import mechanism
|
| 214 |
+
|
| 215 |
+
proc auto_import {args} {}
|
| 216 |
+
|
| 217 |
+
# reserve the ::tcl namespace for support procs and temporary
|
| 218 |
+
# variables. This might make it awkward to generate a
|
| 219 |
+
# pkgIndex.tcl file for the ::tcl namespace.
|
| 220 |
+
|
| 221 |
+
namespace eval ::tcl {
|
| 222 |
+
variable dir ;# Current directory being processed
|
| 223 |
+
variable file ;# Current file being processed
|
| 224 |
+
variable direct ;# -direct flag value
|
| 225 |
+
variable x ;# Loop variable
|
| 226 |
+
variable debug ;# For debugging
|
| 227 |
+
variable type ;# "load" or "source", for -direct
|
| 228 |
+
variable namespaces ;# Existing namespaces (e.g., ::tcl)
|
| 229 |
+
variable packages ;# Existing packages (e.g., Tcl)
|
| 230 |
+
variable origCmds ;# Existing commands
|
| 231 |
+
variable newCmds ;# Newly created commands
|
| 232 |
+
variable newPkgs {} ;# Newly created packages
|
| 233 |
+
}
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
$c eval [list set ::tcl::dir $dir]
|
| 237 |
+
$c eval [list set ::tcl::file $file]
|
| 238 |
+
$c eval [list set ::tcl::direct $direct]
|
| 239 |
+
|
| 240 |
+
# Download needed procedures into the child because we've just deleted
|
| 241 |
+
# the unknown procedure. This doesn't handle procedures with default
|
| 242 |
+
# arguments.
|
| 243 |
+
|
| 244 |
+
foreach p {::tcl::Pkg::CompareExtension} {
|
| 245 |
+
$c eval [list namespace eval [namespace qualifiers $p] {}]
|
| 246 |
+
$c eval [list proc $p [info args $p] [info body $p]]
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
try {
|
| 250 |
+
$c eval {
|
| 251 |
+
set ::tcl::debug "loading or sourcing"
|
| 252 |
+
|
| 253 |
+
# we need to track command defined by each package even in the
|
| 254 |
+
# -direct case, because they are needed internally by the
|
| 255 |
+
# "partial pkgIndex.tcl" step above.
|
| 256 |
+
|
| 257 |
+
proc ::tcl::GetAllNamespaces {{root ::}} {
|
| 258 |
+
set list $root
|
| 259 |
+
foreach ns [namespace children $root] {
|
| 260 |
+
lappend list {*}[::tcl::GetAllNamespaces $ns]
|
| 261 |
+
}
|
| 262 |
+
return $list
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
# init the list of existing namespaces, packages, commands
|
| 266 |
+
|
| 267 |
+
foreach ::tcl::x [::tcl::GetAllNamespaces] {
|
| 268 |
+
set ::tcl::namespaces($::tcl::x) 1
|
| 269 |
+
}
|
| 270 |
+
foreach ::tcl::x [package names] {
|
| 271 |
+
if {[package provide $::tcl::x] ne ""} {
|
| 272 |
+
set ::tcl::packages($::tcl::x) 1
|
| 273 |
+
}
|
| 274 |
+
}
|
| 275 |
+
set ::tcl::origCmds [info commands]
|
| 276 |
+
|
| 277 |
+
# Try to load the file if it has the shared library extension,
|
| 278 |
+
# otherwise source it. It's important not to try to load
|
| 279 |
+
# files that aren't shared libraries, because on some systems
|
| 280 |
+
# (like SunOS) the loader will abort the whole application
|
| 281 |
+
# when it gets an error.
|
| 282 |
+
|
| 283 |
+
if {[::tcl::Pkg::CompareExtension $::tcl::file [info sharedlibextension]]} {
|
| 284 |
+
# The "file join ." command below is necessary. Without
|
| 285 |
+
# it, if the file name has no \'s and we're on UNIX, the
|
| 286 |
+
# load command will invoke the LD_LIBRARY_PATH search
|
| 287 |
+
# mechanism, which could cause the wrong file to be used.
|
| 288 |
+
|
| 289 |
+
set ::tcl::debug loading
|
| 290 |
+
load [file join $::tcl::dir $::tcl::file]
|
| 291 |
+
set ::tcl::type load
|
| 292 |
+
} else {
|
| 293 |
+
set ::tcl::debug sourcing
|
| 294 |
+
source [file join $::tcl::dir $::tcl::file]
|
| 295 |
+
set ::tcl::type source
|
| 296 |
+
}
|
| 297 |
+
|
| 298 |
+
# As a performance optimization, if we are creating direct
|
| 299 |
+
# load packages, don't bother figuring out the set of commands
|
| 300 |
+
# created by the new packages. We only need that list for
|
| 301 |
+
# setting up the autoloading used in the non-direct case.
|
| 302 |
+
if {!$::tcl::direct} {
|
| 303 |
+
# See what new namespaces appeared, and import commands
|
| 304 |
+
# from them. Only exported commands go into the index.
|
| 305 |
+
|
| 306 |
+
foreach ::tcl::x [::tcl::GetAllNamespaces] {
|
| 307 |
+
if {![info exists ::tcl::namespaces($::tcl::x)]} {
|
| 308 |
+
namespace import -force ${::tcl::x}::*
|
| 309 |
+
}
|
| 310 |
+
|
| 311 |
+
# Figure out what commands appeared
|
| 312 |
+
|
| 313 |
+
foreach ::tcl::x [info commands] {
|
| 314 |
+
set ::tcl::newCmds($::tcl::x) 1
|
| 315 |
+
}
|
| 316 |
+
foreach ::tcl::x $::tcl::origCmds {
|
| 317 |
+
unset -nocomplain ::tcl::newCmds($::tcl::x)
|
| 318 |
+
}
|
| 319 |
+
foreach ::tcl::x [array names ::tcl::newCmds] {
|
| 320 |
+
# determine which namespace a command comes from
|
| 321 |
+
|
| 322 |
+
set ::tcl::abs [namespace origin $::tcl::x]
|
| 323 |
+
|
| 324 |
+
# special case so that global names have no
|
| 325 |
+
# leading ::, this is required by the unknown
|
| 326 |
+
# command
|
| 327 |
+
|
| 328 |
+
set ::tcl::abs \
|
| 329 |
+
[lindex [auto_qualify $::tcl::abs ::] 0]
|
| 330 |
+
|
| 331 |
+
if {$::tcl::x ne $::tcl::abs} {
|
| 332 |
+
# Name changed during qualification
|
| 333 |
+
|
| 334 |
+
set ::tcl::newCmds($::tcl::abs) 1
|
| 335 |
+
unset ::tcl::newCmds($::tcl::x)
|
| 336 |
+
}
|
| 337 |
+
}
|
| 338 |
+
}
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
# Look through the packages that appeared, and if there is a
|
| 342 |
+
# version provided, then record it
|
| 343 |
+
|
| 344 |
+
foreach ::tcl::x [package names] {
|
| 345 |
+
if {[package provide $::tcl::x] ne ""
|
| 346 |
+
&& ![info exists ::tcl::packages($::tcl::x)]} {
|
| 347 |
+
lappend ::tcl::newPkgs \
|
| 348 |
+
[list $::tcl::x [package provide $::tcl::x]]
|
| 349 |
+
}
|
| 350 |
+
}
|
| 351 |
+
}
|
| 352 |
+
} on error msg {
|
| 353 |
+
set what [$c eval set ::tcl::debug]
|
| 354 |
+
if {$doVerbose} {
|
| 355 |
+
tclLog "warning: error while $what $file: $msg"
|
| 356 |
+
}
|
| 357 |
+
} on ok {} {
|
| 358 |
+
set what [$c eval set ::tcl::debug]
|
| 359 |
+
if {$doVerbose} {
|
| 360 |
+
tclLog "successful $what of $file"
|
| 361 |
+
}
|
| 362 |
+
set type [$c eval set ::tcl::type]
|
| 363 |
+
set cmds [lsort [$c eval array names ::tcl::newCmds]]
|
| 364 |
+
set pkgs [$c eval set ::tcl::newPkgs]
|
| 365 |
+
if {$doVerbose} {
|
| 366 |
+
if {!$direct} {
|
| 367 |
+
tclLog "commands provided were $cmds"
|
| 368 |
+
}
|
| 369 |
+
tclLog "packages provided were $pkgs"
|
| 370 |
+
}
|
| 371 |
+
if {[llength $pkgs] > 1} {
|
| 372 |
+
tclLog "warning: \"$file\" provides more than one package ($pkgs)"
|
| 373 |
+
}
|
| 374 |
+
foreach pkg $pkgs {
|
| 375 |
+
# cmds is empty/not used in the direct case
|
| 376 |
+
lappend files($pkg) [list $file $type $cmds]
|
| 377 |
+
}
|
| 378 |
+
|
| 379 |
+
if {$doVerbose} {
|
| 380 |
+
tclLog "processed $file"
|
| 381 |
+
}
|
| 382 |
+
}
|
| 383 |
+
interp delete $c
|
| 384 |
+
}
|
| 385 |
+
|
| 386 |
+
append index "# Tcl package index file, version 1.1\n"
|
| 387 |
+
append index "# This file is generated by the \"pkg_mkIndex$more\" command\n"
|
| 388 |
+
append index "# and sourced either when an application starts up or\n"
|
| 389 |
+
append index "# by a \"package unknown\" script. It invokes the\n"
|
| 390 |
+
append index "# \"package ifneeded\" command to set up package-related\n"
|
| 391 |
+
append index "# information so that packages will be loaded automatically\n"
|
| 392 |
+
append index "# in response to \"package require\" commands. When this\n"
|
| 393 |
+
append index "# script is sourced, the variable \$dir must contain the\n"
|
| 394 |
+
append index "# full path name of this file's directory.\n"
|
| 395 |
+
|
| 396 |
+
foreach pkg [lsort [array names files]] {
|
| 397 |
+
set cmd {}
|
| 398 |
+
lassign $pkg name version
|
| 399 |
+
lappend cmd ::tcl::Pkg::Create -name $name -version $version
|
| 400 |
+
foreach spec [lsort -index 0 $files($pkg)] {
|
| 401 |
+
foreach {file type procs} $spec {
|
| 402 |
+
if {$direct} {
|
| 403 |
+
set procs {}
|
| 404 |
+
}
|
| 405 |
+
lappend cmd "-$type" [list $file $procs]
|
| 406 |
+
}
|
| 407 |
+
}
|
| 408 |
+
append index "\n[eval $cmd]"
|
| 409 |
+
}
|
| 410 |
+
|
| 411 |
+
set f [open [file join $dir pkgIndex.tcl] w]
|
| 412 |
+
puts $f $index
|
| 413 |
+
close $f
|
| 414 |
+
}
|
| 415 |
+
|
| 416 |
+
# tclPkgSetup --
|
| 417 |
+
# This is a utility procedure use by pkgIndex.tcl files. It is invoked as
|
| 418 |
+
# part of a "package ifneeded" script. It calls "package provide" to indicate
|
| 419 |
+
# that a package is available, then sets entries in the auto_index array so
|
| 420 |
+
# that the package's files will be auto-loaded when the commands are used.
|
| 421 |
+
#
|
| 422 |
+
# Arguments:
|
| 423 |
+
# dir - Directory containing all the files for this package.
|
| 424 |
+
# pkg - Name of the package (no version number).
|
| 425 |
+
# version - Version number for the package, such as 2.1.3.
|
| 426 |
+
# files - List of files that constitute the package. Each
|
| 427 |
+
# element is a sub-list with three elements. The first
|
| 428 |
+
# is the name of a file relative to $dir, the second is
|
| 429 |
+
# "load" or "source", indicating whether the file is a
|
| 430 |
+
# loadable binary or a script to source, and the third
|
| 431 |
+
# is a list of commands defined by this file.
|
| 432 |
+
|
| 433 |
+
proc tclPkgSetup {dir pkg version files} {
|
| 434 |
+
global auto_index
|
| 435 |
+
|
| 436 |
+
package provide $pkg $version
|
| 437 |
+
foreach fileInfo $files {
|
| 438 |
+
set f [lindex $fileInfo 0]
|
| 439 |
+
set type [lindex $fileInfo 1]
|
| 440 |
+
foreach cmd [lindex $fileInfo 2] {
|
| 441 |
+
if {$type eq "load"} {
|
| 442 |
+
set auto_index($cmd) [list load [file join $dir $f] $pkg]
|
| 443 |
+
} else {
|
| 444 |
+
set auto_index($cmd) [list source [file join $dir $f]]
|
| 445 |
+
}
|
| 446 |
+
}
|
| 447 |
+
}
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
# tclPkgUnknown --
|
| 451 |
+
# This procedure provides the default for the "package unknown" function. It
|
| 452 |
+
# is invoked when a package that's needed can't be found. It scans the
|
| 453 |
+
# auto_path directories and their immediate children looking for pkgIndex.tcl
|
| 454 |
+
# files and sources any such files that are found to setup the package
|
| 455 |
+
# database. As it searches, it will recognize changes to the auto_path and
|
| 456 |
+
# scan any new directories.
|
| 457 |
+
#
|
| 458 |
+
# Arguments:
|
| 459 |
+
# name - Name of desired package. Not used.
|
| 460 |
+
# version - Version of desired package. Not used.
|
| 461 |
+
# exact - Either "-exact" or omitted. Not used.
|
| 462 |
+
|
| 463 |
+
proc tclPkgUnknown {name args} {
|
| 464 |
+
global auto_path env
|
| 465 |
+
|
| 466 |
+
if {![info exists auto_path]} {
|
| 467 |
+
return
|
| 468 |
+
}
|
| 469 |
+
# Cache the auto_path, because it may change while we run through the
|
| 470 |
+
# first set of pkgIndex.tcl files
|
| 471 |
+
set old_path [set use_path $auto_path]
|
| 472 |
+
while {[llength $use_path]} {
|
| 473 |
+
set dir [lindex $use_path end]
|
| 474 |
+
|
| 475 |
+
# Make sure we only scan each directory one time.
|
| 476 |
+
if {[info exists tclSeenPath($dir)]} {
|
| 477 |
+
set use_path [lrange $use_path 0 end-1]
|
| 478 |
+
continue
|
| 479 |
+
}
|
| 480 |
+
set tclSeenPath($dir) 1
|
| 481 |
+
|
| 482 |
+
# Get the pkgIndex.tcl files in subdirectories of auto_path directories.
|
| 483 |
+
# - Safe Base interpreters have a restricted "glob" command that
|
| 484 |
+
# works in this case.
|
| 485 |
+
# - The "catch" was essential when there was no safe glob and every
|
| 486 |
+
# call in a safe interp failed; it is retained only for corner
|
| 487 |
+
# cases in which the eventual call to glob returns an error.
|
| 488 |
+
catch {
|
| 489 |
+
foreach file [glob -directory $dir -join -nocomplain \
|
| 490 |
+
* pkgIndex.tcl] {
|
| 491 |
+
set dir [file dirname $file]
|
| 492 |
+
if {![info exists procdDirs($dir)]} {
|
| 493 |
+
try {
|
| 494 |
+
source $file
|
| 495 |
+
} trap {POSIX EACCES} {} {
|
| 496 |
+
# $file was not readable; silently ignore
|
| 497 |
+
continue
|
| 498 |
+
} on error msg {
|
| 499 |
+
tclLog "error reading package index file $file: $msg"
|
| 500 |
+
} on ok {} {
|
| 501 |
+
set procdDirs($dir) 1
|
| 502 |
+
}
|
| 503 |
+
}
|
| 504 |
+
}
|
| 505 |
+
}
|
| 506 |
+
set dir [lindex $use_path end]
|
| 507 |
+
if {![info exists procdDirs($dir)]} {
|
| 508 |
+
set file [file join $dir pkgIndex.tcl]
|
| 509 |
+
# safe interps usually don't have "file exists",
|
| 510 |
+
if {([interp issafe] || [file exists $file])} {
|
| 511 |
+
try {
|
| 512 |
+
source $file
|
| 513 |
+
} trap {POSIX EACCES} {} {
|
| 514 |
+
# $file was not readable; silently ignore
|
| 515 |
+
continue
|
| 516 |
+
} on error msg {
|
| 517 |
+
tclLog "error reading package index file $file: $msg"
|
| 518 |
+
} on ok {} {
|
| 519 |
+
set procdDirs($dir) 1
|
| 520 |
+
}
|
| 521 |
+
}
|
| 522 |
+
}
|
| 523 |
+
|
| 524 |
+
set use_path [lrange $use_path 0 end-1]
|
| 525 |
+
|
| 526 |
+
# Check whether any of the index scripts we [source]d above set a new
|
| 527 |
+
# value for $::auto_path. If so, then find any new directories on the
|
| 528 |
+
# $::auto_path, and lappend them to the $use_path we are working from.
|
| 529 |
+
# This gives index scripts the (arguably unwise) power to expand the
|
| 530 |
+
# index script search path while the search is in progress.
|
| 531 |
+
set index 0
|
| 532 |
+
if {[llength $old_path] == [llength $auto_path]} {
|
| 533 |
+
foreach dir $auto_path old $old_path {
|
| 534 |
+
if {$dir ne $old} {
|
| 535 |
+
# This entry in $::auto_path has changed.
|
| 536 |
+
break
|
| 537 |
+
}
|
| 538 |
+
incr index
|
| 539 |
+
}
|
| 540 |
+
}
|
| 541 |
+
|
| 542 |
+
# $index now points to the first element of $auto_path that has
|
| 543 |
+
# changed, or the beginning if $auto_path has changed length Scan the
|
| 544 |
+
# new elements of $auto_path for directories to add to $use_path.
|
| 545 |
+
# Don't add directories we've already seen, or ones already on the
|
| 546 |
+
# $use_path.
|
| 547 |
+
foreach dir [lrange $auto_path $index end] {
|
| 548 |
+
if {![info exists tclSeenPath($dir)] && ($dir ni $use_path)} {
|
| 549 |
+
lappend use_path $dir
|
| 550 |
+
}
|
| 551 |
+
}
|
| 552 |
+
set old_path $auto_path
|
| 553 |
+
}
|
| 554 |
+
}
|
| 555 |
+
|
| 556 |
+
# tcl::MacOSXPkgUnknown --
|
| 557 |
+
# This procedure extends the "package unknown" function for MacOSX. It scans
|
| 558 |
+
# the Resources/Scripts directories of the immediate children of the auto_path
|
| 559 |
+
# directories for pkgIndex files.
|
| 560 |
+
#
|
| 561 |
+
# Arguments:
|
| 562 |
+
# original - original [package unknown] procedure
|
| 563 |
+
# name - Name of desired package. Not used.
|
| 564 |
+
# version - Version of desired package. Not used.
|
| 565 |
+
# exact - Either "-exact" or omitted. Not used.
|
| 566 |
+
|
| 567 |
+
proc tcl::MacOSXPkgUnknown {original name args} {
|
| 568 |
+
# First do the cross-platform default search
|
| 569 |
+
uplevel 1 $original [linsert $args 0 $name]
|
| 570 |
+
|
| 571 |
+
# Now do MacOSX specific searching
|
| 572 |
+
global auto_path
|
| 573 |
+
|
| 574 |
+
if {![info exists auto_path]} {
|
| 575 |
+
return
|
| 576 |
+
}
|
| 577 |
+
# Cache the auto_path, because it may change while we run through the
|
| 578 |
+
# first set of pkgIndex.tcl files
|
| 579 |
+
set old_path [set use_path $auto_path]
|
| 580 |
+
while {[llength $use_path]} {
|
| 581 |
+
set dir [lindex $use_path end]
|
| 582 |
+
|
| 583 |
+
# Make sure we only scan each directory one time.
|
| 584 |
+
if {[info exists tclSeenPath($dir)]} {
|
| 585 |
+
set use_path [lrange $use_path 0 end-1]
|
| 586 |
+
continue
|
| 587 |
+
}
|
| 588 |
+
set tclSeenPath($dir) 1
|
| 589 |
+
|
| 590 |
+
# get the pkgIndex files out of the subdirectories
|
| 591 |
+
# Safe interpreters do not use tcl::MacOSXPkgUnknown - see init.tcl.
|
| 592 |
+
foreach file [glob -directory $dir -join -nocomplain \
|
| 593 |
+
* Resources Scripts pkgIndex.tcl] {
|
| 594 |
+
set dir [file dirname $file]
|
| 595 |
+
if {![info exists procdDirs($dir)]} {
|
| 596 |
+
try {
|
| 597 |
+
source $file
|
| 598 |
+
} trap {POSIX EACCES} {} {
|
| 599 |
+
# $file was not readable; silently ignore
|
| 600 |
+
continue
|
| 601 |
+
} on error msg {
|
| 602 |
+
tclLog "error reading package index file $file: $msg"
|
| 603 |
+
} on ok {} {
|
| 604 |
+
set procdDirs($dir) 1
|
| 605 |
+
}
|
| 606 |
+
}
|
| 607 |
+
}
|
| 608 |
+
set use_path [lrange $use_path 0 end-1]
|
| 609 |
+
|
| 610 |
+
# Check whether any of the index scripts we [source]d above set a new
|
| 611 |
+
# value for $::auto_path. If so, then find any new directories on the
|
| 612 |
+
# $::auto_path, and lappend them to the $use_path we are working from.
|
| 613 |
+
# This gives index scripts the (arguably unwise) power to expand the
|
| 614 |
+
# index script search path while the search is in progress.
|
| 615 |
+
set index 0
|
| 616 |
+
if {[llength $old_path] == [llength $auto_path]} {
|
| 617 |
+
foreach dir $auto_path old $old_path {
|
| 618 |
+
if {$dir ne $old} {
|
| 619 |
+
# This entry in $::auto_path has changed.
|
| 620 |
+
break
|
| 621 |
+
}
|
| 622 |
+
incr index
|
| 623 |
+
}
|
| 624 |
+
}
|
| 625 |
+
|
| 626 |
+
# $index now points to the first element of $auto_path that has
|
| 627 |
+
# changed, or the beginning if $auto_path has changed length Scan the
|
| 628 |
+
# new elements of $auto_path for directories to add to $use_path.
|
| 629 |
+
# Don't add directories we've already seen, or ones already on the
|
| 630 |
+
# $use_path.
|
| 631 |
+
foreach dir [lrange $auto_path $index end] {
|
| 632 |
+
if {![info exists tclSeenPath($dir)] && ($dir ni $use_path)} {
|
| 633 |
+
lappend use_path $dir
|
| 634 |
+
}
|
| 635 |
+
}
|
| 636 |
+
set old_path $auto_path
|
| 637 |
+
}
|
| 638 |
+
}
|
| 639 |
+
|
| 640 |
+
# ::tcl::Pkg::Create --
|
| 641 |
+
#
|
| 642 |
+
# Given a package specification generate a "package ifneeded" statement
|
| 643 |
+
# for the package, suitable for inclusion in a pkgIndex.tcl file.
|
| 644 |
+
#
|
| 645 |
+
# Arguments:
|
| 646 |
+
# args arguments used by the Create function:
|
| 647 |
+
# -name packageName
|
| 648 |
+
# -version packageVersion
|
| 649 |
+
# -load {filename ?{procs}?}
|
| 650 |
+
# ...
|
| 651 |
+
# -source {filename ?{procs}?}
|
| 652 |
+
# ...
|
| 653 |
+
#
|
| 654 |
+
# Any number of -load and -source parameters may be
|
| 655 |
+
# specified, so long as there is at least one -load or
|
| 656 |
+
# -source parameter. If the procs component of a module
|
| 657 |
+
# specifier is left off, that module will be set up for
|
| 658 |
+
# direct loading; otherwise, it will be set up for lazy
|
| 659 |
+
# loading. If both -source and -load are specified, the
|
| 660 |
+
# -load'ed files will be loaded first, followed by the
|
| 661 |
+
# -source'd files.
|
| 662 |
+
#
|
| 663 |
+
# Results:
|
| 664 |
+
# An appropriate "package ifneeded" statement for the package.
|
| 665 |
+
|
| 666 |
+
proc ::tcl::Pkg::Create {args} {
|
| 667 |
+
append err(usage) "[lindex [info level 0] 0] "
|
| 668 |
+
append err(usage) "-name packageName -version packageVersion"
|
| 669 |
+
append err(usage) "?-load {filename ?{procs}?}? ... "
|
| 670 |
+
append err(usage) "?-source {filename ?{procs}?}? ..."
|
| 671 |
+
|
| 672 |
+
set err(wrongNumArgs) "wrong # args: should be \"$err(usage)\""
|
| 673 |
+
set err(valueMissing) "value for \"%s\" missing: should be \"$err(usage)\""
|
| 674 |
+
set err(unknownOpt) "unknown option \"%s\": should be \"$err(usage)\""
|
| 675 |
+
set err(noLoadOrSource) "at least one of -load and -source must be given"
|
| 676 |
+
|
| 677 |
+
# process arguments
|
| 678 |
+
set len [llength $args]
|
| 679 |
+
if {$len < 6} {
|
| 680 |
+
error $err(wrongNumArgs)
|
| 681 |
+
}
|
| 682 |
+
|
| 683 |
+
# Initialize parameters
|
| 684 |
+
array set opts {-name {} -version {} -source {} -load {}}
|
| 685 |
+
|
| 686 |
+
# process parameters
|
| 687 |
+
for {set i 0} {$i < $len} {incr i} {
|
| 688 |
+
set flag [lindex $args $i]
|
| 689 |
+
incr i
|
| 690 |
+
switch -glob -- $flag {
|
| 691 |
+
"-name" -
|
| 692 |
+
"-version" {
|
| 693 |
+
if {$i >= $len} {
|
| 694 |
+
error [format $err(valueMissing) $flag]
|
| 695 |
+
}
|
| 696 |
+
set opts($flag) [lindex $args $i]
|
| 697 |
+
}
|
| 698 |
+
"-source" -
|
| 699 |
+
"-load" {
|
| 700 |
+
if {$i >= $len} {
|
| 701 |
+
error [format $err(valueMissing) $flag]
|
| 702 |
+
}
|
| 703 |
+
lappend opts($flag) [lindex $args $i]
|
| 704 |
+
}
|
| 705 |
+
default {
|
| 706 |
+
error [format $err(unknownOpt) [lindex $args $i]]
|
| 707 |
+
}
|
| 708 |
+
}
|
| 709 |
+
}
|
| 710 |
+
|
| 711 |
+
# Validate the parameters
|
| 712 |
+
if {![llength $opts(-name)]} {
|
| 713 |
+
error [format $err(valueMissing) "-name"]
|
| 714 |
+
}
|
| 715 |
+
if {![llength $opts(-version)]} {
|
| 716 |
+
error [format $err(valueMissing) "-version"]
|
| 717 |
+
}
|
| 718 |
+
|
| 719 |
+
if {!([llength $opts(-source)] || [llength $opts(-load)])} {
|
| 720 |
+
error $err(noLoadOrSource)
|
| 721 |
+
}
|
| 722 |
+
|
| 723 |
+
# OK, now everything is good. Generate the package ifneeded statement.
|
| 724 |
+
set cmdline "package ifneeded $opts(-name) $opts(-version) "
|
| 725 |
+
|
| 726 |
+
set cmdList {}
|
| 727 |
+
set lazyFileList {}
|
| 728 |
+
|
| 729 |
+
# Handle -load and -source specs
|
| 730 |
+
foreach key {load source} {
|
| 731 |
+
foreach filespec $opts(-$key) {
|
| 732 |
+
lassign $filespec filename proclist
|
| 733 |
+
|
| 734 |
+
if { [llength $proclist] == 0 } {
|
| 735 |
+
set cmd "\[list $key \[file join \$dir [list $filename]\]\]"
|
| 736 |
+
lappend cmdList $cmd
|
| 737 |
+
} else {
|
| 738 |
+
lappend lazyFileList [list $filename $key $proclist]
|
| 739 |
+
}
|
| 740 |
+
}
|
| 741 |
+
}
|
| 742 |
+
|
| 743 |
+
if {[llength $lazyFileList]} {
|
| 744 |
+
lappend cmdList "\[list tclPkgSetup \$dir $opts(-name)\
|
| 745 |
+
$opts(-version) [list $lazyFileList]\]"
|
| 746 |
+
}
|
| 747 |
+
append cmdline [join $cmdList "\\n"]
|
| 748 |
+
return $cmdline
|
| 749 |
+
}
|
| 750 |
+
|
| 751 |
+
interp alias {} ::pkg::create {} ::tcl::Pkg::Create
|
mplug_owl2/lib/tcl8.6/safe.tcl
ADDED
|
@@ -0,0 +1,1289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# safe.tcl --
|
| 2 |
+
#
|
| 3 |
+
# This file provide a safe loading/sourcing mechanism for safe interpreters.
|
| 4 |
+
# It implements a virtual path mechanism to hide the real pathnames from the
|
| 5 |
+
# child. It runs in a parent interpreter and sets up data structure and
|
| 6 |
+
# aliases that will be invoked when used from a child interpreter.
|
| 7 |
+
#
|
| 8 |
+
# See the safe.n man page for details.
|
| 9 |
+
#
|
| 10 |
+
# Copyright (c) 1996-1997 Sun Microsystems, Inc.
|
| 11 |
+
#
|
| 12 |
+
# See the file "license.terms" for information on usage and redistribution of
|
| 13 |
+
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 14 |
+
|
| 15 |
+
#
|
| 16 |
+
# The implementation is based on namespaces. These naming conventions are
|
| 17 |
+
# followed:
|
| 18 |
+
# Private procs starts with uppercase.
|
| 19 |
+
# Public procs are exported and starts with lowercase
|
| 20 |
+
#
|
| 21 |
+
|
| 22 |
+
# Needed utilities package
|
| 23 |
+
package require opt 0.4.8
|
| 24 |
+
|
| 25 |
+
# Create the safe namespace
|
| 26 |
+
namespace eval ::safe {
|
| 27 |
+
# Exported API:
|
| 28 |
+
namespace export interpCreate interpInit interpConfigure interpDelete \
|
| 29 |
+
interpAddToAccessPath interpFindInAccessPath setLogCmd
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
# Helper function to resolve the dual way of specifying staticsok (either
|
| 33 |
+
# by -noStatics or -statics 0)
|
| 34 |
+
proc ::safe::InterpStatics {} {
|
| 35 |
+
foreach v {Args statics noStatics} {
|
| 36 |
+
upvar $v $v
|
| 37 |
+
}
|
| 38 |
+
set flag [::tcl::OptProcArgGiven -noStatics]
|
| 39 |
+
if {$flag && (!$noStatics == !$statics)
|
| 40 |
+
&& ([::tcl::OptProcArgGiven -statics])} {
|
| 41 |
+
return -code error\
|
| 42 |
+
"conflicting values given for -statics and -noStatics"
|
| 43 |
+
}
|
| 44 |
+
if {$flag} {
|
| 45 |
+
return [expr {!$noStatics}]
|
| 46 |
+
} else {
|
| 47 |
+
return $statics
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
# Helper function to resolve the dual way of specifying nested loading
|
| 52 |
+
# (either by -nestedLoadOk or -nested 1)
|
| 53 |
+
proc ::safe::InterpNested {} {
|
| 54 |
+
foreach v {Args nested nestedLoadOk} {
|
| 55 |
+
upvar $v $v
|
| 56 |
+
}
|
| 57 |
+
set flag [::tcl::OptProcArgGiven -nestedLoadOk]
|
| 58 |
+
# note that the test here is the opposite of the "InterpStatics" one
|
| 59 |
+
# (it is not -noNested... because of the wanted default value)
|
| 60 |
+
if {$flag && (!$nestedLoadOk != !$nested)
|
| 61 |
+
&& ([::tcl::OptProcArgGiven -nested])} {
|
| 62 |
+
return -code error\
|
| 63 |
+
"conflicting values given for -nested and -nestedLoadOk"
|
| 64 |
+
}
|
| 65 |
+
if {$flag} {
|
| 66 |
+
# another difference with "InterpStatics"
|
| 67 |
+
return $nestedLoadOk
|
| 68 |
+
} else {
|
| 69 |
+
return $nested
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
####
|
| 74 |
+
#
|
| 75 |
+
# API entry points that needs argument parsing :
|
| 76 |
+
#
|
| 77 |
+
####
|
| 78 |
+
|
| 79 |
+
# Interface/entry point function and front end for "Create"
|
| 80 |
+
proc ::safe::interpCreate {args} {
|
| 81 |
+
set Args [::tcl::OptKeyParse ::safe::interpCreate $args]
|
| 82 |
+
RejectExcessColons $slave
|
| 83 |
+
InterpCreate $slave $accessPath \
|
| 84 |
+
[InterpStatics] [InterpNested] $deleteHook
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
proc ::safe::interpInit {args} {
|
| 88 |
+
set Args [::tcl::OptKeyParse ::safe::interpIC $args]
|
| 89 |
+
if {![::interp exists $slave]} {
|
| 90 |
+
return -code error "\"$slave\" is not an interpreter"
|
| 91 |
+
}
|
| 92 |
+
RejectExcessColons $slave
|
| 93 |
+
InterpInit $slave $accessPath \
|
| 94 |
+
[InterpStatics] [InterpNested] $deleteHook
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
# Check that the given child is "one of us"
|
| 98 |
+
proc ::safe::CheckInterp {child} {
|
| 99 |
+
namespace upvar ::safe [VarName $child] state
|
| 100 |
+
if {![info exists state] || ![::interp exists $child]} {
|
| 101 |
+
return -code error \
|
| 102 |
+
"\"$child\" is not an interpreter managed by ::safe::"
|
| 103 |
+
}
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
# Interface/entry point function and front end for "Configure". This code
|
| 107 |
+
# is awfully pedestrian because it would need more coupling and support
|
| 108 |
+
# between the way we store the configuration values in safe::interp's and
|
| 109 |
+
# the Opt package. Obviously we would like an OptConfigure to avoid
|
| 110 |
+
# duplicating all this code everywhere.
|
| 111 |
+
# -> TODO (the app should share or access easily the program/value stored
|
| 112 |
+
# by opt)
|
| 113 |
+
|
| 114 |
+
# This is even more complicated by the boolean flags with no values that
|
| 115 |
+
# we had the bad idea to support for the sake of user simplicity in
|
| 116 |
+
# create/init but which makes life hard in configure...
|
| 117 |
+
# So this will be hopefully written and some integrated with opt1.0
|
| 118 |
+
# (hopefully for tcl8.1 ?)
|
| 119 |
+
proc ::safe::interpConfigure {args} {
|
| 120 |
+
switch [llength $args] {
|
| 121 |
+
1 {
|
| 122 |
+
# If we have exactly 1 argument the semantic is to return all
|
| 123 |
+
# the current configuration. We still call OptKeyParse though
|
| 124 |
+
# we know that "child" is our given argument because it also
|
| 125 |
+
# checks for the "-help" option.
|
| 126 |
+
set Args [::tcl::OptKeyParse ::safe::interpIC $args]
|
| 127 |
+
CheckInterp $slave
|
| 128 |
+
namespace upvar ::safe [VarName $slave] state
|
| 129 |
+
|
| 130 |
+
return [join [list \
|
| 131 |
+
[list -accessPath $state(access_path)] \
|
| 132 |
+
[list -statics $state(staticsok)] \
|
| 133 |
+
[list -nested $state(nestedok)] \
|
| 134 |
+
[list -deleteHook $state(cleanupHook)]]]
|
| 135 |
+
}
|
| 136 |
+
2 {
|
| 137 |
+
# If we have exactly 2 arguments the semantic is a "configure
|
| 138 |
+
# get"
|
| 139 |
+
lassign $args slave arg
|
| 140 |
+
|
| 141 |
+
# get the flag sub program (we 'know' about Opt's internal
|
| 142 |
+
# representation of data)
|
| 143 |
+
set desc [lindex [::tcl::OptKeyGetDesc ::safe::interpIC] 2]
|
| 144 |
+
set hits [::tcl::OptHits desc $arg]
|
| 145 |
+
if {$hits > 1} {
|
| 146 |
+
return -code error [::tcl::OptAmbigous $desc $arg]
|
| 147 |
+
} elseif {$hits == 0} {
|
| 148 |
+
return -code error [::tcl::OptFlagUsage $desc $arg]
|
| 149 |
+
}
|
| 150 |
+
CheckInterp $slave
|
| 151 |
+
namespace upvar ::safe [VarName $slave] state
|
| 152 |
+
|
| 153 |
+
set item [::tcl::OptCurDesc $desc]
|
| 154 |
+
set name [::tcl::OptName $item]
|
| 155 |
+
switch -exact -- $name {
|
| 156 |
+
-accessPath {
|
| 157 |
+
return [list -accessPath $state(access_path)]
|
| 158 |
+
}
|
| 159 |
+
-statics {
|
| 160 |
+
return [list -statics $state(staticsok)]
|
| 161 |
+
}
|
| 162 |
+
-nested {
|
| 163 |
+
return [list -nested $state(nestedok)]
|
| 164 |
+
}
|
| 165 |
+
-deleteHook {
|
| 166 |
+
return [list -deleteHook $state(cleanupHook)]
|
| 167 |
+
}
|
| 168 |
+
-noStatics {
|
| 169 |
+
# it is most probably a set in fact but we would need
|
| 170 |
+
# then to jump to the set part and it is not *sure*
|
| 171 |
+
# that it is a set action that the user want, so force
|
| 172 |
+
# it to use the unambiguous -statics ?value? instead:
|
| 173 |
+
return -code error\
|
| 174 |
+
"ambigous query (get or set -noStatics ?)\
|
| 175 |
+
use -statics instead"
|
| 176 |
+
}
|
| 177 |
+
-nestedLoadOk {
|
| 178 |
+
return -code error\
|
| 179 |
+
"ambigous query (get or set -nestedLoadOk ?)\
|
| 180 |
+
use -nested instead"
|
| 181 |
+
}
|
| 182 |
+
default {
|
| 183 |
+
return -code error "unknown flag $name (bug)"
|
| 184 |
+
}
|
| 185 |
+
}
|
| 186 |
+
}
|
| 187 |
+
default {
|
| 188 |
+
# Otherwise we want to parse the arguments like init and
|
| 189 |
+
# create did
|
| 190 |
+
set Args [::tcl::OptKeyParse ::safe::interpIC $args]
|
| 191 |
+
CheckInterp $slave
|
| 192 |
+
namespace upvar ::safe [VarName $slave] state
|
| 193 |
+
|
| 194 |
+
# Get the current (and not the default) values of whatever has
|
| 195 |
+
# not been given:
|
| 196 |
+
if {![::tcl::OptProcArgGiven -accessPath]} {
|
| 197 |
+
set doreset 0
|
| 198 |
+
set accessPath $state(access_path)
|
| 199 |
+
} else {
|
| 200 |
+
set doreset 1
|
| 201 |
+
}
|
| 202 |
+
if {
|
| 203 |
+
![::tcl::OptProcArgGiven -statics]
|
| 204 |
+
&& ![::tcl::OptProcArgGiven -noStatics]
|
| 205 |
+
} then {
|
| 206 |
+
set statics $state(staticsok)
|
| 207 |
+
} else {
|
| 208 |
+
set statics [InterpStatics]
|
| 209 |
+
}
|
| 210 |
+
if {
|
| 211 |
+
[::tcl::OptProcArgGiven -nested] ||
|
| 212 |
+
[::tcl::OptProcArgGiven -nestedLoadOk]
|
| 213 |
+
} then {
|
| 214 |
+
set nested [InterpNested]
|
| 215 |
+
} else {
|
| 216 |
+
set nested $state(nestedok)
|
| 217 |
+
}
|
| 218 |
+
if {![::tcl::OptProcArgGiven -deleteHook]} {
|
| 219 |
+
set deleteHook $state(cleanupHook)
|
| 220 |
+
}
|
| 221 |
+
# we can now reconfigure :
|
| 222 |
+
InterpSetConfig $slave $accessPath $statics $nested $deleteHook
|
| 223 |
+
# auto_reset the child (to completely synch the new access_path)
|
| 224 |
+
if {$doreset} {
|
| 225 |
+
if {[catch {::interp eval $slave {auto_reset}} msg]} {
|
| 226 |
+
Log $slave "auto_reset failed: $msg"
|
| 227 |
+
} else {
|
| 228 |
+
Log $slave "successful auto_reset" NOTICE
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
# Sync the paths used to search for Tcl modules.
|
| 232 |
+
::interp eval $slave {tcl::tm::path remove {*}[tcl::tm::list]}
|
| 233 |
+
if {[llength $state(tm_path_slave)] > 0} {
|
| 234 |
+
::interp eval $slave [list \
|
| 235 |
+
::tcl::tm::add {*}[lreverse $state(tm_path_slave)]]
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
+
# Remove stale "package ifneeded" data for non-loaded packages.
|
| 239 |
+
# - Not for loaded packages, because "package forget" erases
|
| 240 |
+
# data from "package provide" as well as "package ifneeded".
|
| 241 |
+
# - This is OK because the script cannot reload any version of
|
| 242 |
+
# the package unless it first does "package forget".
|
| 243 |
+
foreach pkg [::interp eval $slave {package names}] {
|
| 244 |
+
if {[::interp eval $slave [list package provide $pkg]] eq ""} {
|
| 245 |
+
::interp eval $slave [list package forget $pkg]
|
| 246 |
+
}
|
| 247 |
+
}
|
| 248 |
+
}
|
| 249 |
+
return
|
| 250 |
+
}
|
| 251 |
+
}
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
####
|
| 255 |
+
#
|
| 256 |
+
# Functions that actually implements the exported APIs
|
| 257 |
+
#
|
| 258 |
+
####
|
| 259 |
+
|
| 260 |
+
#
|
| 261 |
+
# safe::InterpCreate : doing the real job
|
| 262 |
+
#
|
| 263 |
+
# This procedure creates a safe interpreter and initializes it with the safe
|
| 264 |
+
# base aliases.
|
| 265 |
+
# NB: child name must be simple alphanumeric string, no spaces, no (), no
|
| 266 |
+
# {},... {because the state array is stored as part of the name}
|
| 267 |
+
#
|
| 268 |
+
# Returns the child name.
|
| 269 |
+
#
|
| 270 |
+
# Optional Arguments :
|
| 271 |
+
# + child name : if empty, generated name will be used
|
| 272 |
+
# + access_path: path list controlling where load/source can occur,
|
| 273 |
+
# if empty: the parent auto_path will be used.
|
| 274 |
+
# + staticsok : flag, if 0 :no static package can be loaded (load {} Xxx)
|
| 275 |
+
# if 1 :static packages are ok.
|
| 276 |
+
# + nestedok: flag, if 0 :no loading to sub-sub interps (load xx xx sub)
|
| 277 |
+
# if 1 : multiple levels are ok.
|
| 278 |
+
|
| 279 |
+
# use the full name and no indent so auto_mkIndex can find us
|
| 280 |
+
proc ::safe::InterpCreate {
|
| 281 |
+
child
|
| 282 |
+
access_path
|
| 283 |
+
staticsok
|
| 284 |
+
nestedok
|
| 285 |
+
deletehook
|
| 286 |
+
} {
|
| 287 |
+
# Create the child.
|
| 288 |
+
# If evaluated in ::safe, the interpreter command for foo is ::foo;
|
| 289 |
+
# but for foo::bar is safe::foo::bar. So evaluate in :: instead.
|
| 290 |
+
if {$child ne ""} {
|
| 291 |
+
namespace eval :: [list ::interp create -safe $child]
|
| 292 |
+
} else {
|
| 293 |
+
# empty argument: generate child name
|
| 294 |
+
set child [::interp create -safe]
|
| 295 |
+
}
|
| 296 |
+
Log $child "Created" NOTICE
|
| 297 |
+
|
| 298 |
+
# Initialize it. (returns child name)
|
| 299 |
+
InterpInit $child $access_path $staticsok $nestedok $deletehook
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
#
|
| 303 |
+
# InterpSetConfig (was setAccessPath) :
|
| 304 |
+
# Sets up child virtual auto_path and corresponding structure within
|
| 305 |
+
# the parent. Also sets the tcl_library in the child to be the first
|
| 306 |
+
# directory in the path.
|
| 307 |
+
# NB: If you change the path after the child has been initialized you
|
| 308 |
+
# probably need to call "auto_reset" in the child in order that it gets
|
| 309 |
+
# the right auto_index() array values.
|
| 310 |
+
|
| 311 |
+
proc ::safe::InterpSetConfig {child access_path staticsok nestedok deletehook} {
|
| 312 |
+
global auto_path
|
| 313 |
+
|
| 314 |
+
# determine and store the access path if empty
|
| 315 |
+
if {$access_path eq ""} {
|
| 316 |
+
set access_path $auto_path
|
| 317 |
+
|
| 318 |
+
# Make sure that tcl_library is in auto_path and at the first
|
| 319 |
+
# position (needed by setAccessPath)
|
| 320 |
+
set where [lsearch -exact $access_path [info library]]
|
| 321 |
+
if {$where < 0} {
|
| 322 |
+
# not found, add it.
|
| 323 |
+
set access_path [linsert $access_path 0 [info library]]
|
| 324 |
+
Log $child "tcl_library was not in auto_path,\
|
| 325 |
+
added it to slave's access_path" NOTICE
|
| 326 |
+
} elseif {$where != 0} {
|
| 327 |
+
# not first, move it first
|
| 328 |
+
set access_path [linsert \
|
| 329 |
+
[lreplace $access_path $where $where] \
|
| 330 |
+
0 [info library]]
|
| 331 |
+
Log $child "tcl_libray was not in first in auto_path,\
|
| 332 |
+
moved it to front of slave's access_path" NOTICE
|
| 333 |
+
}
|
| 334 |
+
|
| 335 |
+
# Add 1st level subdirs (will searched by auto loading from tcl
|
| 336 |
+
# code in the child using glob and thus fail, so we add them here
|
| 337 |
+
# so by default it works the same).
|
| 338 |
+
set access_path [AddSubDirs $access_path]
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
Log $child "Setting accessPath=($access_path) staticsok=$staticsok\
|
| 342 |
+
nestedok=$nestedok deletehook=($deletehook)" NOTICE
|
| 343 |
+
|
| 344 |
+
namespace upvar ::safe [VarName $child] state
|
| 345 |
+
|
| 346 |
+
# clear old autopath if it existed
|
| 347 |
+
# build new one
|
| 348 |
+
# Extend the access list with the paths used to look for Tcl Modules.
|
| 349 |
+
# We save the virtual form separately as well, as syncing it with the
|
| 350 |
+
# child has to be deferred until the necessary commands are present for
|
| 351 |
+
# setup.
|
| 352 |
+
|
| 353 |
+
set norm_access_path {}
|
| 354 |
+
set slave_access_path {}
|
| 355 |
+
set map_access_path {}
|
| 356 |
+
set remap_access_path {}
|
| 357 |
+
set slave_tm_path {}
|
| 358 |
+
|
| 359 |
+
set i 0
|
| 360 |
+
foreach dir $access_path {
|
| 361 |
+
set token [PathToken $i]
|
| 362 |
+
lappend slave_access_path $token
|
| 363 |
+
lappend map_access_path $token $dir
|
| 364 |
+
lappend remap_access_path $dir $token
|
| 365 |
+
lappend norm_access_path [file normalize $dir]
|
| 366 |
+
incr i
|
| 367 |
+
}
|
| 368 |
+
|
| 369 |
+
set morepaths [::tcl::tm::list]
|
| 370 |
+
set firstpass 1
|
| 371 |
+
while {[llength $morepaths]} {
|
| 372 |
+
set addpaths $morepaths
|
| 373 |
+
set morepaths {}
|
| 374 |
+
|
| 375 |
+
foreach dir $addpaths {
|
| 376 |
+
# Prevent the addition of dirs on the tm list to the
|
| 377 |
+
# result if they are already known.
|
| 378 |
+
if {[dict exists $remap_access_path $dir]} {
|
| 379 |
+
if {$firstpass} {
|
| 380 |
+
# $dir is in [::tcl::tm::list] and belongs in the slave_tm_path.
|
| 381 |
+
# Later passes handle subdirectories, which belong in the
|
| 382 |
+
# access path but not in the module path.
|
| 383 |
+
lappend slave_tm_path [dict get $remap_access_path $dir]
|
| 384 |
+
}
|
| 385 |
+
continue
|
| 386 |
+
}
|
| 387 |
+
|
| 388 |
+
set token [PathToken $i]
|
| 389 |
+
lappend access_path $dir
|
| 390 |
+
lappend slave_access_path $token
|
| 391 |
+
lappend map_access_path $token $dir
|
| 392 |
+
lappend remap_access_path $dir $token
|
| 393 |
+
lappend norm_access_path [file normalize $dir]
|
| 394 |
+
if {$firstpass} {
|
| 395 |
+
# $dir is in [::tcl::tm::list] and belongs in the slave_tm_path.
|
| 396 |
+
# Later passes handle subdirectories, which belong in the
|
| 397 |
+
# access path but not in the module path.
|
| 398 |
+
lappend slave_tm_path $token
|
| 399 |
+
}
|
| 400 |
+
incr i
|
| 401 |
+
|
| 402 |
+
# [Bug 2854929]
|
| 403 |
+
# Recursively find deeper paths which may contain
|
| 404 |
+
# modules. Required to handle modules with names like
|
| 405 |
+
# 'platform::shell', which translate into
|
| 406 |
+
# 'platform/shell-X.tm', i.e arbitrarily deep
|
| 407 |
+
# subdirectories.
|
| 408 |
+
lappend morepaths {*}[glob -nocomplain -directory $dir -type d *]
|
| 409 |
+
}
|
| 410 |
+
set firstpass 0
|
| 411 |
+
}
|
| 412 |
+
|
| 413 |
+
set state(access_path) $access_path
|
| 414 |
+
set state(access_path,map) $map_access_path
|
| 415 |
+
set state(access_path,remap) $remap_access_path
|
| 416 |
+
set state(access_path,norm) $norm_access_path
|
| 417 |
+
set state(access_path,slave) $slave_access_path
|
| 418 |
+
set state(tm_path_slave) $slave_tm_path
|
| 419 |
+
set state(staticsok) $staticsok
|
| 420 |
+
set state(nestedok) $nestedok
|
| 421 |
+
set state(cleanupHook) $deletehook
|
| 422 |
+
|
| 423 |
+
SyncAccessPath $child
|
| 424 |
+
return
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
#
|
| 428 |
+
#
|
| 429 |
+
# FindInAccessPath:
|
| 430 |
+
# Search for a real directory and returns its virtual Id (including the
|
| 431 |
+
# "$")
|
| 432 |
+
proc ::safe::interpFindInAccessPath {child path} {
|
| 433 |
+
CheckInterp $child
|
| 434 |
+
namespace upvar ::safe [VarName $child] state
|
| 435 |
+
|
| 436 |
+
if {![dict exists $state(access_path,remap) $path]} {
|
| 437 |
+
return -code error "$path not found in access path"
|
| 438 |
+
}
|
| 439 |
+
|
| 440 |
+
return [dict get $state(access_path,remap) $path]
|
| 441 |
+
}
|
| 442 |
+
|
| 443 |
+
#
|
| 444 |
+
# addToAccessPath:
|
| 445 |
+
# add (if needed) a real directory to access path and return its
|
| 446 |
+
# virtual token (including the "$").
|
| 447 |
+
proc ::safe::interpAddToAccessPath {child path} {
|
| 448 |
+
# first check if the directory is already in there
|
| 449 |
+
# (inlined interpFindInAccessPath).
|
| 450 |
+
CheckInterp $child
|
| 451 |
+
namespace upvar ::safe [VarName $child] state
|
| 452 |
+
|
| 453 |
+
if {[dict exists $state(access_path,remap) $path]} {
|
| 454 |
+
return [dict get $state(access_path,remap) $path]
|
| 455 |
+
}
|
| 456 |
+
|
| 457 |
+
# new one, add it:
|
| 458 |
+
set token [PathToken [llength $state(access_path)]]
|
| 459 |
+
|
| 460 |
+
lappend state(access_path) $path
|
| 461 |
+
lappend state(access_path,slave) $token
|
| 462 |
+
lappend state(access_path,map) $token $path
|
| 463 |
+
lappend state(access_path,remap) $path $token
|
| 464 |
+
lappend state(access_path,norm) [file normalize $path]
|
| 465 |
+
|
| 466 |
+
SyncAccessPath $child
|
| 467 |
+
return $token
|
| 468 |
+
}
|
| 469 |
+
|
| 470 |
+
# This procedure applies the initializations to an already existing
|
| 471 |
+
# interpreter. It is useful when you want to install the safe base aliases
|
| 472 |
+
# into a preexisting safe interpreter.
|
| 473 |
+
proc ::safe::InterpInit {
|
| 474 |
+
child
|
| 475 |
+
access_path
|
| 476 |
+
staticsok
|
| 477 |
+
nestedok
|
| 478 |
+
deletehook
|
| 479 |
+
} {
|
| 480 |
+
# Configure will generate an access_path when access_path is empty.
|
| 481 |
+
InterpSetConfig $child $access_path $staticsok $nestedok $deletehook
|
| 482 |
+
|
| 483 |
+
# NB we need to add [namespace current], aliases are always absolute
|
| 484 |
+
# paths.
|
| 485 |
+
|
| 486 |
+
# These aliases let the child load files to define new commands
|
| 487 |
+
# This alias lets the child use the encoding names, convertfrom,
|
| 488 |
+
# convertto, and system, but not "encoding system <name>" to set the
|
| 489 |
+
# system encoding.
|
| 490 |
+
# Handling Tcl Modules, we need a restricted form of Glob.
|
| 491 |
+
# This alias interposes on the 'exit' command and cleanly terminates
|
| 492 |
+
# the child.
|
| 493 |
+
|
| 494 |
+
foreach {command alias} {
|
| 495 |
+
source AliasSource
|
| 496 |
+
load AliasLoad
|
| 497 |
+
encoding AliasEncoding
|
| 498 |
+
exit interpDelete
|
| 499 |
+
glob AliasGlob
|
| 500 |
+
} {
|
| 501 |
+
::interp alias $child $command {} [namespace current]::$alias $child
|
| 502 |
+
}
|
| 503 |
+
|
| 504 |
+
# This alias lets the child have access to a subset of the 'file'
|
| 505 |
+
# command functionality.
|
| 506 |
+
|
| 507 |
+
::interp expose $child file
|
| 508 |
+
foreach subcommand {dirname extension rootname tail} {
|
| 509 |
+
::interp alias $child ::tcl::file::$subcommand {} \
|
| 510 |
+
::safe::AliasFileSubcommand $child $subcommand
|
| 511 |
+
}
|
| 512 |
+
foreach subcommand {
|
| 513 |
+
atime attributes copy delete executable exists isdirectory isfile
|
| 514 |
+
link lstat mtime mkdir nativename normalize owned readable readlink
|
| 515 |
+
rename size stat tempfile type volumes writable
|
| 516 |
+
} {
|
| 517 |
+
::interp alias $child ::tcl::file::$subcommand {} \
|
| 518 |
+
::safe::BadSubcommand $child file $subcommand
|
| 519 |
+
}
|
| 520 |
+
|
| 521 |
+
# Subcommands of info
|
| 522 |
+
foreach {subcommand alias} {
|
| 523 |
+
nameofexecutable AliasExeName
|
| 524 |
+
} {
|
| 525 |
+
::interp alias $child ::tcl::info::$subcommand \
|
| 526 |
+
{} [namespace current]::$alias $child
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
# The allowed child variables already have been set by Tcl_MakeSafe(3)
|
| 530 |
+
|
| 531 |
+
# Source init.tcl and tm.tcl into the child, to get auto_load and
|
| 532 |
+
# other procedures defined:
|
| 533 |
+
|
| 534 |
+
if {[catch {::interp eval $child {
|
| 535 |
+
source [file join $tcl_library init.tcl]
|
| 536 |
+
}} msg opt]} {
|
| 537 |
+
Log $child "can't source init.tcl ($msg)"
|
| 538 |
+
return -options $opt "can't source init.tcl into slave $child ($msg)"
|
| 539 |
+
}
|
| 540 |
+
|
| 541 |
+
if {[catch {::interp eval $child {
|
| 542 |
+
source [file join $tcl_library tm.tcl]
|
| 543 |
+
}} msg opt]} {
|
| 544 |
+
Log $child "can't source tm.tcl ($msg)"
|
| 545 |
+
return -options $opt "can't source tm.tcl into slave $child ($msg)"
|
| 546 |
+
}
|
| 547 |
+
|
| 548 |
+
# Sync the paths used to search for Tcl modules. This can be done only
|
| 549 |
+
# now, after tm.tcl was loaded.
|
| 550 |
+
namespace upvar ::safe [VarName $child] state
|
| 551 |
+
if {[llength $state(tm_path_slave)] > 0} {
|
| 552 |
+
::interp eval $child [list \
|
| 553 |
+
::tcl::tm::add {*}[lreverse $state(tm_path_slave)]]
|
| 554 |
+
}
|
| 555 |
+
return $child
|
| 556 |
+
}
|
| 557 |
+
|
| 558 |
+
# Add (only if needed, avoid duplicates) 1 level of sub directories to an
|
| 559 |
+
# existing path list. Also removes non directories from the returned
|
| 560 |
+
# list.
|
| 561 |
+
proc ::safe::AddSubDirs {pathList} {
|
| 562 |
+
set res {}
|
| 563 |
+
foreach dir $pathList {
|
| 564 |
+
if {[file isdirectory $dir]} {
|
| 565 |
+
# check that we don't have it yet as a children of a previous
|
| 566 |
+
# dir
|
| 567 |
+
if {$dir ni $res} {
|
| 568 |
+
lappend res $dir
|
| 569 |
+
}
|
| 570 |
+
foreach sub [glob -directory $dir -nocomplain *] {
|
| 571 |
+
if {[file isdirectory $sub] && ($sub ni $res)} {
|
| 572 |
+
# new sub dir, add it !
|
| 573 |
+
lappend res $sub
|
| 574 |
+
}
|
| 575 |
+
}
|
| 576 |
+
}
|
| 577 |
+
}
|
| 578 |
+
return $res
|
| 579 |
+
}
|
| 580 |
+
|
| 581 |
+
# This procedure deletes a safe interpreter managed by Safe Tcl and cleans up
|
| 582 |
+
# associated state.
|
| 583 |
+
# - The command will also delete non-Safe-Base interpreters.
|
| 584 |
+
# - This is regrettable, but to avoid breaking existing code this should be
|
| 585 |
+
# amended at the next major revision by uncommenting "CheckInterp".
|
| 586 |
+
|
| 587 |
+
proc ::safe::interpDelete {child} {
|
| 588 |
+
Log $child "About to delete" NOTICE
|
| 589 |
+
|
| 590 |
+
# CheckInterp $child
|
| 591 |
+
namespace upvar ::safe [VarName $child] state
|
| 592 |
+
|
| 593 |
+
# When an interpreter is deleted with [interp delete], any sub-interpreters
|
| 594 |
+
# are deleted automatically, but this leaves behind their data in the Safe
|
| 595 |
+
# Base. To clean up properly, we call safe::interpDelete recursively on each
|
| 596 |
+
# Safe Base sub-interpreter, so each one is deleted cleanly and not by
|
| 597 |
+
# the automatic mechanism built into [interp delete].
|
| 598 |
+
foreach sub [interp children $child] {
|
| 599 |
+
if {[info exists ::safe::[VarName [list $child $sub]]]} {
|
| 600 |
+
::safe::interpDelete [list $child $sub]
|
| 601 |
+
}
|
| 602 |
+
}
|
| 603 |
+
|
| 604 |
+
# If the child has a cleanup hook registered, call it. Check the
|
| 605 |
+
# existence because we might be called to delete an interp which has
|
| 606 |
+
# not been registered with us at all
|
| 607 |
+
|
| 608 |
+
if {[info exists state(cleanupHook)]} {
|
| 609 |
+
set hook $state(cleanupHook)
|
| 610 |
+
if {[llength $hook]} {
|
| 611 |
+
# remove the hook now, otherwise if the hook calls us somehow,
|
| 612 |
+
# we'll loop
|
| 613 |
+
unset state(cleanupHook)
|
| 614 |
+
try {
|
| 615 |
+
{*}$hook $child
|
| 616 |
+
} on error err {
|
| 617 |
+
Log $child "Delete hook error ($err)"
|
| 618 |
+
}
|
| 619 |
+
}
|
| 620 |
+
}
|
| 621 |
+
|
| 622 |
+
# Discard the global array of state associated with the child, and
|
| 623 |
+
# delete the interpreter.
|
| 624 |
+
|
| 625 |
+
if {[info exists state]} {
|
| 626 |
+
unset state
|
| 627 |
+
}
|
| 628 |
+
|
| 629 |
+
# if we have been called twice, the interp might have been deleted
|
| 630 |
+
# already
|
| 631 |
+
if {[::interp exists $child]} {
|
| 632 |
+
::interp delete $child
|
| 633 |
+
Log $child "Deleted" NOTICE
|
| 634 |
+
}
|
| 635 |
+
|
| 636 |
+
return
|
| 637 |
+
}
|
| 638 |
+
|
| 639 |
+
# Set (or get) the logging mechanism
|
| 640 |
+
|
| 641 |
+
proc ::safe::setLogCmd {args} {
|
| 642 |
+
variable Log
|
| 643 |
+
set la [llength $args]
|
| 644 |
+
if {$la == 0} {
|
| 645 |
+
return $Log
|
| 646 |
+
} elseif {$la == 1} {
|
| 647 |
+
set Log [lindex $args 0]
|
| 648 |
+
} else {
|
| 649 |
+
set Log $args
|
| 650 |
+
}
|
| 651 |
+
|
| 652 |
+
if {$Log eq ""} {
|
| 653 |
+
# Disable logging completely. Calls to it will be compiled out
|
| 654 |
+
# of all users.
|
| 655 |
+
proc ::safe::Log {args} {}
|
| 656 |
+
} else {
|
| 657 |
+
# Activate logging, define proper command.
|
| 658 |
+
|
| 659 |
+
proc ::safe::Log {child msg {type ERROR}} {
|
| 660 |
+
variable Log
|
| 661 |
+
{*}$Log "$type for slave $child : $msg"
|
| 662 |
+
return
|
| 663 |
+
}
|
| 664 |
+
}
|
| 665 |
+
}
|
| 666 |
+
|
| 667 |
+
# ------------------- END OF PUBLIC METHODS ------------
|
| 668 |
+
|
| 669 |
+
#
|
| 670 |
+
# Sets the child auto_path to the parent recorded value. Also sets
|
| 671 |
+
# tcl_library to the first token of the virtual path.
|
| 672 |
+
#
|
| 673 |
+
proc ::safe::SyncAccessPath {child} {
|
| 674 |
+
namespace upvar ::safe [VarName $child] state
|
| 675 |
+
|
| 676 |
+
set slave_access_path $state(access_path,slave)
|
| 677 |
+
::interp eval $child [list set auto_path $slave_access_path]
|
| 678 |
+
|
| 679 |
+
Log $child "auto_path in $child has been set to $slave_access_path"\
|
| 680 |
+
NOTICE
|
| 681 |
+
|
| 682 |
+
# This code assumes that info library is the first element in the
|
| 683 |
+
# list of auto_path's. See -> InterpSetConfig for the code which
|
| 684 |
+
# ensures this condition.
|
| 685 |
+
|
| 686 |
+
::interp eval $child [list \
|
| 687 |
+
set tcl_library [lindex $slave_access_path 0]]
|
| 688 |
+
}
|
| 689 |
+
|
| 690 |
+
# Returns the virtual token for directory number N.
|
| 691 |
+
proc ::safe::PathToken {n} {
|
| 692 |
+
# We need to have a ":" in the token string so [file join] on the
|
| 693 |
+
# mac won't turn it into a relative path.
|
| 694 |
+
return "\$p(:$n:)" ;# Form tested by case 7.2
|
| 695 |
+
}
|
| 696 |
+
|
| 697 |
+
#
|
| 698 |
+
# translate virtual path into real path
|
| 699 |
+
#
|
| 700 |
+
proc ::safe::TranslatePath {child path} {
|
| 701 |
+
namespace upvar ::safe [VarName $child] state
|
| 702 |
+
|
| 703 |
+
# somehow strip the namespaces 'functionality' out (the danger is that
|
| 704 |
+
# we would strip valid macintosh "../" queries... :
|
| 705 |
+
if {[string match "*::*" $path] || [string match "*..*" $path]} {
|
| 706 |
+
return -code error "invalid characters in path $path"
|
| 707 |
+
}
|
| 708 |
+
|
| 709 |
+
# Use a cached map instead of computed local vars and subst.
|
| 710 |
+
|
| 711 |
+
return [string map $state(access_path,map) $path]
|
| 712 |
+
}
|
| 713 |
+
|
| 714 |
+
# file name control (limit access to files/resources that should be a
|
| 715 |
+
# valid tcl source file)
|
| 716 |
+
proc ::safe::CheckFileName {child file} {
|
| 717 |
+
# This used to limit what can be sourced to ".tcl" and forbid files
|
| 718 |
+
# with more than 1 dot and longer than 14 chars, but I changed that
|
| 719 |
+
# for 8.4 as a safe interp has enough internal protection already to
|
| 720 |
+
# allow sourcing anything. - hobbs
|
| 721 |
+
|
| 722 |
+
if {![file exists $file]} {
|
| 723 |
+
# don't tell the file path
|
| 724 |
+
return -code error "no such file or directory"
|
| 725 |
+
}
|
| 726 |
+
|
| 727 |
+
if {![file readable $file]} {
|
| 728 |
+
# don't tell the file path
|
| 729 |
+
return -code error "not readable"
|
| 730 |
+
}
|
| 731 |
+
}
|
| 732 |
+
|
| 733 |
+
# AliasFileSubcommand handles selected subcommands of [file] in safe
|
| 734 |
+
# interpreters that are *almost* safe. In particular, it just acts to
|
| 735 |
+
# prevent discovery of what home directories exist.
|
| 736 |
+
|
| 737 |
+
proc ::safe::AliasFileSubcommand {child subcommand name} {
|
| 738 |
+
if {[string match ~* $name]} {
|
| 739 |
+
set name ./$name
|
| 740 |
+
}
|
| 741 |
+
tailcall ::interp invokehidden $child tcl:file:$subcommand $name
|
| 742 |
+
}
|
| 743 |
+
|
| 744 |
+
# AliasGlob is the target of the "glob" alias in safe interpreters.
|
| 745 |
+
|
| 746 |
+
proc ::safe::AliasGlob {child args} {
|
| 747 |
+
Log $child "GLOB ! $args" NOTICE
|
| 748 |
+
set cmd {}
|
| 749 |
+
set at 0
|
| 750 |
+
array set got {
|
| 751 |
+
-directory 0
|
| 752 |
+
-nocomplain 0
|
| 753 |
+
-join 0
|
| 754 |
+
-tails 0
|
| 755 |
+
-- 0
|
| 756 |
+
}
|
| 757 |
+
|
| 758 |
+
if {$::tcl_platform(platform) eq "windows"} {
|
| 759 |
+
set dirPartRE {^(.*)[\\/]([^\\/]*)$}
|
| 760 |
+
} else {
|
| 761 |
+
set dirPartRE {^(.*)/([^/]*)$}
|
| 762 |
+
}
|
| 763 |
+
|
| 764 |
+
set dir {}
|
| 765 |
+
set virtualdir {}
|
| 766 |
+
|
| 767 |
+
while {$at < [llength $args]} {
|
| 768 |
+
switch -glob -- [set opt [lindex $args $at]] {
|
| 769 |
+
-nocomplain - -- - -tails {
|
| 770 |
+
lappend cmd $opt
|
| 771 |
+
set got($opt) 1
|
| 772 |
+
incr at
|
| 773 |
+
}
|
| 774 |
+
-join {
|
| 775 |
+
set got($opt) 1
|
| 776 |
+
incr at
|
| 777 |
+
}
|
| 778 |
+
-types - -type {
|
| 779 |
+
lappend cmd -types [lindex $args [incr at]]
|
| 780 |
+
incr at
|
| 781 |
+
}
|
| 782 |
+
-directory {
|
| 783 |
+
if {$got($opt)} {
|
| 784 |
+
return -code error \
|
| 785 |
+
{"-directory" cannot be used with "-path"}
|
| 786 |
+
}
|
| 787 |
+
set got($opt) 1
|
| 788 |
+
set virtualdir [lindex $args [incr at]]
|
| 789 |
+
incr at
|
| 790 |
+
}
|
| 791 |
+
-* {
|
| 792 |
+
Log $child "Safe base rejecting glob option '$opt'"
|
| 793 |
+
return -code error "Safe base rejecting glob option '$opt'"
|
| 794 |
+
}
|
| 795 |
+
default {
|
| 796 |
+
break
|
| 797 |
+
}
|
| 798 |
+
}
|
| 799 |
+
if {$got(--)} break
|
| 800 |
+
}
|
| 801 |
+
|
| 802 |
+
# Get the real path from the virtual one and check that the path is in the
|
| 803 |
+
# access path of that child. Done after basic argument processing so that
|
| 804 |
+
# we know if -nocomplain is set.
|
| 805 |
+
if {$got(-directory)} {
|
| 806 |
+
try {
|
| 807 |
+
set dir [TranslatePath $child $virtualdir]
|
| 808 |
+
DirInAccessPath $child $dir
|
| 809 |
+
} on error msg {
|
| 810 |
+
Log $child $msg
|
| 811 |
+
if {$got(-nocomplain)} return
|
| 812 |
+
return -code error "permission denied"
|
| 813 |
+
}
|
| 814 |
+
if {$got(--)} {
|
| 815 |
+
set cmd [linsert $cmd end-1 -directory $dir]
|
| 816 |
+
} else {
|
| 817 |
+
lappend cmd -directory $dir
|
| 818 |
+
}
|
| 819 |
+
} else {
|
| 820 |
+
# The code after this "if ... else" block would conspire to return with
|
| 821 |
+
# no results in this case, if it were allowed to proceed. Instead,
|
| 822 |
+
# return now and reduce the number of cases to be considered later.
|
| 823 |
+
Log $child {option -directory must be supplied}
|
| 824 |
+
if {$got(-nocomplain)} return
|
| 825 |
+
return -code error "permission denied"
|
| 826 |
+
}
|
| 827 |
+
|
| 828 |
+
# Apply the -join semantics ourselves.
|
| 829 |
+
if {$got(-join)} {
|
| 830 |
+
set args [lreplace $args $at end [join [lrange $args $at end] "/"]]
|
| 831 |
+
}
|
| 832 |
+
|
| 833 |
+
# Process the pattern arguments. If we've done a join there is only one
|
| 834 |
+
# pattern argument.
|
| 835 |
+
|
| 836 |
+
set firstPattern [llength $cmd]
|
| 837 |
+
foreach opt [lrange $args $at end] {
|
| 838 |
+
if {![regexp $dirPartRE $opt -> thedir thefile]} {
|
| 839 |
+
set thedir .
|
| 840 |
+
# The *.tm search comes here.
|
| 841 |
+
}
|
| 842 |
+
# "Special" treatment for (joined) argument {*/pkgIndex.tcl}.
|
| 843 |
+
# Do the expansion of "*" here, and filter out any directories that are
|
| 844 |
+
# not in the access path. The outcome is to lappend to cmd a path of
|
| 845 |
+
# the form $virtualdir/subdir/pkgIndex.tcl for each subdirectory subdir,
|
| 846 |
+
# after removing any subdir that are not in the access path.
|
| 847 |
+
if {($thedir eq "*") && ($thefile eq "pkgIndex.tcl")} {
|
| 848 |
+
set mapped 0
|
| 849 |
+
foreach d [glob -directory [TranslatePath $child $virtualdir] \
|
| 850 |
+
-types d -tails *] {
|
| 851 |
+
catch {
|
| 852 |
+
DirInAccessPath $child \
|
| 853 |
+
[TranslatePath $child [file join $virtualdir $d]]
|
| 854 |
+
lappend cmd [file join $d $thefile]
|
| 855 |
+
set mapped 1
|
| 856 |
+
}
|
| 857 |
+
}
|
| 858 |
+
if {$mapped} continue
|
| 859 |
+
# Don't [continue] if */pkgIndex.tcl has no matches in the access
|
| 860 |
+
# path. The pattern will now receive the same treatment as a
|
| 861 |
+
# "non-special" pattern (and will fail because it includes a "*" in
|
| 862 |
+
# the directory name).
|
| 863 |
+
}
|
| 864 |
+
# Any directory pattern that is not an exact (i.e. non-glob) match to a
|
| 865 |
+
# directory in the access path will be rejected here.
|
| 866 |
+
# - Rejections include any directory pattern that has glob matching
|
| 867 |
+
# patterns "*", "?", backslashes, braces or square brackets, (UNLESS
|
| 868 |
+
# it corresponds to a genuine directory name AND that directory is in
|
| 869 |
+
# the access path).
|
| 870 |
+
# - The only "special matching characters" that remain in patterns for
|
| 871 |
+
# processing by glob are in the filename tail.
|
| 872 |
+
# - [file join $anything ~${foo}] is ~${foo}, which is not an exact
|
| 873 |
+
# match to any directory in the access path. Hence directory patterns
|
| 874 |
+
# that begin with "~" are rejected here. Tests safe-16.[5-8] check
|
| 875 |
+
# that "file join" remains as required and does not expand ~${foo}.
|
| 876 |
+
# - Bug [3529949] relates to unwanted expansion of ~${foo} and this is
|
| 877 |
+
# how the present code avoids the bug. All tests safe-16.* relate.
|
| 878 |
+
try {
|
| 879 |
+
DirInAccessPath $child [TranslatePath $child \
|
| 880 |
+
[file join $virtualdir $thedir]]
|
| 881 |
+
} on error msg {
|
| 882 |
+
Log $child $msg
|
| 883 |
+
if {$got(-nocomplain)} continue
|
| 884 |
+
return -code error "permission denied"
|
| 885 |
+
}
|
| 886 |
+
lappend cmd $opt
|
| 887 |
+
}
|
| 888 |
+
|
| 889 |
+
Log $child "GLOB = $cmd" NOTICE
|
| 890 |
+
|
| 891 |
+
if {$got(-nocomplain) && [llength $cmd] eq $firstPattern} {
|
| 892 |
+
return
|
| 893 |
+
}
|
| 894 |
+
try {
|
| 895 |
+
# >>>>>>>>>> HERE'S THE CALL TO SAFE INTERP GLOB <<<<<<<<<<
|
| 896 |
+
# - Pattern arguments added to cmd have NOT been translated from tokens.
|
| 897 |
+
# Only the virtualdir is translated (to dir).
|
| 898 |
+
# - In the pkgIndex.tcl case, there is no "*" in the pattern arguments,
|
| 899 |
+
# which are a list of names each with tail pkgIndex.tcl. The purpose
|
| 900 |
+
# of the call to glob is to remove the names for which the file does
|
| 901 |
+
# not exist.
|
| 902 |
+
set entries [::interp invokehidden $child glob {*}$cmd]
|
| 903 |
+
} on error msg {
|
| 904 |
+
# This is the only place that a call with -nocomplain and no invalid
|
| 905 |
+
# "dash-options" can return an error.
|
| 906 |
+
Log $child $msg
|
| 907 |
+
return -code error "script error"
|
| 908 |
+
}
|
| 909 |
+
|
| 910 |
+
Log $child "GLOB < $entries" NOTICE
|
| 911 |
+
|
| 912 |
+
# Translate path back to what the child should see.
|
| 913 |
+
set res {}
|
| 914 |
+
set l [string length $dir]
|
| 915 |
+
foreach p $entries {
|
| 916 |
+
if {[string equal -length $l $dir $p]} {
|
| 917 |
+
set p [string replace $p 0 [expr {$l-1}] $virtualdir]
|
| 918 |
+
}
|
| 919 |
+
lappend res $p
|
| 920 |
+
}
|
| 921 |
+
|
| 922 |
+
Log $child "GLOB > $res" NOTICE
|
| 923 |
+
return $res
|
| 924 |
+
}
|
| 925 |
+
|
| 926 |
+
# AliasSource is the target of the "source" alias in safe interpreters.
|
| 927 |
+
|
| 928 |
+
proc ::safe::AliasSource {child args} {
|
| 929 |
+
set argc [llength $args]
|
| 930 |
+
# Extended for handling of Tcl Modules to allow not only "source
|
| 931 |
+
# filename", but "source -encoding E filename" as well.
|
| 932 |
+
if {[lindex $args 0] eq "-encoding"} {
|
| 933 |
+
incr argc -2
|
| 934 |
+
set encoding [lindex $args 1]
|
| 935 |
+
set at 2
|
| 936 |
+
if {$encoding eq "identity"} {
|
| 937 |
+
Log $child "attempt to use the identity encoding"
|
| 938 |
+
return -code error "permission denied"
|
| 939 |
+
}
|
| 940 |
+
} else {
|
| 941 |
+
set at 0
|
| 942 |
+
set encoding {}
|
| 943 |
+
}
|
| 944 |
+
if {$argc != 1} {
|
| 945 |
+
set msg "wrong # args: should be \"source ?-encoding E? fileName\""
|
| 946 |
+
Log $child "$msg ($args)"
|
| 947 |
+
return -code error $msg
|
| 948 |
+
}
|
| 949 |
+
set file [lindex $args $at]
|
| 950 |
+
|
| 951 |
+
# get the real path from the virtual one.
|
| 952 |
+
if {[catch {
|
| 953 |
+
set realfile [TranslatePath $child $file]
|
| 954 |
+
} msg]} {
|
| 955 |
+
Log $child $msg
|
| 956 |
+
return -code error "permission denied"
|
| 957 |
+
}
|
| 958 |
+
|
| 959 |
+
# check that the path is in the access path of that child
|
| 960 |
+
if {[catch {
|
| 961 |
+
FileInAccessPath $child $realfile
|
| 962 |
+
} msg]} {
|
| 963 |
+
Log $child $msg
|
| 964 |
+
return -code error "permission denied"
|
| 965 |
+
}
|
| 966 |
+
|
| 967 |
+
# Check that the filename exists and is readable. If it is not, deliver
|
| 968 |
+
# this -errorcode so that caller in tclPkgUnknown does not write a message
|
| 969 |
+
# to tclLog. Has no effect on other callers of ::source, which are in
|
| 970 |
+
# "package ifneeded" scripts.
|
| 971 |
+
if {[catch {
|
| 972 |
+
CheckFileName $child $realfile
|
| 973 |
+
} msg]} {
|
| 974 |
+
Log $child "$realfile:$msg"
|
| 975 |
+
return -code error -errorcode {POSIX EACCES} $msg
|
| 976 |
+
}
|
| 977 |
+
|
| 978 |
+
# Passed all the tests, lets source it. Note that we do this all manually
|
| 979 |
+
# because we want to control [info script] in the child so information
|
| 980 |
+
# doesn't leak so much. [Bug 2913625]
|
| 981 |
+
set old [::interp eval $child {info script}]
|
| 982 |
+
set replacementMsg "script error"
|
| 983 |
+
set code [catch {
|
| 984 |
+
set f [open $realfile]
|
| 985 |
+
fconfigure $f -eofchar "\x1A {}"
|
| 986 |
+
if {$encoding ne ""} {
|
| 987 |
+
fconfigure $f -encoding $encoding
|
| 988 |
+
}
|
| 989 |
+
set contents [read $f]
|
| 990 |
+
close $f
|
| 991 |
+
::interp eval $child [list info script $file]
|
| 992 |
+
} msg opt]
|
| 993 |
+
if {$code == 0} {
|
| 994 |
+
set code [catch {::interp eval $child $contents} msg opt]
|
| 995 |
+
set replacementMsg $msg
|
| 996 |
+
}
|
| 997 |
+
catch {interp eval $child [list info script $old]}
|
| 998 |
+
# Note that all non-errors are fine result codes from [source], so we must
|
| 999 |
+
# take a little care to do it properly. [Bug 2923613]
|
| 1000 |
+
if {$code == 1} {
|
| 1001 |
+
Log $child $msg
|
| 1002 |
+
return -code error $replacementMsg
|
| 1003 |
+
}
|
| 1004 |
+
return -code $code -options $opt $msg
|
| 1005 |
+
}
|
| 1006 |
+
|
| 1007 |
+
# AliasLoad is the target of the "load" alias in safe interpreters.
|
| 1008 |
+
|
| 1009 |
+
proc ::safe::AliasLoad {child file args} {
|
| 1010 |
+
set argc [llength $args]
|
| 1011 |
+
if {$argc > 2} {
|
| 1012 |
+
set msg "load error: too many arguments"
|
| 1013 |
+
Log $child "$msg ($argc) {$file $args}"
|
| 1014 |
+
return -code error $msg
|
| 1015 |
+
}
|
| 1016 |
+
|
| 1017 |
+
# package name (can be empty if file is not).
|
| 1018 |
+
set package [lindex $args 0]
|
| 1019 |
+
|
| 1020 |
+
namespace upvar ::safe [VarName $child] state
|
| 1021 |
+
|
| 1022 |
+
# Determine where to load. load use a relative interp path and {}
|
| 1023 |
+
# means self, so we can directly and safely use passed arg.
|
| 1024 |
+
set target [lindex $args 1]
|
| 1025 |
+
if {$target ne ""} {
|
| 1026 |
+
# we will try to load into a sub sub interp; check that we want to
|
| 1027 |
+
# authorize that.
|
| 1028 |
+
if {!$state(nestedok)} {
|
| 1029 |
+
Log $child "loading to a sub interp (nestedok)\
|
| 1030 |
+
disabled (trying to load $package to $target)"
|
| 1031 |
+
return -code error "permission denied (nested load)"
|
| 1032 |
+
}
|
| 1033 |
+
}
|
| 1034 |
+
|
| 1035 |
+
# Determine what kind of load is requested
|
| 1036 |
+
if {$file eq ""} {
|
| 1037 |
+
# static package loading
|
| 1038 |
+
if {$package eq ""} {
|
| 1039 |
+
set msg "load error: empty filename and no package name"
|
| 1040 |
+
Log $child $msg
|
| 1041 |
+
return -code error $msg
|
| 1042 |
+
}
|
| 1043 |
+
if {!$state(staticsok)} {
|
| 1044 |
+
Log $child "static packages loading disabled\
|
| 1045 |
+
(trying to load $package to $target)"
|
| 1046 |
+
return -code error "permission denied (static package)"
|
| 1047 |
+
}
|
| 1048 |
+
} else {
|
| 1049 |
+
# file loading
|
| 1050 |
+
|
| 1051 |
+
# get the real path from the virtual one.
|
| 1052 |
+
try {
|
| 1053 |
+
set file [TranslatePath $child $file]
|
| 1054 |
+
} on error msg {
|
| 1055 |
+
Log $child $msg
|
| 1056 |
+
return -code error "permission denied"
|
| 1057 |
+
}
|
| 1058 |
+
|
| 1059 |
+
# check the translated path
|
| 1060 |
+
try {
|
| 1061 |
+
FileInAccessPath $child $file
|
| 1062 |
+
} on error msg {
|
| 1063 |
+
Log $child $msg
|
| 1064 |
+
return -code error "permission denied (path)"
|
| 1065 |
+
}
|
| 1066 |
+
}
|
| 1067 |
+
|
| 1068 |
+
try {
|
| 1069 |
+
return [::interp invokehidden $child load $file $package $target]
|
| 1070 |
+
} on error msg {
|
| 1071 |
+
# Some packages return no error message.
|
| 1072 |
+
set msg0 "load of binary library for package $package failed"
|
| 1073 |
+
if {$msg eq {}} {
|
| 1074 |
+
set msg $msg0
|
| 1075 |
+
} else {
|
| 1076 |
+
set msg "$msg0: $msg"
|
| 1077 |
+
}
|
| 1078 |
+
Log $child $msg
|
| 1079 |
+
return -code error $msg
|
| 1080 |
+
}
|
| 1081 |
+
}
|
| 1082 |
+
|
| 1083 |
+
# FileInAccessPath raises an error if the file is not found in the list of
|
| 1084 |
+
# directories contained in the (parent side recorded) child's access path.
|
| 1085 |
+
|
| 1086 |
+
# the security here relies on "file dirname" answering the proper
|
| 1087 |
+
# result... needs checking ?
|
| 1088 |
+
proc ::safe::FileInAccessPath {child file} {
|
| 1089 |
+
namespace upvar ::safe [VarName $child] state
|
| 1090 |
+
set access_path $state(access_path)
|
| 1091 |
+
|
| 1092 |
+
if {[file isdirectory $file]} {
|
| 1093 |
+
return -code error "\"$file\": is a directory"
|
| 1094 |
+
}
|
| 1095 |
+
set parent [file dirname $file]
|
| 1096 |
+
|
| 1097 |
+
# Normalize paths for comparison since lsearch knows nothing of
|
| 1098 |
+
# potential pathname anomalies.
|
| 1099 |
+
set norm_parent [file normalize $parent]
|
| 1100 |
+
|
| 1101 |
+
namespace upvar ::safe [VarName $child] state
|
| 1102 |
+
if {$norm_parent ni $state(access_path,norm)} {
|
| 1103 |
+
return -code error "\"$file\": not in access_path"
|
| 1104 |
+
}
|
| 1105 |
+
}
|
| 1106 |
+
|
| 1107 |
+
proc ::safe::DirInAccessPath {child dir} {
|
| 1108 |
+
namespace upvar ::safe [VarName $child] state
|
| 1109 |
+
set access_path $state(access_path)
|
| 1110 |
+
|
| 1111 |
+
if {[file isfile $dir]} {
|
| 1112 |
+
return -code error "\"$dir\": is a file"
|
| 1113 |
+
}
|
| 1114 |
+
|
| 1115 |
+
# Normalize paths for comparison since lsearch knows nothing of
|
| 1116 |
+
# potential pathname anomalies.
|
| 1117 |
+
set norm_dir [file normalize $dir]
|
| 1118 |
+
|
| 1119 |
+
namespace upvar ::safe [VarName $child] state
|
| 1120 |
+
if {$norm_dir ni $state(access_path,norm)} {
|
| 1121 |
+
return -code error "\"$dir\": not in access_path"
|
| 1122 |
+
}
|
| 1123 |
+
}
|
| 1124 |
+
|
| 1125 |
+
# This procedure is used to report an attempt to use an unsafe member of an
|
| 1126 |
+
# ensemble command.
|
| 1127 |
+
|
| 1128 |
+
proc ::safe::BadSubcommand {child command subcommand args} {
|
| 1129 |
+
set msg "not allowed to invoke subcommand $subcommand of $command"
|
| 1130 |
+
Log $child $msg
|
| 1131 |
+
return -code error -errorcode {TCL SAFE SUBCOMMAND} $msg
|
| 1132 |
+
}
|
| 1133 |
+
|
| 1134 |
+
# AliasEncoding is the target of the "encoding" alias in safe interpreters.
|
| 1135 |
+
|
| 1136 |
+
proc ::safe::AliasEncoding {child option args} {
|
| 1137 |
+
# Note that [encoding dirs] is not supported in safe children at all
|
| 1138 |
+
set subcommands {convertfrom convertto names system}
|
| 1139 |
+
try {
|
| 1140 |
+
set option [tcl::prefix match -error [list -level 1 -errorcode \
|
| 1141 |
+
[list TCL LOOKUP INDEX option $option]] $subcommands $option]
|
| 1142 |
+
# Special case: [encoding system] ok, but [encoding system foo] not
|
| 1143 |
+
if {$option eq "system" && [llength $args]} {
|
| 1144 |
+
return -code error -errorcode {TCL WRONGARGS} \
|
| 1145 |
+
"wrong # args: should be \"encoding system\""
|
| 1146 |
+
}
|
| 1147 |
+
} on error {msg options} {
|
| 1148 |
+
Log $child $msg
|
| 1149 |
+
return -options $options $msg
|
| 1150 |
+
}
|
| 1151 |
+
tailcall ::interp invokehidden $child encoding $option {*}$args
|
| 1152 |
+
}
|
| 1153 |
+
|
| 1154 |
+
# Various minor hiding of platform features. [Bug 2913625]
|
| 1155 |
+
|
| 1156 |
+
proc ::safe::AliasExeName {child} {
|
| 1157 |
+
return ""
|
| 1158 |
+
}
|
| 1159 |
+
|
| 1160 |
+
# ------------------------------------------------------------------------------
|
| 1161 |
+
# Using Interpreter Names with Namespace Qualifiers
|
| 1162 |
+
# ------------------------------------------------------------------------------
|
| 1163 |
+
# (1) We wish to preserve compatibility with existing code, in which Safe Base
|
| 1164 |
+
# interpreter names have no namespace qualifiers.
|
| 1165 |
+
# (2) safe::interpCreate and the rest of the Safe Base previously could not
|
| 1166 |
+
# accept namespace qualifiers in an interpreter name.
|
| 1167 |
+
# (3) The interp command will accept namespace qualifiers in an interpreter
|
| 1168 |
+
# name, but accepts distinct interpreters that will have the same command
|
| 1169 |
+
# name (e.g. foo, ::foo, and :::foo) (bug 66c2e8c974).
|
| 1170 |
+
# (4) To satisfy these constraints, Safe Base interpreter names will be fully
|
| 1171 |
+
# qualified namespace names with no excess colons and with the leading "::"
|
| 1172 |
+
# omitted.
|
| 1173 |
+
# (5) Trailing "::" implies a namespace tail {}, which interp reads as {{}}.
|
| 1174 |
+
# Reject such names.
|
| 1175 |
+
# (6) We could:
|
| 1176 |
+
# (a) EITHER reject usable but non-compliant names (e.g. excess colons) in
|
| 1177 |
+
# interpCreate, interpInit;
|
| 1178 |
+
# (b) OR accept such names and then translate to a compliant name in every
|
| 1179 |
+
# command.
|
| 1180 |
+
# The problem with (b) is that the user will expect to use the name with the
|
| 1181 |
+
# interp command and will find that it is not recognised.
|
| 1182 |
+
# E.g "interpCreate ::foo" creates interpreter "foo", and the user's name
|
| 1183 |
+
# "::foo" works with all the Safe Base commands, but "interp eval ::foo"
|
| 1184 |
+
# fails.
|
| 1185 |
+
# So we choose (a).
|
| 1186 |
+
# (7) The command
|
| 1187 |
+
# namespace upvar ::safe S$child state
|
| 1188 |
+
# becomes
|
| 1189 |
+
# namespace upvar ::safe [VarName $child] state
|
| 1190 |
+
# ------------------------------------------------------------------------------
|
| 1191 |
+
|
| 1192 |
+
proc ::safe::RejectExcessColons {child} {
|
| 1193 |
+
set stripped [regsub -all -- {:::*} $child ::]
|
| 1194 |
+
if {[string range $stripped end-1 end] eq {::}} {
|
| 1195 |
+
return -code error {interpreter name must not end in "::"}
|
| 1196 |
+
}
|
| 1197 |
+
if {$stripped ne $child} {
|
| 1198 |
+
set msg {interpreter name has excess colons in namespace separators}
|
| 1199 |
+
return -code error $msg
|
| 1200 |
+
}
|
| 1201 |
+
if {[string range $stripped 0 1] eq {::}} {
|
| 1202 |
+
return -code error {interpreter name must not begin "::"}
|
| 1203 |
+
}
|
| 1204 |
+
return
|
| 1205 |
+
}
|
| 1206 |
+
|
| 1207 |
+
proc ::safe::VarName {child} {
|
| 1208 |
+
# return S$child
|
| 1209 |
+
return S[string map {:: @N @ @A} $child]
|
| 1210 |
+
}
|
| 1211 |
+
|
| 1212 |
+
proc ::safe::Setup {} {
|
| 1213 |
+
####
|
| 1214 |
+
#
|
| 1215 |
+
# Setup the arguments parsing
|
| 1216 |
+
#
|
| 1217 |
+
####
|
| 1218 |
+
|
| 1219 |
+
# Share the descriptions
|
| 1220 |
+
set temp [::tcl::OptKeyRegister {
|
| 1221 |
+
{-accessPath -list {} "access path for the slave"}
|
| 1222 |
+
{-noStatics "prevent loading of statically linked pkgs"}
|
| 1223 |
+
{-statics true "loading of statically linked pkgs"}
|
| 1224 |
+
{-nestedLoadOk "allow nested loading"}
|
| 1225 |
+
{-nested false "nested loading"}
|
| 1226 |
+
{-deleteHook -script {} "delete hook"}
|
| 1227 |
+
}]
|
| 1228 |
+
|
| 1229 |
+
# create case (slave is optional)
|
| 1230 |
+
::tcl::OptKeyRegister {
|
| 1231 |
+
{?slave? -name {} "name of the slave (optional)"}
|
| 1232 |
+
} ::safe::interpCreate
|
| 1233 |
+
|
| 1234 |
+
# adding the flags sub programs to the command program (relying on Opt's
|
| 1235 |
+
# internal implementation details)
|
| 1236 |
+
lappend ::tcl::OptDesc(::safe::interpCreate) $::tcl::OptDesc($temp)
|
| 1237 |
+
|
| 1238 |
+
# init and configure (slave is needed)
|
| 1239 |
+
::tcl::OptKeyRegister {
|
| 1240 |
+
{slave -name {} "name of the slave"}
|
| 1241 |
+
} ::safe::interpIC
|
| 1242 |
+
|
| 1243 |
+
# adding the flags sub programs to the command program (relying on Opt's
|
| 1244 |
+
# internal implementation details)
|
| 1245 |
+
lappend ::tcl::OptDesc(::safe::interpIC) $::tcl::OptDesc($temp)
|
| 1246 |
+
|
| 1247 |
+
# temp not needed anymore
|
| 1248 |
+
::tcl::OptKeyDelete $temp
|
| 1249 |
+
|
| 1250 |
+
####
|
| 1251 |
+
#
|
| 1252 |
+
# Default: No logging.
|
| 1253 |
+
#
|
| 1254 |
+
####
|
| 1255 |
+
|
| 1256 |
+
setLogCmd {}
|
| 1257 |
+
|
| 1258 |
+
# Log eventually.
|
| 1259 |
+
# To enable error logging, set Log to {puts stderr} for instance,
|
| 1260 |
+
# via setLogCmd.
|
| 1261 |
+
return
|
| 1262 |
+
}
|
| 1263 |
+
|
| 1264 |
+
namespace eval ::safe {
|
| 1265 |
+
# internal variables
|
| 1266 |
+
|
| 1267 |
+
# Log command, set via 'setLogCmd'. Logging is disabled when empty.
|
| 1268 |
+
variable Log {}
|
| 1269 |
+
|
| 1270 |
+
# The package maintains a state array per child interp under its
|
| 1271 |
+
# control. The name of this array is S<interp-name>. This array is
|
| 1272 |
+
# brought into scope where needed, using 'namespace upvar'. The S
|
| 1273 |
+
# prefix is used to avoid that a child interp called "Log" smashes
|
| 1274 |
+
# the "Log" variable.
|
| 1275 |
+
#
|
| 1276 |
+
# The array's elements are:
|
| 1277 |
+
#
|
| 1278 |
+
# access_path : List of paths accessible to the child.
|
| 1279 |
+
# access_path,norm : Ditto, in normalized form.
|
| 1280 |
+
# access_path,slave : Ditto, as the path tokens as seen by the child.
|
| 1281 |
+
# access_path,map : dict ( token -> path )
|
| 1282 |
+
# access_path,remap : dict ( path -> token )
|
| 1283 |
+
# tm_path_slave : List of TM root directories, as tokens seen by the child.
|
| 1284 |
+
# staticsok : Value of option -statics
|
| 1285 |
+
# nestedok : Value of option -nested
|
| 1286 |
+
# cleanupHook : Value of option -deleteHook
|
| 1287 |
+
}
|
| 1288 |
+
|
| 1289 |
+
::safe::Setup
|
mplug_owl2/lib/tcl8.6/tclIndex
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Tcl autoload index file, version 2.0
|
| 2 |
+
# -*- tcl -*-
|
| 3 |
+
# This file is generated by the "auto_mkindex" command
|
| 4 |
+
# and sourced to set up indexing information for one or
|
| 5 |
+
# more commands. Typically each line is a command that
|
| 6 |
+
# sets an element in the auto_index array, where the
|
| 7 |
+
# element name is the name of a command and the value is
|
| 8 |
+
# a script that loads the command.
|
| 9 |
+
|
| 10 |
+
set auto_index(auto_reset) [list source [file join $dir auto.tcl]]
|
| 11 |
+
set auto_index(tcl_findLibrary) [list source [file join $dir auto.tcl]]
|
| 12 |
+
set auto_index(auto_mkindex) [list source [file join $dir auto.tcl]]
|
| 13 |
+
set auto_index(auto_mkindex_old) [list source [file join $dir auto.tcl]]
|
| 14 |
+
set auto_index(::auto_mkindex_parser::init) [list source [file join $dir auto.tcl]]
|
| 15 |
+
set auto_index(::auto_mkindex_parser::cleanup) [list source [file join $dir auto.tcl]]
|
| 16 |
+
set auto_index(::auto_mkindex_parser::mkindex) [list source [file join $dir auto.tcl]]
|
| 17 |
+
set auto_index(::auto_mkindex_parser::hook) [list source [file join $dir auto.tcl]]
|
| 18 |
+
set auto_index(::auto_mkindex_parser::slavehook) [list source [file join $dir auto.tcl]]
|
| 19 |
+
set auto_index(::auto_mkindex_parser::command) [list source [file join $dir auto.tcl]]
|
| 20 |
+
set auto_index(::auto_mkindex_parser::commandInit) [list source [file join $dir auto.tcl]]
|
| 21 |
+
set auto_index(::auto_mkindex_parser::fullname) [list source [file join $dir auto.tcl]]
|
| 22 |
+
set auto_index(history) [list source [file join $dir history.tcl]]
|
| 23 |
+
set auto_index(::tcl::history) [list source [file join $dir history.tcl]]
|
| 24 |
+
set auto_index(::tcl::HistAdd) [list source [file join $dir history.tcl]]
|
| 25 |
+
set auto_index(::tcl::HistKeep) [list source [file join $dir history.tcl]]
|
| 26 |
+
set auto_index(::tcl::HistClear) [list source [file join $dir history.tcl]]
|
| 27 |
+
set auto_index(::tcl::HistInfo) [list source [file join $dir history.tcl]]
|
| 28 |
+
set auto_index(::tcl::HistRedo) [list source [file join $dir history.tcl]]
|
| 29 |
+
set auto_index(::tcl::HistIndex) [list source [file join $dir history.tcl]]
|
| 30 |
+
set auto_index(::tcl::HistEvent) [list source [file join $dir history.tcl]]
|
| 31 |
+
set auto_index(::tcl::HistChange) [list source [file join $dir history.tcl]]
|
| 32 |
+
set auto_index(pkg_mkIndex) [list source [file join $dir package.tcl]]
|
| 33 |
+
set auto_index(tclPkgSetup) [list source [file join $dir package.tcl]]
|
| 34 |
+
set auto_index(tclPkgUnknown) [list source [file join $dir package.tcl]]
|
| 35 |
+
set auto_index(::tcl::MacOSXPkgUnknown) [list source [file join $dir package.tcl]]
|
| 36 |
+
set auto_index(::pkg::create) [list source [file join $dir package.tcl]]
|
| 37 |
+
set auto_index(parray) [list source [file join $dir parray.tcl]]
|
| 38 |
+
set auto_index(::safe::InterpStatics) [list source [file join $dir safe.tcl]]
|
| 39 |
+
set auto_index(::safe::InterpNested) [list source [file join $dir safe.tcl]]
|
| 40 |
+
set auto_index(::safe::interpCreate) [list source [file join $dir safe.tcl]]
|
| 41 |
+
set auto_index(::safe::interpInit) [list source [file join $dir safe.tcl]]
|
| 42 |
+
set auto_index(::safe::CheckInterp) [list source [file join $dir safe.tcl]]
|
| 43 |
+
set auto_index(::safe::interpConfigure) [list source [file join $dir safe.tcl]]
|
| 44 |
+
set auto_index(::safe::InterpCreate) [list source [file join $dir safe.tcl]]
|
| 45 |
+
set auto_index(::safe::InterpSetConfig) [list source [file join $dir safe.tcl]]
|
| 46 |
+
set auto_index(::safe::interpFindInAccessPath) [list source [file join $dir safe.tcl]]
|
| 47 |
+
set auto_index(::safe::interpAddToAccessPath) [list source [file join $dir safe.tcl]]
|
| 48 |
+
set auto_index(::safe::InterpInit) [list source [file join $dir safe.tcl]]
|
| 49 |
+
set auto_index(::safe::AddSubDirs) [list source [file join $dir safe.tcl]]
|
| 50 |
+
set auto_index(::safe::interpDelete) [list source [file join $dir safe.tcl]]
|
| 51 |
+
set auto_index(::safe::setLogCmd) [list source [file join $dir safe.tcl]]
|
| 52 |
+
set auto_index(::safe::SyncAccessPath) [list source [file join $dir safe.tcl]]
|
| 53 |
+
set auto_index(::safe::PathToken) [list source [file join $dir safe.tcl]]
|
| 54 |
+
set auto_index(::safe::TranslatePath) [list source [file join $dir safe.tcl]]
|
| 55 |
+
set auto_index(::safe::Log) [list source [file join $dir safe.tcl]]
|
| 56 |
+
set auto_index(::safe::CheckFileName) [list source [file join $dir safe.tcl]]
|
| 57 |
+
set auto_index(::safe::AliasGlob) [list source [file join $dir safe.tcl]]
|
| 58 |
+
set auto_index(::safe::AliasSource) [list source [file join $dir safe.tcl]]
|
| 59 |
+
set auto_index(::safe::AliasLoad) [list source [file join $dir safe.tcl]]
|
| 60 |
+
set auto_index(::safe::FileInAccessPath) [list source [file join $dir safe.tcl]]
|
| 61 |
+
set auto_index(::safe::DirInAccessPath) [list source [file join $dir safe.tcl]]
|
| 62 |
+
set auto_index(::safe::Subset) [list source [file join $dir safe.tcl]]
|
| 63 |
+
set auto_index(::safe::AliasSubset) [list source [file join $dir safe.tcl]]
|
| 64 |
+
set auto_index(::safe::AliasEncoding) [list source [file join $dir safe.tcl]]
|
| 65 |
+
set auto_index(tcl_wordBreakAfter) [list source [file join $dir word.tcl]]
|
| 66 |
+
set auto_index(tcl_wordBreakBefore) [list source [file join $dir word.tcl]]
|
| 67 |
+
set auto_index(tcl_endOfWord) [list source [file join $dir word.tcl]]
|
| 68 |
+
set auto_index(tcl_startOfNextWord) [list source [file join $dir word.tcl]]
|
| 69 |
+
set auto_index(tcl_startOfPreviousWord) [list source [file join $dir word.tcl]]
|
| 70 |
+
set auto_index(::tcl::tm::add) [list source [file join $dir tm.tcl]]
|
| 71 |
+
set auto_index(::tcl::tm::remove) [list source [file join $dir tm.tcl]]
|
| 72 |
+
set auto_index(::tcl::tm::list) [list source [file join $dir tm.tcl]]
|
| 73 |
+
set auto_index(::tcl::tm::Defaults) [list source [file join $dir tm.tcl]]
|
| 74 |
+
set auto_index(::tcl::tm::UnknownHandler) [list source [file join $dir tm.tcl]]
|
| 75 |
+
set auto_index(::tcl::tm::roots) [list source [file join $dir tm.tcl]]
|
| 76 |
+
set auto_index(::tcl::tm::path) [list source [file join $dir tm.tcl]]
|
| 77 |
+
if {[namespace exists ::tcl::unsupported]} {
|
| 78 |
+
set auto_index(timerate) {namespace import ::tcl::unsupported::timerate}
|
| 79 |
+
}
|
mplug_owl2/lib/tcl8.6/word.tcl
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# word.tcl --
|
| 2 |
+
#
|
| 3 |
+
# This file defines various procedures for computing word boundaries in
|
| 4 |
+
# strings. This file is primarily needed so Tk text and entry widgets behave
|
| 5 |
+
# properly for different platforms.
|
| 6 |
+
#
|
| 7 |
+
# Copyright (c) 1996 Sun Microsystems, Inc.
|
| 8 |
+
# Copyright (c) 1998 Scriptics Corporation.
|
| 9 |
+
#
|
| 10 |
+
# See the file "license.terms" for information on usage and redistribution
|
| 11 |
+
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
| 12 |
+
|
| 13 |
+
# The following variables are used to determine which characters are
|
| 14 |
+
# interpreted as white space.
|
| 15 |
+
|
| 16 |
+
if {$::tcl_platform(platform) eq "windows"} {
|
| 17 |
+
# Windows style - any but a Unicode space char
|
| 18 |
+
if {![info exists ::tcl_wordchars]} {
|
| 19 |
+
set ::tcl_wordchars {\S}
|
| 20 |
+
}
|
| 21 |
+
if {![info exists ::tcl_nonwordchars]} {
|
| 22 |
+
set ::tcl_nonwordchars {\s}
|
| 23 |
+
}
|
| 24 |
+
} else {
|
| 25 |
+
# Motif style - any Unicode word char (number, letter, or underscore)
|
| 26 |
+
if {![info exists ::tcl_wordchars]} {
|
| 27 |
+
set ::tcl_wordchars {\w}
|
| 28 |
+
}
|
| 29 |
+
if {![info exists ::tcl_nonwordchars]} {
|
| 30 |
+
set ::tcl_nonwordchars {\W}
|
| 31 |
+
}
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
# Arrange for caches of the real matcher REs to be kept, which enables the REs
|
| 35 |
+
# themselves to be cached for greater performance (and somewhat greater
|
| 36 |
+
# clarity too).
|
| 37 |
+
|
| 38 |
+
namespace eval ::tcl {
|
| 39 |
+
variable WordBreakRE
|
| 40 |
+
array set WordBreakRE {}
|
| 41 |
+
|
| 42 |
+
proc UpdateWordBreakREs args {
|
| 43 |
+
# Ignores the arguments
|
| 44 |
+
global tcl_wordchars tcl_nonwordchars
|
| 45 |
+
variable WordBreakRE
|
| 46 |
+
|
| 47 |
+
# To keep the RE strings short...
|
| 48 |
+
set letter $tcl_wordchars
|
| 49 |
+
set space $tcl_nonwordchars
|
| 50 |
+
|
| 51 |
+
set WordBreakRE(after) "$letter$space|$space$letter"
|
| 52 |
+
set WordBreakRE(before) "^.*($letter$space|$space$letter)"
|
| 53 |
+
set WordBreakRE(end) "$space*$letter+$space"
|
| 54 |
+
set WordBreakRE(next) "$letter*$space+$letter"
|
| 55 |
+
set WordBreakRE(previous) "$space*($letter+)$space*\$"
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
# Initialize the cache
|
| 59 |
+
UpdateWordBreakREs
|
| 60 |
+
trace add variable ::tcl_wordchars write ::tcl::UpdateWordBreakREs
|
| 61 |
+
trace add variable ::tcl_nonwordchars write ::tcl::UpdateWordBreakREs
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
# tcl_wordBreakAfter --
|
| 65 |
+
#
|
| 66 |
+
# This procedure returns the index of the first word boundary after the
|
| 67 |
+
# starting point in the given string, or -1 if there are no more boundaries in
|
| 68 |
+
# the given string. The index returned refers to the first character of the
|
| 69 |
+
# pair that comprises a boundary.
|
| 70 |
+
#
|
| 71 |
+
# Arguments:
|
| 72 |
+
# str - String to search.
|
| 73 |
+
# start - Index into string specifying starting point.
|
| 74 |
+
|
| 75 |
+
proc tcl_wordBreakAfter {str start} {
|
| 76 |
+
variable ::tcl::WordBreakRE
|
| 77 |
+
set result {-1 -1}
|
| 78 |
+
regexp -indices -start $start -- $WordBreakRE(after) $str result
|
| 79 |
+
return [lindex $result 1]
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
# tcl_wordBreakBefore --
|
| 83 |
+
#
|
| 84 |
+
# This procedure returns the index of the first word boundary before the
|
| 85 |
+
# starting point in the given string, or -1 if there are no more boundaries in
|
| 86 |
+
# the given string. The index returned refers to the second character of the
|
| 87 |
+
# pair that comprises a boundary.
|
| 88 |
+
#
|
| 89 |
+
# Arguments:
|
| 90 |
+
# str - String to search.
|
| 91 |
+
# start - Index into string specifying starting point.
|
| 92 |
+
|
| 93 |
+
proc tcl_wordBreakBefore {str start} {
|
| 94 |
+
variable ::tcl::WordBreakRE
|
| 95 |
+
set result {-1 -1}
|
| 96 |
+
regexp -indices -- $WordBreakRE(before) [string range $str 0 $start] result
|
| 97 |
+
return [lindex $result 1]
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
# tcl_endOfWord --
|
| 101 |
+
#
|
| 102 |
+
# This procedure returns the index of the first end-of-word location after a
|
| 103 |
+
# starting index in the given string. An end-of-word location is defined to be
|
| 104 |
+
# the first whitespace character following the first non-whitespace character
|
| 105 |
+
# after the starting point. Returns -1 if there are no more words after the
|
| 106 |
+
# starting point.
|
| 107 |
+
#
|
| 108 |
+
# Arguments:
|
| 109 |
+
# str - String to search.
|
| 110 |
+
# start - Index into string specifying starting point.
|
| 111 |
+
|
| 112 |
+
proc tcl_endOfWord {str start} {
|
| 113 |
+
variable ::tcl::WordBreakRE
|
| 114 |
+
set result {-1 -1}
|
| 115 |
+
regexp -indices -start $start -- $WordBreakRE(end) $str result
|
| 116 |
+
return [lindex $result 1]
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
# tcl_startOfNextWord --
|
| 120 |
+
#
|
| 121 |
+
# This procedure returns the index of the first start-of-word location after a
|
| 122 |
+
# starting index in the given string. A start-of-word location is defined to
|
| 123 |
+
# be a non-whitespace character following a whitespace character. Returns -1
|
| 124 |
+
# if there are no more start-of-word locations after the starting point.
|
| 125 |
+
#
|
| 126 |
+
# Arguments:
|
| 127 |
+
# str - String to search.
|
| 128 |
+
# start - Index into string specifying starting point.
|
| 129 |
+
|
| 130 |
+
proc tcl_startOfNextWord {str start} {
|
| 131 |
+
variable ::tcl::WordBreakRE
|
| 132 |
+
set result {-1 -1}
|
| 133 |
+
regexp -indices -start $start -- $WordBreakRE(next) $str result
|
| 134 |
+
return [lindex $result 1]
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
# tcl_startOfPreviousWord --
|
| 138 |
+
#
|
| 139 |
+
# This procedure returns the index of the first start-of-word location before
|
| 140 |
+
# a starting index in the given string.
|
| 141 |
+
#
|
| 142 |
+
# Arguments:
|
| 143 |
+
# str - String to search.
|
| 144 |
+
# start - Index into string specifying starting point.
|
| 145 |
+
|
| 146 |
+
proc tcl_startOfPreviousWord {str start} {
|
| 147 |
+
variable ::tcl::WordBreakRE
|
| 148 |
+
set word {-1 -1}
|
| 149 |
+
if {$start > 0} {
|
| 150 |
+
regexp -indices -- $WordBreakRE(previous) [string range [string range $str 0 $start] 0 end-1] \
|
| 151 |
+
result word
|
| 152 |
+
}
|
| 153 |
+
return [lindex $word 0]
|
| 154 |
+
}
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/ATenCUDAGeneral.h
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <cuda.h>
|
| 4 |
+
#include <cuda_runtime.h>
|
| 5 |
+
#include <cuda_fp16.h>
|
| 6 |
+
|
| 7 |
+
#include <c10/macros/Export.h>
|
| 8 |
+
|
| 9 |
+
// Use TORCH_CUDA_CPP_API or TORCH_CUDA_CU_API for exports from this folder
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/ApplyGridUtils.cuh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include <ATen/cuda/CUDAContext.h>
|
| 2 |
+
|
| 3 |
+
#include <cuda_runtime.h>
|
| 4 |
+
|
| 5 |
+
namespace at::cuda {
|
| 6 |
+
|
| 7 |
+
/**
|
| 8 |
+
Computes ceil(a / b)
|
| 9 |
+
*/
|
| 10 |
+
template <typename T>
|
| 11 |
+
__host__ __device__ __forceinline__ T ATenCeilDiv(T a, T b) {
|
| 12 |
+
return (a + b - 1) / b;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
namespace {
|
| 16 |
+
|
| 17 |
+
// Threads per block for our apply kernel
|
| 18 |
+
// FIXME: use occupancy calculator instead
|
| 19 |
+
constexpr uint32_t AT_APPLY_THREADS_PER_BLOCK = 512;
|
| 20 |
+
constexpr uint32_t AT_APPLY_BLOCKS_PER_SM = 4;
|
| 21 |
+
|
| 22 |
+
template <int step = 1>
|
| 23 |
+
inline bool getApplyGrid(uint64_t totalElements, dim3& grid, c10::DeviceIndex curDevice, int max_threads_per_block=AT_APPLY_THREADS_PER_BLOCK) {
|
| 24 |
+
if (curDevice == -1) return false;
|
| 25 |
+
uint64_t numel_per_thread = static_cast<uint64_t>(max_threads_per_block) * static_cast<uint64_t>(step);
|
| 26 |
+
uint64_t numBlocks = ATenCeilDiv(totalElements, numel_per_thread);
|
| 27 |
+
uint64_t maxGridX = at::cuda::getDeviceProperties(curDevice)->maxGridSize[0];
|
| 28 |
+
if (numBlocks > maxGridX)
|
| 29 |
+
numBlocks = maxGridX;
|
| 30 |
+
grid = dim3(numBlocks);
|
| 31 |
+
return true;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
constexpr int getApplyBlocksPerSM() {
|
| 35 |
+
return AT_APPLY_BLOCKS_PER_SM;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
constexpr int getApplyBlockSize() {
|
| 39 |
+
return AT_APPLY_THREADS_PER_BLOCK;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
inline dim3 getApplyBlock(int max_threads_per_block=AT_APPLY_THREADS_PER_BLOCK) {
|
| 43 |
+
return dim3(max_threads_per_block);
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
} // anonymous namespace
|
| 47 |
+
} // namespace at::cuda
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/Atomic.cuh
ADDED
|
@@ -0,0 +1,514 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <cuda.h>
|
| 4 |
+
#include <c10/util/Half.h>
|
| 5 |
+
#include <c10/util/BFloat16.h>
|
| 6 |
+
|
| 7 |
+
#include <ATen/NumericUtils.h>
|
| 8 |
+
|
| 9 |
+
#if !(defined(USE_ROCM) || ((defined(__CUDA_ARCH__) && (__CUDA_ARCH__ < 800))))
|
| 10 |
+
#include <cuda_bf16.h>
|
| 11 |
+
#endif
|
| 12 |
+
|
| 13 |
+
template <typename T>
|
| 14 |
+
struct AtomicFPOp;
|
| 15 |
+
|
| 16 |
+
template <>
|
| 17 |
+
struct AtomicFPOp<at::Half> {
|
| 18 |
+
template <typename func_t>
|
| 19 |
+
inline __device__ at::Half operator() (at::Half *address, at::Half val, const func_t& func) {
|
| 20 |
+
unsigned int * address_as_ui =
|
| 21 |
+
(unsigned int *) ((char *)address - ((size_t)address & 2));
|
| 22 |
+
unsigned int old = *address_as_ui;
|
| 23 |
+
unsigned int assumed;
|
| 24 |
+
|
| 25 |
+
at::Half hsum;
|
| 26 |
+
do {
|
| 27 |
+
assumed = old;
|
| 28 |
+
hsum.x = (size_t)address & 2 ? (old >> 16) : (old & 0xffff);
|
| 29 |
+
hsum = func(hsum, val);
|
| 30 |
+
old = (size_t)address & 2 ? (old & 0xffff) | (hsum.x << 16) : (old & 0xffff0000) | hsum.x;
|
| 31 |
+
old = atomicCAS(address_as_ui, assumed, old);
|
| 32 |
+
} while (assumed != old);
|
| 33 |
+
hsum.x = (size_t)address & 2 ? (old >> 16) : (old & 0xffff);
|
| 34 |
+
return hsum;
|
| 35 |
+
}
|
| 36 |
+
};
|
| 37 |
+
|
| 38 |
+
template <>
|
| 39 |
+
struct AtomicFPOp<at::BFloat16> {
|
| 40 |
+
template <typename func_t>
|
| 41 |
+
inline __device__ at::BFloat16 operator() (at::BFloat16 *address, at::BFloat16 val, const func_t& func) {
|
| 42 |
+
unsigned int * address_as_ui =
|
| 43 |
+
(unsigned int *) ((char *)address - ((size_t)address & 2));
|
| 44 |
+
unsigned int old = *address_as_ui;
|
| 45 |
+
unsigned int assumed;
|
| 46 |
+
|
| 47 |
+
at::BFloat16 bsum;
|
| 48 |
+
do {
|
| 49 |
+
assumed = old;
|
| 50 |
+
bsum.x = (size_t)address & 2 ? (old >> 16) : (old & 0xffff);
|
| 51 |
+
bsum = func(bsum, val);
|
| 52 |
+
old = (size_t)address & 2 ? (old & 0xffff) | (bsum.x << 16) : (old & 0xffff0000) | bsum.x;
|
| 53 |
+
old = atomicCAS(address_as_ui, assumed, old);
|
| 54 |
+
} while (assumed != old);
|
| 55 |
+
bsum.x = (size_t)address & 2 ? (old >> 16) : (old & 0xffff);
|
| 56 |
+
return bsum.x;
|
| 57 |
+
}
|
| 58 |
+
};
|
| 59 |
+
|
| 60 |
+
template <>
|
| 61 |
+
struct AtomicFPOp<double> {
|
| 62 |
+
template <typename func_t>
|
| 63 |
+
inline __device__ double operator() (double * address, double val, const func_t& func) {
|
| 64 |
+
unsigned long long int* address_as_ull = (unsigned long long int*)address;
|
| 65 |
+
unsigned long long int old = *address_as_ull;
|
| 66 |
+
unsigned long long int assumed;
|
| 67 |
+
|
| 68 |
+
do {
|
| 69 |
+
assumed = old;
|
| 70 |
+
old = atomicCAS(address_as_ull, assumed, func(val, assumed));
|
| 71 |
+
// Note: uses integer comparison to avoid hang in case of NaN (since NaN != NaN)
|
| 72 |
+
} while (assumed != old);
|
| 73 |
+
|
| 74 |
+
return __longlong_as_double(old);
|
| 75 |
+
}
|
| 76 |
+
};
|
| 77 |
+
|
| 78 |
+
#define ATOMIC_INTEGER_IMPL(NAME) \
|
| 79 |
+
template <typename T, size_t n> \
|
| 80 |
+
struct Atomic##NAME##IntegerImpl; \
|
| 81 |
+
\
|
| 82 |
+
template<typename T> \
|
| 83 |
+
struct Atomic##NAME##IntegerImpl<T, 1> { \
|
| 84 |
+
template <typename func_t> \
|
| 85 |
+
inline __device__ void operator()(T *address, T val, const func_t& func) { \
|
| 86 |
+
size_t offset = (size_t)address & 3; \
|
| 87 |
+
uint32_t * address_as_ui = (uint32_t *)((char *)address - offset); \
|
| 88 |
+
uint32_t old = *address_as_ui; \
|
| 89 |
+
uint32_t shift = offset * 8; \
|
| 90 |
+
uint32_t old_byte; \
|
| 91 |
+
uint32_t newval; \
|
| 92 |
+
uint32_t assumed; \
|
| 93 |
+
\
|
| 94 |
+
do { \
|
| 95 |
+
assumed = old; \
|
| 96 |
+
old_byte = (old >> shift) & 0xff; \
|
| 97 |
+
newval = static_cast<uint8_t>(func(val, static_cast<T>(old_byte))); \
|
| 98 |
+
newval = (old & ~(0x000000ff << shift)) | (newval << shift); \
|
| 99 |
+
old = atomicCAS(address_as_ui, assumed, newval); \
|
| 100 |
+
} while (assumed != old); \
|
| 101 |
+
} \
|
| 102 |
+
}; \
|
| 103 |
+
\
|
| 104 |
+
template<typename T> \
|
| 105 |
+
struct Atomic##NAME##IntegerImpl<T, 2> { \
|
| 106 |
+
template <typename func_t> \
|
| 107 |
+
inline __device__ void operator()(T *address, T val, const func_t& func) { \
|
| 108 |
+
size_t offset = (size_t)address & 2; \
|
| 109 |
+
uint32_t * address_as_ui = (uint32_t *)((char *)address - offset); \
|
| 110 |
+
bool is_32_align = offset; \
|
| 111 |
+
uint32_t old = *address_as_ui; \
|
| 112 |
+
uint32_t old_bytes; \
|
| 113 |
+
uint32_t newval; \
|
| 114 |
+
uint32_t assumed; \
|
| 115 |
+
\
|
| 116 |
+
do { \
|
| 117 |
+
assumed = old; \
|
| 118 |
+
old_bytes = is_32_align ? old >> 16 : old & 0xffff; \
|
| 119 |
+
newval = static_cast<uint16_t>(func(val, static_cast<T>(old_bytes))); \
|
| 120 |
+
newval = is_32_align ? (old & 0xffff) | (newval << 16) : (old & 0xffff0000) | newval; \
|
| 121 |
+
old = atomicCAS(address_as_ui, assumed, newval); \
|
| 122 |
+
} while (assumed != old); \
|
| 123 |
+
} \
|
| 124 |
+
}; \
|
| 125 |
+
\
|
| 126 |
+
template<typename T> \
|
| 127 |
+
struct Atomic##NAME##IntegerImpl<T, 4> { \
|
| 128 |
+
template <typename func_t> \
|
| 129 |
+
inline __device__ void operator()(T *address, T val, const func_t& func) { \
|
| 130 |
+
uint32_t * address_as_ui = (uint32_t *) (address); \
|
| 131 |
+
uint32_t old = *address_as_ui; \
|
| 132 |
+
uint32_t newval; \
|
| 133 |
+
uint32_t assumed; \
|
| 134 |
+
\
|
| 135 |
+
do { \
|
| 136 |
+
assumed = old; \
|
| 137 |
+
newval = static_cast<uint32_t>(func(val, static_cast<T>(old))); \
|
| 138 |
+
old = atomicCAS(address_as_ui, assumed, newval); \
|
| 139 |
+
} while (assumed != old); \
|
| 140 |
+
} \
|
| 141 |
+
}; \
|
| 142 |
+
\
|
| 143 |
+
template<typename T> \
|
| 144 |
+
struct Atomic##NAME##IntegerImpl<T, 8> { \
|
| 145 |
+
template <typename func_t> \
|
| 146 |
+
inline __device__ void operator()(T *address, T val, const func_t& func) { \
|
| 147 |
+
unsigned long long * address_as_ui = (unsigned long long *) (address); \
|
| 148 |
+
unsigned long long old = *address_as_ui; \
|
| 149 |
+
unsigned long long newval; \
|
| 150 |
+
unsigned long long assumed; \
|
| 151 |
+
\
|
| 152 |
+
do { \
|
| 153 |
+
assumed = old; \
|
| 154 |
+
newval = static_cast<uint64_t>(func(val, static_cast<T>(old))); \
|
| 155 |
+
old = atomicCAS(address_as_ui, assumed, newval); \
|
| 156 |
+
} while (assumed != old); \
|
| 157 |
+
} \
|
| 158 |
+
};
|
| 159 |
+
|
| 160 |
+
|
| 161 |
+
# define GPU_ATOMIC_INTEGER(NAME, OP, DTYPE) \
|
| 162 |
+
inline __device__ void gpuAtomic##NAME(DTYPE *address, DTYPE val) { \
|
| 163 |
+
Atomic##NAME##IntegerImpl<DTYPE, sizeof(DTYPE)>()(address, \
|
| 164 |
+
val, \
|
| 165 |
+
[](DTYPE a, DTYPE b) { \
|
| 166 |
+
return OP; \
|
| 167 |
+
}); \
|
| 168 |
+
} \
|
| 169 |
+
|
| 170 |
+
ATOMIC_INTEGER_IMPL(Add)
|
| 171 |
+
GPU_ATOMIC_INTEGER(Add, a || b, bool)
|
| 172 |
+
|
| 173 |
+
// Don't instantiate gpuAtomicAdd with the macro as it seems non-standard (see int32, int64)
|
| 174 |
+
inline __device__ void gpuAtomicAdd(uint8_t *address, uint8_t val) {
|
| 175 |
+
AtomicAddIntegerImpl<uint8_t, sizeof(uint8_t)>()(address,
|
| 176 |
+
val,
|
| 177 |
+
[](uint8_t a, uint8_t b) {
|
| 178 |
+
return a + b;
|
| 179 |
+
});
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
inline __device__ void gpuAtomicAdd(int8_t *address, int8_t val) {
|
| 183 |
+
AtomicAddIntegerImpl<int8_t, sizeof(int8_t)>()(address,
|
| 184 |
+
val,
|
| 185 |
+
[](int8_t a, int8_t b) {
|
| 186 |
+
return a + b;
|
| 187 |
+
});
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
inline __device__ void gpuAtomicAdd(int16_t *address, int16_t val) {
|
| 191 |
+
AtomicAddIntegerImpl<int16_t, sizeof(int16_t)>()(address,
|
| 192 |
+
val,
|
| 193 |
+
[](int16_t a, int16_t b) {
|
| 194 |
+
return a + b;
|
| 195 |
+
});
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
inline __device__ int32_t gpuAtomicAdd(int32_t *address, int32_t val) {
|
| 199 |
+
return atomicAdd(address, val);
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
inline __device__ void gpuAtomicAdd(int64_t *address, int64_t val) {
|
| 203 |
+
#if defined(USE_ROCM)
|
| 204 |
+
__atomic_fetch_add(address, val, __ATOMIC_RELAXED);
|
| 205 |
+
#else
|
| 206 |
+
static_assert(sizeof(unsigned long long int) == sizeof(int64_t), "bitwidth change is not allowed");
|
| 207 |
+
atomicAdd(reinterpret_cast<unsigned long long int *>(address), static_cast<unsigned long long int>(val));
|
| 208 |
+
#endif
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
inline __device__ at::Half gpuAtomicAdd(at::Half *address, at::Half val) {
|
| 212 |
+
#if defined(USE_ROCM) || ((defined(__CUDA_ARCH__) && (__CUDA_ARCH__ < 700)))
|
| 213 |
+
return AtomicFPOp<at::Half>()(address, val,
|
| 214 |
+
[](at::Half hsum, at::Half val) {
|
| 215 |
+
return hsum + val;
|
| 216 |
+
});
|
| 217 |
+
#else
|
| 218 |
+
return atomicAdd(reinterpret_cast<__half*>(address), val);
|
| 219 |
+
#endif
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
inline __device__ at::BFloat16 gpuAtomicAdd(at::BFloat16 *address, at::BFloat16 val) {
|
| 223 |
+
#if defined(USE_ROCM) || ((defined(__CUDA_ARCH__) && (__CUDA_ARCH__ < 800)))
|
| 224 |
+
return AtomicFPOp<at::BFloat16>()(address, val,
|
| 225 |
+
[](at::BFloat16 bsum, at::BFloat16 val) {
|
| 226 |
+
return bsum + val;
|
| 227 |
+
});
|
| 228 |
+
#else
|
| 229 |
+
__nv_bfloat16 r = atomicAdd(reinterpret_cast<__nv_bfloat16*>(address), *reinterpret_cast<__nv_bfloat16*>(&val));
|
| 230 |
+
return *reinterpret_cast<c10::BFloat16*>(&r);
|
| 231 |
+
#endif
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ < 600)
|
| 235 |
+
// from CUDA C Programmic Guide
|
| 236 |
+
inline __device__ double atomicAdd(double* address, double val)
|
| 237 |
+
#if defined(__clang__) && defined(__CUDA__)
|
| 238 |
+
#pragma GCC diagnostic push
|
| 239 |
+
#pragma GCC diagnostic ignored "-Wgcc-compat"
|
| 240 |
+
__attribute__((enable_if(true, "")))
|
| 241 |
+
#pragma GCC diagnostic pop
|
| 242 |
+
#endif
|
| 243 |
+
{
|
| 244 |
+
|
| 245 |
+
return AtomicFPOp<double>()(address, val,
|
| 246 |
+
[](double val, unsigned long long int assumed) {
|
| 247 |
+
return __double_as_longlong(val + __longlong_as_double(assumed));
|
| 248 |
+
});
|
| 249 |
+
}
|
| 250 |
+
#elif defined(USE_ROCM) || !(defined(__CUDA_ARCH__))
|
| 251 |
+
|
| 252 |
+
/* Note [hip-clang differences to hcc]
|
| 253 |
+
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 254 |
+
* The upcoming hip-clang compiler for ROCm differs from hcc in a few details.
|
| 255 |
+
* It exports the __HIP__ macro, we can hence differentiate between hcc and
|
| 256 |
+
* hip-clang. In the below, hcc only received support for atomicAdd with double
|
| 257 |
+
* typing after work week 18312. hip-clang had support from the first version.
|
| 258 |
+
* In general, the code-visible differences between hip-clang and hcc will be
|
| 259 |
+
* minimal.
|
| 260 |
+
*/
|
| 261 |
+
|
| 262 |
+
#if defined(USE_ROCM) && __hcc_workweek__ < 18312 && !__HIP__
|
| 263 |
+
// This needs to be defined for the host side pass
|
| 264 |
+
inline __device__ double atomicAdd(double *address, double val) { }
|
| 265 |
+
#endif
|
| 266 |
+
#endif
|
| 267 |
+
|
| 268 |
+
inline __device__ double gpuAtomicAdd(double *address, double val) {
|
| 269 |
+
return atomicAdd(address, val);
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
inline __device__ float gpuAtomicAdd(float *address, float val) {
|
| 273 |
+
return atomicAdd(address, val);
|
| 274 |
+
}
|
| 275 |
+
|
| 276 |
+
template<typename T>
|
| 277 |
+
inline __device__ void gpuAtomicAdd(c10::complex<T> *address, c10::complex<T> val) {
|
| 278 |
+
gpuAtomicAdd(&address->real_, val.real_);
|
| 279 |
+
gpuAtomicAdd(&address->imag_, val.imag_);
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
/* Note [gpuAtomicAdd vs atomicAdd]
|
| 283 |
+
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 284 |
+
* Some extensions such as torchvision call atomicAdd()
|
| 285 |
+
* directly and require non-library provided data type support. Only for these, we
|
| 286 |
+
* continue to provide atomicAdd overloads.
|
| 287 |
+
*/
|
| 288 |
+
inline __device__ at::Half atomicAdd(at::Half *address, at::Half val) {
|
| 289 |
+
return gpuAtomicAdd(address, val);
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
inline __device__ at::BFloat16 atomicAdd(at::BFloat16 *address, at::BFloat16 val) {
|
| 293 |
+
return gpuAtomicAdd(address, val);
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
inline __device__ void atomicAdd(uint8_t *address, uint8_t val) {
|
| 297 |
+
gpuAtomicAdd(address, val);
|
| 298 |
+
}
|
| 299 |
+
|
| 300 |
+
inline __device__ void atomicAdd(int8_t *address, int8_t val) {
|
| 301 |
+
gpuAtomicAdd(address, val);
|
| 302 |
+
}
|
| 303 |
+
|
| 304 |
+
inline __device__ void atomicAdd(int16_t *address, int16_t val) {
|
| 305 |
+
gpuAtomicAdd(address, val);
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
inline __device__ void atomicAdd(int64_t *address, int64_t val) {
|
| 309 |
+
gpuAtomicAdd(address, val);
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
inline __device__ void atomicAdd(bool *address, bool val) {
|
| 313 |
+
gpuAtomicAdd(address, val);
|
| 314 |
+
}
|
| 315 |
+
|
| 316 |
+
/* Note [explicitly non-returning atomics]
|
| 317 |
+
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 318 |
+
* AMD's MI100 (gfx908) provides an optimized fp32 atomicAdd, exposed via atomicAddNoRet().
|
| 319 |
+
* Due to compiler limitations, callers must opt-in to guarantee the optimized instruction.
|
| 320 |
+
* This non-returning atomicAddNoRet cannot be used to implement the returning atomicAdd,
|
| 321 |
+
* therefore we need a new API 'gpuAtomicAddNoReturn'.
|
| 322 |
+
*/
|
| 323 |
+
template<typename T>
|
| 324 |
+
inline __device__ void gpuAtomicAddNoReturn(c10::complex<T> *address, c10::complex<T> val) { gpuAtomicAdd(address, val); }
|
| 325 |
+
inline __device__ void gpuAtomicAddNoReturn(uint8_t *address, uint8_t val) { gpuAtomicAdd(address, val); }
|
| 326 |
+
inline __device__ void gpuAtomicAddNoReturn(int8_t *address, int8_t val) { gpuAtomicAdd(address, val); }
|
| 327 |
+
inline __device__ void gpuAtomicAddNoReturn(int16_t *address, int16_t val) { gpuAtomicAdd(address, val); }
|
| 328 |
+
inline __device__ void gpuAtomicAddNoReturn(int32_t *address, int32_t val) { gpuAtomicAdd(address, val); }
|
| 329 |
+
inline __device__ void gpuAtomicAddNoReturn(int64_t *address, int64_t val) { gpuAtomicAdd(address, val); }
|
| 330 |
+
inline __device__ void gpuAtomicAddNoReturn(bool *address, bool val) { gpuAtomicAdd(address, val); }
|
| 331 |
+
inline __device__ void gpuAtomicAddNoReturn(at::Half *address, at::Half val) { gpuAtomicAdd(address, val); }
|
| 332 |
+
inline __device__ void gpuAtomicAddNoReturn(at::BFloat16 *address, at::BFloat16 val) { gpuAtomicAdd(address, val); }
|
| 333 |
+
inline __device__ void gpuAtomicAddNoReturn(double *address, double val) { gpuAtomicAdd(address, val); }
|
| 334 |
+
|
| 335 |
+
/* Special case fp32 atomic. */
|
| 336 |
+
#if defined(USE_ROCM)
|
| 337 |
+
inline __device__ void gpuAtomicAddNoReturn(float *address, float val) {
|
| 338 |
+
#if defined(__gfx908__)
|
| 339 |
+
atomicAddNoRet(address, val);
|
| 340 |
+
#else
|
| 341 |
+
(void)unsafeAtomicAdd(address, val);
|
| 342 |
+
#endif
|
| 343 |
+
}
|
| 344 |
+
#else
|
| 345 |
+
inline __device__ void gpuAtomicAddNoReturn(float *address, float val) { gpuAtomicAdd(address, val); }
|
| 346 |
+
#endif
|
| 347 |
+
|
| 348 |
+
// Atomic multiplication implementation.
|
| 349 |
+
|
| 350 |
+
ATOMIC_INTEGER_IMPL(Mul)
|
| 351 |
+
GPU_ATOMIC_INTEGER(Mul, a * b, uint8_t)
|
| 352 |
+
GPU_ATOMIC_INTEGER(Mul, a * b, int8_t)
|
| 353 |
+
GPU_ATOMIC_INTEGER(Mul, a * b, int16_t)
|
| 354 |
+
GPU_ATOMIC_INTEGER(Mul, a * b, int32_t)
|
| 355 |
+
GPU_ATOMIC_INTEGER(Mul, a * b, int64_t)
|
| 356 |
+
|
| 357 |
+
inline __device__ at::Half gpuAtomicMul(at::Half * address, at::Half val) {
|
| 358 |
+
return AtomicFPOp<at::Half>()(address, val,
|
| 359 |
+
[](at::Half bsum, at::Half val) {
|
| 360 |
+
return bsum * val;
|
| 361 |
+
});
|
| 362 |
+
}
|
| 363 |
+
|
| 364 |
+
inline __device__ at::BFloat16 gpuAtomicMul(at::BFloat16 * address, at::BFloat16 val) {
|
| 365 |
+
return AtomicFPOp<at::BFloat16>()(address, val,
|
| 366 |
+
[](at::BFloat16 bsum, at::BFloat16 val) {
|
| 367 |
+
return bsum * val;
|
| 368 |
+
});
|
| 369 |
+
}
|
| 370 |
+
|
| 371 |
+
inline __device__ double gpuAtomicMul(double * address, double val) {
|
| 372 |
+
return AtomicFPOp<double>()(address, val,
|
| 373 |
+
[](double val, unsigned long long int assumed) {
|
| 374 |
+
return __double_as_longlong(val * __longlong_as_double(assumed));
|
| 375 |
+
});
|
| 376 |
+
}
|
| 377 |
+
|
| 378 |
+
// Dont use a templated function for this since the addition function defaults to the CUDA built-in.
|
| 379 |
+
inline __device__ float gpuAtomicMul (float * address, float val) {
|
| 380 |
+
unsigned int* address_as_ull = (unsigned int*)address;
|
| 381 |
+
unsigned int old = *address_as_ull;
|
| 382 |
+
unsigned int assumed;
|
| 383 |
+
|
| 384 |
+
do {
|
| 385 |
+
assumed = old;
|
| 386 |
+
old = atomicCAS(address_as_ull, assumed,
|
| 387 |
+
__float_as_int(val *
|
| 388 |
+
__int_as_float(assumed)));
|
| 389 |
+
|
| 390 |
+
// Note: uses integer comparison to avoid hang in case of NaN (since NaN != NaN)
|
| 391 |
+
} while (assumed != old);
|
| 392 |
+
|
| 393 |
+
return __int_as_float(old);
|
| 394 |
+
}
|
| 395 |
+
|
| 396 |
+
// Atomic maximum implementation.
|
| 397 |
+
|
| 398 |
+
template <typename T>
|
| 399 |
+
__host__ __device__ T safe_max(T a, T b) {
|
| 400 |
+
#if defined(__HIPCC__)
|
| 401 |
+
// TODO: remove this special case for HIP when issue is fixed:
|
| 402 |
+
// https://github.com/ROCm-Developer-Tools/HIP/issues/2209
|
| 403 |
+
T max = at::_isnan(a) ? a : (at::_isnan(b) ? b : std::max<T>(a, b));
|
| 404 |
+
#else
|
| 405 |
+
T max = at::_isnan(b) ? b : std::max<T>(a, b);
|
| 406 |
+
#endif
|
| 407 |
+
|
| 408 |
+
return max;
|
| 409 |
+
}
|
| 410 |
+
|
| 411 |
+
ATOMIC_INTEGER_IMPL(Max)
|
| 412 |
+
GPU_ATOMIC_INTEGER(Max, safe_max(a, b), uint8_t)
|
| 413 |
+
GPU_ATOMIC_INTEGER(Max, safe_max(a, b), int8_t)
|
| 414 |
+
GPU_ATOMIC_INTEGER(Max, safe_max(a, b), int16_t)
|
| 415 |
+
GPU_ATOMIC_INTEGER(Max, safe_max(a, b), int32_t)
|
| 416 |
+
GPU_ATOMIC_INTEGER(Max, safe_max(a, b), int64_t)
|
| 417 |
+
|
| 418 |
+
inline __device__ at::Half gpuAtomicMax(at::Half * address, at::Half val) {
|
| 419 |
+
return AtomicFPOp<at::Half>()(address, val,
|
| 420 |
+
[](at::Half bsum, at::Half val) {
|
| 421 |
+
return safe_max(bsum, val);
|
| 422 |
+
});
|
| 423 |
+
}
|
| 424 |
+
|
| 425 |
+
inline __device__ at::BFloat16 gpuAtomicMax(at::BFloat16 * address, at::BFloat16 val) {
|
| 426 |
+
return AtomicFPOp<at::BFloat16>()(address, val,
|
| 427 |
+
[](at::BFloat16 bsum, at::BFloat16 val) {
|
| 428 |
+
return safe_max(bsum, val);
|
| 429 |
+
});
|
| 430 |
+
}
|
| 431 |
+
|
| 432 |
+
inline __device__ double gpuAtomicMax(double * address, double val) {
|
| 433 |
+
return AtomicFPOp<double>()(address, val,
|
| 434 |
+
[](double val, unsigned long long int assumed) {
|
| 435 |
+
return __double_as_longlong(safe_max(val, __longlong_as_double(assumed)));
|
| 436 |
+
});
|
| 437 |
+
}
|
| 438 |
+
|
| 439 |
+
// Dont use a templated function for this since the addition function defaults to the CUDA built-in.
|
| 440 |
+
inline __device__ float gpuAtomicMax(float * address, float val) {
|
| 441 |
+
unsigned int* address_as_ull = (unsigned int*)address;
|
| 442 |
+
unsigned int old = *address_as_ull;
|
| 443 |
+
unsigned int assumed;
|
| 444 |
+
|
| 445 |
+
do {
|
| 446 |
+
assumed = old;
|
| 447 |
+
old = atomicCAS(address_as_ull, assumed,
|
| 448 |
+
__float_as_int(safe_max(val, __int_as_float(assumed))));
|
| 449 |
+
|
| 450 |
+
// Note: uses integer comparison to avoid hang in case of NaN (since NaN != NaN)
|
| 451 |
+
} while (assumed != old);
|
| 452 |
+
|
| 453 |
+
return __int_as_float(old);
|
| 454 |
+
}
|
| 455 |
+
|
| 456 |
+
// Atomic minimum implementation.
|
| 457 |
+
|
| 458 |
+
template <typename T>
|
| 459 |
+
__host__ __device__ T safe_min(T a, T b) {
|
| 460 |
+
#if defined(__HIPCC__)
|
| 461 |
+
// TODO: remove this special case for HIP when issue is fixed:
|
| 462 |
+
// https://github.com/ROCm-Developer-Tools/HIP/issues/2209
|
| 463 |
+
T min = at::_isnan(a) ? a : (at::_isnan(b) ? b : std::min<T>(a, b));
|
| 464 |
+
#else
|
| 465 |
+
T min = at::_isnan(b) ? b : std::min<T>(a, b);
|
| 466 |
+
#endif
|
| 467 |
+
|
| 468 |
+
return min;
|
| 469 |
+
}
|
| 470 |
+
|
| 471 |
+
ATOMIC_INTEGER_IMPL(Min)
|
| 472 |
+
GPU_ATOMIC_INTEGER(Min, safe_min(a, b), uint8_t)
|
| 473 |
+
GPU_ATOMIC_INTEGER(Min, safe_min(a, b), int8_t)
|
| 474 |
+
GPU_ATOMIC_INTEGER(Min, safe_min(a, b), int16_t)
|
| 475 |
+
GPU_ATOMIC_INTEGER(Min, safe_min(a, b), int32_t)
|
| 476 |
+
GPU_ATOMIC_INTEGER(Min, safe_min(a, b), int64_t)
|
| 477 |
+
|
| 478 |
+
inline __device__ at::Half gpuAtomicMin(at::Half * address, at::Half val) {
|
| 479 |
+
return AtomicFPOp<at::Half>()(address, val,
|
| 480 |
+
[](at::Half bsum, at::Half val) {
|
| 481 |
+
return safe_min(bsum, val);
|
| 482 |
+
});
|
| 483 |
+
}
|
| 484 |
+
|
| 485 |
+
inline __device__ at::BFloat16 gpuAtomicMin(at::BFloat16 * address, at::BFloat16 val) {
|
| 486 |
+
return AtomicFPOp<at::BFloat16>()(address, val,
|
| 487 |
+
[](at::BFloat16 bsum, at::BFloat16 val) {
|
| 488 |
+
return safe_min(bsum, val);
|
| 489 |
+
});
|
| 490 |
+
}
|
| 491 |
+
|
| 492 |
+
inline __device__ double gpuAtomicMin(double * address, double val) {
|
| 493 |
+
return AtomicFPOp<double>()(address, val,
|
| 494 |
+
[](double val, unsigned long long int assumed) {
|
| 495 |
+
return __double_as_longlong(safe_min(val, __longlong_as_double(assumed)));
|
| 496 |
+
});
|
| 497 |
+
}
|
| 498 |
+
|
| 499 |
+
// Dont use a templated function for this since the addition function defaults to the CUDA built-in.
|
| 500 |
+
inline __device__ float gpuAtomicMin(float * address, float val) {
|
| 501 |
+
unsigned int* address_as_ull = (unsigned int*)address;
|
| 502 |
+
unsigned int old = *address_as_ull;
|
| 503 |
+
unsigned int assumed;
|
| 504 |
+
|
| 505 |
+
do {
|
| 506 |
+
assumed = old;
|
| 507 |
+
old = atomicCAS(address_as_ull, assumed,
|
| 508 |
+
__float_as_int(safe_min(val, __int_as_float(assumed))));
|
| 509 |
+
|
| 510 |
+
// Note: uses integer comparison to avoid hang in case of NaN (since NaN != NaN)
|
| 511 |
+
} while (assumed != old);
|
| 512 |
+
|
| 513 |
+
return __int_as_float(old);
|
| 514 |
+
}
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAApplyUtils.cuh
ADDED
|
@@ -0,0 +1,537 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <ATen/cuda/ApplyGridUtils.cuh>
|
| 4 |
+
#include <ATen/cuda/detail/IndexUtils.cuh>
|
| 5 |
+
#include <ATen/core/TensorBase.h>
|
| 6 |
+
#include <ATen/ceil_div.h>
|
| 7 |
+
#include <ATen/cuda/Atomic.cuh>
|
| 8 |
+
#include <ATen/cuda/CUDAContext.h>
|
| 9 |
+
#include <c10/macros/Macros.h>
|
| 10 |
+
#include <ATen/native/Copy.h>
|
| 11 |
+
|
| 12 |
+
#include <math.h>
|
| 13 |
+
|
| 14 |
+
//
|
| 15 |
+
// This file contains pointwise operation functions and kernels that
|
| 16 |
+
// work on both contiguous and non-contiguous tensor arguments of
|
| 17 |
+
// arbitrary (up to MAX_CUTORCH_DIMS) dimensioned arguments without
|
| 18 |
+
// copying or temporary storage.
|
| 19 |
+
//
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
NOTE [ CUDA_tensor_applyN helpers ]
|
| 23 |
+
|
| 24 |
+
The following CUDA_tensor_applyN (where N currently can be 1, 2, 3, or 4)
|
| 25 |
+
functions apply a pointwise operator to N tensor(s).
|
| 26 |
+
|
| 27 |
+
The calling convention is
|
| 28 |
+
|
| 29 |
+
1. The template arguments should be, sequentially,
|
| 30 |
+
- First N typename args specify the scalar types of each of the N tensors.
|
| 31 |
+
- (Optional) `int step` arg specifies the number of elements processed
|
| 32 |
+
together at the same time.
|
| 33 |
+
Default is 1.
|
| 34 |
+
- A usually omitted (i.e., inferred) typename arg specifies the type of the
|
| 35 |
+
function/functor applied on `N * step` values in each iteration of each
|
| 36 |
+
CUDA thread.
|
| 37 |
+
2. The arguments should be, sequentially,
|
| 38 |
+
- N tensors
|
| 39 |
+
- op: a function/functor that processes `N * step` values at the same time.
|
| 40 |
+
- If `step == 1`, it must have signature
|
| 41 |
+
`void(*)(scalar1_t&, scalar2_t&, ..., scalarN_t&)`, where
|
| 42 |
+
`scalar*_t`s are the first N typename template args, and the inputs
|
| 43 |
+
are the `N` values from the `N` tensors retrieved at a common index.
|
| 44 |
+
- Otherwise, it must must have signature
|
| 45 |
+
void(*)(int n, scalar1_t&, scalar1_t&, ..., scalar1_t&, // repeat `step` times
|
| 46 |
+
scalar2_t&, scalar2_t&, ..., scalar2_t&, // repeat `step` times
|
| 47 |
+
...,
|
| 48 |
+
scalarN_t&, scalarN_t&, ..., scalarN_t&) // repeat `step` times
|
| 49 |
+
Different from `step == 1` case, it processes `N * step` values taken
|
| 50 |
+
from `step` common indices. Moreover, the first input `n` represents the
|
| 51 |
+
number of valid indices (it will always have `0 < n <= step`). It will
|
| 52 |
+
almost always be `step`, but at the boundary we may not have full `step`
|
| 53 |
+
elements and `n` can be a lesser value.
|
| 54 |
+
|
| 55 |
+
E.g., if `step == 4` and `N == 2`, `op` could be
|
| 56 |
+
|
| 57 |
+
[](int n, scalar1_t &u1, scalar1_t &u2, scalar1_t &u3, scalar1_t &u4,
|
| 58 |
+
scalar2_t &v1, scalar2_t &v2, scalar2_t &v3, scalar2_t &v4) {
|
| 59 |
+
// Only process u1, ..., un and v1, ..., vn.
|
| 60 |
+
// So if `n == 3`, `u4` and `v4` need not to be considered.
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
In both cases, the references can actually be const, but at least one of
|
| 64 |
+
them should be non-const in order to write the output.
|
| 65 |
+
- (Optional, but recommended) N TensorArgType args that specify for each
|
| 66 |
+
tensor whether `op` reads AND writes ] (i.e., TensorArgType::ReadWrite),
|
| 67 |
+
or only reads (i.e., TensorArgType::ReadOnly).
|
| 68 |
+
Default is TensorArgType::ReadWrite for first Tensor, and
|
| 69 |
+
TensorArgType::ReadOnly for the rest.
|
| 70 |
+
|
| 71 |
+
E.g.,
|
| 72 |
+
|
| 73 |
+
to compute a = b^2 for a and b of same dtype, we can call
|
| 74 |
+
|
| 75 |
+
CUDA_tensor_apply2<scalar, scalar>(
|
| 76 |
+
a, b,
|
| 77 |
+
[] __device__ (scalar &a_val, const scalar &b_val) { a_val = b_val * b_val; }
|
| 78 |
+
);
|
| 79 |
+
|
| 80 |
+
to work on 2 values at the same time, we can call
|
| 81 |
+
|
| 82 |
+
CUDA_tensor_apply2<scalar1, scalar2, 2>(
|
| 83 |
+
a, b,
|
| 84 |
+
[] __device__ (int n, scalar1 &a_val1, scalar1 &a_val2,
|
| 85 |
+
const scalar2 &b_val1, const scalar2 &b_val2) {
|
| 86 |
+
// call special vectorized op here, or just do elementwise and enjoy unrolling...
|
| 87 |
+
// if n == 1, only process a_val1 and b_val1
|
| 88 |
+
}
|
| 89 |
+
);
|
| 90 |
+
*/
|
| 91 |
+
|
| 92 |
+
namespace at::cuda {
|
| 93 |
+
|
| 94 |
+
// TODO: combine with TensorArg? So far that's been for debugging, and this is functional...
|
| 95 |
+
enum class TensorArgType { ReadWrite, ReadOnly };
|
| 96 |
+
|
| 97 |
+
namespace {
|
| 98 |
+
|
| 99 |
+
// Rearrange dimensions for pointwise operations so that strides are in
|
| 100 |
+
// decreasing order as much as possible, so that kernels have better memory
|
| 101 |
+
// access patterns.
|
| 102 |
+
//
|
| 103 |
+
// For example, consider a binary operation on two "transposed" 2-dim tensors:
|
| 104 |
+
// sizes: 256 512
|
| 105 |
+
// aInfo->strides: 1 256
|
| 106 |
+
// bInfo->strides: 1 256
|
| 107 |
+
//
|
| 108 |
+
// Given this, each concurrent memory access inside kernelPointwiseApply2() is
|
| 109 |
+
// exactly 256 elements apart, resulting in poor performance.
|
| 110 |
+
//
|
| 111 |
+
// This function exchanges dimensions so that memory access is contiguous:
|
| 112 |
+
// sizes: 512 256
|
| 113 |
+
// aInfo->strides: 256 1
|
| 114 |
+
// bInfo->strides: 256 1
|
| 115 |
+
//
|
| 116 |
+
// (Actually, it becomes even better because now collapseDims() can turn each
|
| 117 |
+
// input into one contiguous array.)
|
| 118 |
+
//
|
| 119 |
+
// In general, given M (<=4) TensorInfo's with N dimensions, we can view each
|
| 120 |
+
// strides[i] (0 <= i < N) as an M-tuple. Given each pair i < j, we exchange
|
| 121 |
+
// strides[i] and [j] if
|
| 122 |
+
// (1) strides[i][k] < strides[j][k] for some k (0 <= k < M)
|
| 123 |
+
// (exchanging them will benefit input #k), and
|
| 124 |
+
// (2) strides[i][k] <= strieds[j][k] for all k
|
| 125 |
+
// (exchanging them will not make any input worse).
|
| 126 |
+
template <typename T1, typename IndexType,
|
| 127 |
+
typename T2 = void, typename T3 = void, typename T4 = void>
|
| 128 |
+
inline void rearrangeDims(detail::TensorInfo<T1, IndexType>* aInfo,
|
| 129 |
+
detail::TensorInfo<T2, IndexType>* bInfo = nullptr,
|
| 130 |
+
detail::TensorInfo<T3, IndexType>* cInfo = nullptr,
|
| 131 |
+
detail::TensorInfo<T4, IndexType>* dInfo = nullptr) {
|
| 132 |
+
int numInfos = 1;
|
| 133 |
+
int dims = aInfo->dims;
|
| 134 |
+
IndexType *sizes[4] = { aInfo->sizes, };
|
| 135 |
+
IndexType *strides[4] = { aInfo->strides, };
|
| 136 |
+
|
| 137 |
+
if (bInfo != nullptr) {
|
| 138 |
+
++numInfos;
|
| 139 |
+
if (bInfo->dims != dims) return;
|
| 140 |
+
sizes[1] = bInfo->sizes;
|
| 141 |
+
strides[1] = bInfo->strides;
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
if (cInfo != nullptr) {
|
| 145 |
+
++numInfos;
|
| 146 |
+
if (cInfo->dims != dims) return;
|
| 147 |
+
sizes[2] = cInfo->sizes;
|
| 148 |
+
strides[2] = cInfo->strides;
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
if (dInfo != nullptr) {
|
| 152 |
+
++numInfos;
|
| 153 |
+
if (dInfo->dims != dims) return;
|
| 154 |
+
sizes[3] = dInfo->sizes;
|
| 155 |
+
strides[3] = dInfo->strides;
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
// Bail out if sizes do not match: we are using "deprecated pointwise
|
| 159 |
+
// behavior" among tensors of different shapes but same number of elements.
|
| 160 |
+
for (int i = 1; i < numInfos; ++i) {
|
| 161 |
+
for (int j = 0; j < dims; ++j) {
|
| 162 |
+
if (sizes[i][j] != sizes[0][j]) return;
|
| 163 |
+
}
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
for (int i = 0; i < dims - 1; ++i) {
|
| 167 |
+
// No need to consider dimensions of size 1.
|
| 168 |
+
if (sizes[0][i] == 1) continue;
|
| 169 |
+
|
| 170 |
+
for (int j = i + 1; j < dims; ++j) {
|
| 171 |
+
if (sizes[0][j] == 1) continue;
|
| 172 |
+
|
| 173 |
+
// Compare the relative sizes of strides between dim #i and dim #j.
|
| 174 |
+
bool hasIncreasingStrides = false;
|
| 175 |
+
bool hasDecreasingStrides = false;
|
| 176 |
+
|
| 177 |
+
for (int k = 0; k < numInfos; k++) {
|
| 178 |
+
IndexType stride_i = strides[k][i];
|
| 179 |
+
IndexType stride_j = strides[k][j];
|
| 180 |
+
if (stride_i < stride_j) {
|
| 181 |
+
hasIncreasingStrides = true;
|
| 182 |
+
} else if (stride_i > stride_j) {
|
| 183 |
+
hasDecreasingStrides = true;
|
| 184 |
+
}
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
if (hasIncreasingStrides && !hasDecreasingStrides) {
|
| 188 |
+
for (int k = 0; k < numInfos; k++) {
|
| 189 |
+
IndexType size = sizes[k][i];
|
| 190 |
+
sizes[k][i] = sizes[k][j];
|
| 191 |
+
sizes[k][j] = size;
|
| 192 |
+
|
| 193 |
+
IndexType stride = strides[k][i];
|
| 194 |
+
strides[k][i] = strides[k][j];
|
| 195 |
+
strides[k][j] = stride;
|
| 196 |
+
}
|
| 197 |
+
}
|
| 198 |
+
}
|
| 199 |
+
}
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
// The `remaining_steps` argument is used to support Op that operates on
|
| 203 |
+
// multiple elements at the same time. Generally, the strategy of ApplyOpN is to
|
| 204 |
+
// 1. Initialize `remaining_steps = step`, where `step` is the template arg of
|
| 205 |
+
// CUDA_tensor_applyN helpers. The input arg `n` to `apply()` represents the
|
| 206 |
+
// number of elements in bound for this call. It will almost always equal to
|
| 207 |
+
// `step` except at boundaries.
|
| 208 |
+
// 2. If `remaining_steps > 0` convert the current linearIndex to offset (if in
|
| 209 |
+
// bound), and recursively call `ApplyOpN` with `remaining_steps - 1`.
|
| 210 |
+
// 3. At `remaining_steps = 0`,
|
| 211 |
+
// if `step = 1`, call `op(tensor1_val, tensor2_val, ...)`;
|
| 212 |
+
// if `step > 1`, call `op(n, tensor1_val1, tensor1_val2, ..., tesor1_valstep,
|
| 213 |
+
// tensor2_val1, tensor2_val2, ..., tesor2_valstep,
|
| 214 |
+
// ...
|
| 215 |
+
// tensorN_val1, tensorN_val2, ..., tesorN_valstep);`
|
| 216 |
+
//
|
| 217 |
+
// See NOTE [ CUDA_tensor_applyN helpers ] above for how Op may look like.
|
| 218 |
+
|
| 219 |
+
template <typename Op,
|
| 220 |
+
typename scalar,
|
| 221 |
+
typename IndexType,
|
| 222 |
+
int ADims,
|
| 223 |
+
int remaining_steps,
|
| 224 |
+
typename... Offsets>
|
| 225 |
+
struct ApplyOp1 {
|
| 226 |
+
__device__ __forceinline__
|
| 227 |
+
static void apply(detail::TensorInfo<scalar, IndexType> &a, const Op &op, int n,
|
| 228 |
+
IndexType linearIndex, Offsets... aOffsets) {
|
| 229 |
+
// Convert `linearIndex` into an offset of `a`
|
| 230 |
+
const IndexType aOffset = sizeof...(Offsets) < n ?
|
| 231 |
+
detail::IndexToOffset<scalar, IndexType, ADims>::get(linearIndex, a) : 0;
|
| 232 |
+
|
| 233 |
+
ApplyOp1<Op, scalar, IndexType, ADims, remaining_steps - 1, const IndexType, Offsets...>::apply(
|
| 234 |
+
a, op, n, linearIndex + 1, aOffsets..., aOffset
|
| 235 |
+
);
|
| 236 |
+
}
|
| 237 |
+
};
|
| 238 |
+
|
| 239 |
+
// Specialize `step=1` case (i.e., `remaining_steps=0` and `len(Offsets)=1`).
|
| 240 |
+
// We don't need to pass in how many elements need to processed in this case.
|
| 241 |
+
template <typename Op,
|
| 242 |
+
typename scalar,
|
| 243 |
+
typename IndexType,
|
| 244 |
+
int ADims,
|
| 245 |
+
typename Offset>
|
| 246 |
+
struct ApplyOp1<Op, scalar, IndexType, ADims, 0, Offset> {
|
| 247 |
+
__device__ __forceinline__
|
| 248 |
+
static void apply(detail::TensorInfo<scalar, IndexType> &a, const Op &op,
|
| 249 |
+
int n, IndexType linearIndex, Offset offset) {
|
| 250 |
+
op(a.data[offset]);
|
| 251 |
+
}
|
| 252 |
+
};
|
| 253 |
+
|
| 254 |
+
template <typename Op,
|
| 255 |
+
typename scalar,
|
| 256 |
+
typename IndexType,
|
| 257 |
+
int ADims,
|
| 258 |
+
typename... Offsets>
|
| 259 |
+
struct ApplyOp1<Op, scalar, IndexType, ADims, 0, Offsets...> {
|
| 260 |
+
__device__ __forceinline__
|
| 261 |
+
static void apply(detail::TensorInfo<scalar, IndexType> &a, const Op &op, int n,
|
| 262 |
+
IndexType linearIndex, Offsets... offsets) {
|
| 263 |
+
op(n, a.data[offsets]...);
|
| 264 |
+
}
|
| 265 |
+
};
|
| 266 |
+
|
| 267 |
+
template <typename Op,
|
| 268 |
+
typename scalar,
|
| 269 |
+
typename IndexType,
|
| 270 |
+
int ADims,
|
| 271 |
+
int step>
|
| 272 |
+
#if __CUDA_ARCH__ >= 350 || defined(USE_ROCM)
|
| 273 |
+
C10_LAUNCH_BOUNDS_2(AT_APPLY_THREADS_PER_BLOCK, AT_APPLY_BLOCKS_PER_SM)
|
| 274 |
+
#endif
|
| 275 |
+
__global__ void kernelPointwiseApply1(detail::TensorInfo<scalar, IndexType> a,
|
| 276 |
+
IndexType totalElements, const Op op) {
|
| 277 |
+
for (IndexType linearIndex = (blockIdx.x * blockDim.x + threadIdx.x) * step;
|
| 278 |
+
linearIndex < totalElements;
|
| 279 |
+
linearIndex += gridDim.x * blockDim.x * step) {
|
| 280 |
+
ApplyOp1<Op, scalar, IndexType, ADims, step>::apply(
|
| 281 |
+
a, op, ::min(step, static_cast<int>(totalElements - linearIndex)), linearIndex);
|
| 282 |
+
}
|
| 283 |
+
}
|
| 284 |
+
|
| 285 |
+
|
| 286 |
+
template <typename Op,
|
| 287 |
+
typename scalar1,
|
| 288 |
+
typename scalar2,
|
| 289 |
+
typename IndexType,
|
| 290 |
+
int ADims,
|
| 291 |
+
int BDims,
|
| 292 |
+
int remaining_steps,
|
| 293 |
+
typename... Offsets>
|
| 294 |
+
struct ApplyOp2 {
|
| 295 |
+
__device__ __forceinline__
|
| 296 |
+
static void apply(detail::TensorInfo<scalar1, IndexType> &a,
|
| 297 |
+
detail::TensorInfo<scalar2, IndexType> &b,
|
| 298 |
+
const Op &op, int64_t n, IndexType linearIndex,
|
| 299 |
+
Offsets... aOffsets, Offsets... bOffsets) {
|
| 300 |
+
// Convert `linearIndex` into an offset of `a`
|
| 301 |
+
const IndexType aOffset = static_cast<int64_t>(sizeof...(Offsets)) < n ?
|
| 302 |
+
detail::IndexToOffset<scalar1, IndexType, ADims>::get(linearIndex, a) : 0;
|
| 303 |
+
|
| 304 |
+
// Convert `linearIndex` into an offset of `b`
|
| 305 |
+
const IndexType bOffset = static_cast<int64_t>(sizeof...(Offsets)) < n ?
|
| 306 |
+
detail::IndexToOffset<scalar2, IndexType, BDims>::get(linearIndex, b) : 0;
|
| 307 |
+
|
| 308 |
+
ApplyOp2<Op, scalar1, scalar2, IndexType, ADims, BDims, remaining_steps - 1, const IndexType, Offsets...>::apply(
|
| 309 |
+
a, b, op, n, linearIndex + 1, aOffsets..., aOffset, bOffsets..., bOffset
|
| 310 |
+
);
|
| 311 |
+
}
|
| 312 |
+
};
|
| 313 |
+
|
| 314 |
+
// Specialize `step=1` case (i.e., `remaining_steps=0` and `len(Offsets)=1`).
|
| 315 |
+
// We don't need to pass in how many elements need to processed in this case.
|
| 316 |
+
template <typename Op,
|
| 317 |
+
typename scalar1,
|
| 318 |
+
typename scalar2,
|
| 319 |
+
typename IndexType,
|
| 320 |
+
int ADims,
|
| 321 |
+
int BDims,
|
| 322 |
+
typename Offset>
|
| 323 |
+
struct ApplyOp2<Op, scalar1, scalar2, IndexType, ADims, BDims, 0, Offset> {
|
| 324 |
+
__device__ __forceinline__
|
| 325 |
+
static void apply(detail::TensorInfo<scalar1, IndexType> &a,
|
| 326 |
+
detail::TensorInfo<scalar2, IndexType> &b,
|
| 327 |
+
const Op &op, int /*n*/, IndexType /*linearIndex*/,
|
| 328 |
+
Offset aOffset, Offset bOffset) {
|
| 329 |
+
op(a.data[aOffset], b.data[bOffset]);
|
| 330 |
+
}
|
| 331 |
+
};
|
| 332 |
+
|
| 333 |
+
template <typename Op,
|
| 334 |
+
typename scalar1,
|
| 335 |
+
typename scalar2,
|
| 336 |
+
typename IndexType,
|
| 337 |
+
int ADims,
|
| 338 |
+
int BDims,
|
| 339 |
+
typename... Offsets>
|
| 340 |
+
struct ApplyOp2<Op, scalar1, scalar2, IndexType, ADims, BDims, 0, Offsets...> {
|
| 341 |
+
__device__ __forceinline__
|
| 342 |
+
static void apply(detail::TensorInfo<scalar1, IndexType> &a,
|
| 343 |
+
detail::TensorInfo<scalar2, IndexType> &b,
|
| 344 |
+
const Op &op, int n, IndexType linearIndex,
|
| 345 |
+
Offsets... aOffsets, Offsets... bOffsets) {
|
| 346 |
+
op(n, a.data[aOffsets]..., b.data[bOffsets]...);
|
| 347 |
+
}
|
| 348 |
+
};
|
| 349 |
+
|
| 350 |
+
template <typename Op,
|
| 351 |
+
typename scalar1,
|
| 352 |
+
typename scalar2,
|
| 353 |
+
typename IndexType,
|
| 354 |
+
int ADims, int BDims,
|
| 355 |
+
int step,
|
| 356 |
+
int max_threads_per_block=AT_APPLY_THREADS_PER_BLOCK,
|
| 357 |
+
int min_blocks_per_sm=AT_APPLY_BLOCKS_PER_SM>
|
| 358 |
+
#if __CUDA_ARCH__ >= 350 || defined(USE_ROCM)
|
| 359 |
+
C10_LAUNCH_BOUNDS_2(max_threads_per_block, min_blocks_per_sm)
|
| 360 |
+
#endif
|
| 361 |
+
__global__ void
|
| 362 |
+
kernelPointwiseApply2(detail::TensorInfo<scalar1, IndexType> a,
|
| 363 |
+
detail::TensorInfo<scalar2, IndexType> b,
|
| 364 |
+
IndexType totalElements,
|
| 365 |
+
const Op op) {
|
| 366 |
+
for (IndexType linearIndex = (blockIdx.x * blockDim.x + threadIdx.x) * step;
|
| 367 |
+
linearIndex < totalElements;
|
| 368 |
+
linearIndex += gridDim.x * blockDim.x * step) {
|
| 369 |
+
ApplyOp2<Op, scalar1, scalar2, IndexType, ADims, BDims, step>::apply(
|
| 370 |
+
a, b, op, ::min(step, static_cast<int>(totalElements - linearIndex)),
|
| 371 |
+
linearIndex);
|
| 372 |
+
}
|
| 373 |
+
}
|
| 374 |
+
|
| 375 |
+
} // anonymous namespace
|
| 376 |
+
|
| 377 |
+
template <typename scalar1, typename scalar2, int step, typename Op,
|
| 378 |
+
int max_threads_per_block=AT_APPLY_THREADS_PER_BLOCK,
|
| 379 |
+
int min_blocks_per_sm=AT_APPLY_BLOCKS_PER_SM>
|
| 380 |
+
inline bool CUDA_tensor_apply2(at::TensorBase a,
|
| 381 |
+
at::TensorBase b,
|
| 382 |
+
const Op op,
|
| 383 |
+
TensorArgType aType = TensorArgType::ReadWrite,
|
| 384 |
+
TensorArgType bType = TensorArgType::ReadOnly) {
|
| 385 |
+
TORCH_CHECK(a.device().is_cuda() && b.device().is_cuda(),
|
| 386 |
+
"CUDA_tensor_apply2: Expected tensors to have CUDA DeviceType, but got "
|
| 387 |
+
"tensors with type ", a.device().type(), " and ", b.device().type());
|
| 388 |
+
int64_t totalElements = a.numel();
|
| 389 |
+
|
| 390 |
+
if (totalElements != b.numel()) {
|
| 391 |
+
return false;
|
| 392 |
+
}
|
| 393 |
+
|
| 394 |
+
if (a.dim() > MAX_TENSORINFO_DIMS ||
|
| 395 |
+
b.dim() > MAX_TENSORINFO_DIMS) {
|
| 396 |
+
return false;
|
| 397 |
+
}
|
| 398 |
+
|
| 399 |
+
if (a.numel() == 0) {
|
| 400 |
+
// Empty tensor; do nothing
|
| 401 |
+
return true;
|
| 402 |
+
}
|
| 403 |
+
const dim3 block = getApplyBlock(max_threads_per_block);
|
| 404 |
+
|
| 405 |
+
dim3 grid;
|
| 406 |
+
auto curDevice = current_device();
|
| 407 |
+
if (curDevice == -1) return false;
|
| 408 |
+
if (!getApplyGrid<step>(totalElements, grid, curDevice, max_threads_per_block)) {
|
| 409 |
+
return false;
|
| 410 |
+
}
|
| 411 |
+
|
| 412 |
+
/*
|
| 413 |
+
Expands readable/writable tensors whose indices may be "overlapped."
|
| 414 |
+
This ensures that each element of the tensor is operated on once and only
|
| 415 |
+
once.
|
| 416 |
+
*/
|
| 417 |
+
TensorBase oldA;
|
| 418 |
+
TensorBase oldB;
|
| 419 |
+
|
| 420 |
+
if (aType == TensorArgType::ReadWrite && detail::maybeOverlappingIndices(a)) {
|
| 421 |
+
// Must perform in contiguous space
|
| 422 |
+
oldA = std::exchange(a, a.contiguous());
|
| 423 |
+
}
|
| 424 |
+
if (bType == TensorArgType::ReadWrite && detail::maybeOverlappingIndices(b)) {
|
| 425 |
+
// Must perform in contiguous space
|
| 426 |
+
oldB = std::exchange(b, b.contiguous());
|
| 427 |
+
}
|
| 428 |
+
|
| 429 |
+
// It is possible that the tensor dimensions are able to be collapsed,
|
| 430 |
+
// and thus we can reduce the actual code complexity of the copy by
|
| 431 |
+
// exploiting this knowledge statically, since the div/mod is the
|
| 432 |
+
// most expensive part of the operation, more so than memory accesses.
|
| 433 |
+
// For instance, when copying a non-contiguous to a contiguous tensor
|
| 434 |
+
// (or vice versa), the contiguous tensor can be collapsed to one
|
| 435 |
+
// dimension, and the loop to translate the linear index to the array
|
| 436 |
+
// index can be similarly collapsed. That is what this unrolling is for.
|
| 437 |
+
|
| 438 |
+
#define HANDLE_CASE(TYPE, A, B) \
|
| 439 |
+
kernelPointwiseApply2<Op, \
|
| 440 |
+
scalar1, \
|
| 441 |
+
scalar2, \
|
| 442 |
+
TYPE, A, B, step, \
|
| 443 |
+
max_threads_per_block, \
|
| 444 |
+
min_blocks_per_sm> \
|
| 445 |
+
<<<grid, block, 0, at::cuda::getCurrentCUDAStream(curDevice)>>>( \
|
| 446 |
+
aInfo, bInfo, static_cast<TYPE>(totalElements), op); \
|
| 447 |
+
C10_CUDA_KERNEL_LAUNCH_CHECK();
|
| 448 |
+
|
| 449 |
+
#define HANDLE_B_CASE(TYPE, A, B) { \
|
| 450 |
+
switch (B) { \
|
| 451 |
+
case 1: \
|
| 452 |
+
HANDLE_CASE(TYPE, A, 1); \
|
| 453 |
+
break; \
|
| 454 |
+
case 2: \
|
| 455 |
+
HANDLE_CASE(TYPE, A, 2); \
|
| 456 |
+
break; \
|
| 457 |
+
default: \
|
| 458 |
+
HANDLE_CASE(TYPE, A, -1); \
|
| 459 |
+
break; \
|
| 460 |
+
} \
|
| 461 |
+
}
|
| 462 |
+
|
| 463 |
+
#define HANDLE_A_CASE(TYPE, A, B) { \
|
| 464 |
+
switch (A) { \
|
| 465 |
+
case 1: \
|
| 466 |
+
HANDLE_B_CASE(TYPE, 1, B); \
|
| 467 |
+
break; \
|
| 468 |
+
case 2: \
|
| 469 |
+
HANDLE_B_CASE(TYPE, 2, B); \
|
| 470 |
+
break; \
|
| 471 |
+
default: \
|
| 472 |
+
HANDLE_B_CASE(TYPE, -1, B); \
|
| 473 |
+
break; \
|
| 474 |
+
} \
|
| 475 |
+
}
|
| 476 |
+
|
| 477 |
+
if (detail::canUse32BitIndexMath(a) &&
|
| 478 |
+
detail::canUse32BitIndexMath(b)) {
|
| 479 |
+
detail::TensorInfo<scalar1, unsigned int> aInfo =
|
| 480 |
+
detail::getTensorInfo<scalar1, unsigned int>(a);
|
| 481 |
+
|
| 482 |
+
detail::TensorInfo<scalar2, unsigned int> bInfo =
|
| 483 |
+
detail::getTensorInfo<scalar2, unsigned int>(b);
|
| 484 |
+
rearrangeDims(&aInfo, &bInfo);
|
| 485 |
+
aInfo.collapseDims();
|
| 486 |
+
bInfo.collapseDims();
|
| 487 |
+
|
| 488 |
+
HANDLE_A_CASE(unsigned int, aInfo.dims, bInfo.dims);
|
| 489 |
+
} else {
|
| 490 |
+
detail::TensorInfo<scalar1, uint64_t> aInfo =
|
| 491 |
+
detail::getTensorInfo<scalar1, uint64_t>(a);
|
| 492 |
+
|
| 493 |
+
detail::TensorInfo<scalar2, uint64_t> bInfo =
|
| 494 |
+
detail::getTensorInfo<scalar2, uint64_t>(b);
|
| 495 |
+
rearrangeDims(&aInfo, &bInfo);
|
| 496 |
+
aInfo.collapseDims();
|
| 497 |
+
bInfo.collapseDims();
|
| 498 |
+
|
| 499 |
+
/*
|
| 500 |
+
Only instantiates the all 1D special case and the fallback all nD case for
|
| 501 |
+
large (64-bit indexed) tensors to reduce compilation time.
|
| 502 |
+
*/
|
| 503 |
+
if (aInfo.dims == 1 && bInfo.dims == 1) {
|
| 504 |
+
HANDLE_CASE(uint64_t, 1, 1);
|
| 505 |
+
} else {
|
| 506 |
+
HANDLE_CASE(uint64_t, -1, -1);
|
| 507 |
+
}
|
| 508 |
+
}
|
| 509 |
+
#undef HANDLE_CASE
|
| 510 |
+
#undef HANDLE_B_CASE
|
| 511 |
+
#undef HANDLE_A_CASE
|
| 512 |
+
|
| 513 |
+
if (oldA.defined()) {
|
| 514 |
+
at::native::copy_ignoring_overlaps(oldA, a);
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
+
if (oldB.defined()) {
|
| 518 |
+
at::native::copy_ignoring_overlaps(oldB, b);
|
| 519 |
+
}
|
| 520 |
+
|
| 521 |
+
return true;
|
| 522 |
+
}
|
| 523 |
+
|
| 524 |
+
/* Provides default step = 1 to CUDA_tensor_apply2. */
|
| 525 |
+
template <typename scalar1, typename scalar2, typename Op,
|
| 526 |
+
int max_threads_per_block=AT_APPLY_THREADS_PER_BLOCK,
|
| 527 |
+
int min_blocks_per_sm=AT_APPLY_BLOCKS_PER_SM>
|
| 528 |
+
inline bool CUDA_tensor_apply2(const at::TensorBase &a,
|
| 529 |
+
const at::TensorBase &b,
|
| 530 |
+
const Op op,
|
| 531 |
+
TensorArgType aType = TensorArgType::ReadWrite,
|
| 532 |
+
TensorArgType bType = TensorArgType::ReadOnly) {
|
| 533 |
+
return CUDA_tensor_apply2<scalar1, scalar2, 1, Op,
|
| 534 |
+
max_threads_per_block, min_blocks_per_sm>(a, b, op, aType, bType);
|
| 535 |
+
}
|
| 536 |
+
|
| 537 |
+
} // namespace at::cuda
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDABlas.h
ADDED
|
@@ -0,0 +1,358 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
#pragma once
|
| 2 |
+
/*
|
| 3 |
+
Provides a subset of CUDA BLAS functions as templates:
|
| 4 |
+
|
| 5 |
+
gemm<Dtype>(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c,
|
| 6 |
+
ldc)
|
| 7 |
+
|
| 8 |
+
gemv<Dtype>(transa, m, n, alpha, a, lda, x, incx, beta, y, incy)
|
| 9 |
+
|
| 10 |
+
dot<Dtype>(n, x, incx, y, incy, result)
|
| 11 |
+
|
| 12 |
+
where Dtype is double, float, at::Half or at::BFloat16 (ROCm, NOT for dot).
|
| 13 |
+
The functions are available in at::cuda::blas namespace.
|
| 14 |
+
*/
|
| 15 |
+
|
| 16 |
+
#include <ATen/cuda/CUDAContext.h>
|
| 17 |
+
#include <ATen/OpMathType.h>
|
| 18 |
+
|
| 19 |
+
namespace at::cuda::blas {
|
| 20 |
+
|
| 21 |
+
// RAII guard that sets the CuBLAS pointer mode and restores it to
|
| 22 |
+
// its previous value when the guard is destroyed
|
| 23 |
+
class PointerModeGuard {
|
| 24 |
+
public:
|
| 25 |
+
PointerModeGuard(cublasHandle_t handle, cublasPointerMode_t mode) :
|
| 26 |
+
handle(handle) {
|
| 27 |
+
TORCH_CUDABLAS_CHECK(cublasGetPointerMode(handle, &previous_mode));
|
| 28 |
+
TORCH_CUDABLAS_CHECK(cublasSetPointerMode(handle, mode));
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
~PointerModeGuard() {
|
| 32 |
+
cublasSetPointerMode(handle, previous_mode);
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
private:
|
| 36 |
+
cublasHandle_t handle;
|
| 37 |
+
cublasPointerMode_t previous_mode;
|
| 38 |
+
};
|
| 39 |
+
|
| 40 |
+
/* LEVEL 3 BLAS FUNCTIONS */
|
| 41 |
+
|
| 42 |
+
#define CUDABLAS_GEMM_ARGTYPES(Dtype) \
|
| 43 |
+
char transa, char transb, int64_t m, int64_t n, int64_t k, at::opmath_type<Dtype> alpha, \
|
| 44 |
+
const Dtype *a, int64_t lda, const Dtype *b, int64_t ldb, at::opmath_type<Dtype> beta,\
|
| 45 |
+
Dtype *c, int64_t ldc
|
| 46 |
+
|
| 47 |
+
#define CUDABLAS_GEMM_ARGS(Dtype) transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc
|
| 48 |
+
|
| 49 |
+
template <typename Dtype>
|
| 50 |
+
inline void gemm(CUDABLAS_GEMM_ARGTYPES(Dtype)) {
|
| 51 |
+
static_assert(false&&sizeof(Dtype),"at::cuda::blas::gemm: not implemented");
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
template <>
|
| 55 |
+
void gemm<double>(CUDABLAS_GEMM_ARGTYPES(double));
|
| 56 |
+
template <>
|
| 57 |
+
void gemm<float>(CUDABLAS_GEMM_ARGTYPES(float));
|
| 58 |
+
template <>
|
| 59 |
+
void gemm<c10::complex<double>>(CUDABLAS_GEMM_ARGTYPES(c10::complex<double>));
|
| 60 |
+
template <>
|
| 61 |
+
void gemm<c10::complex<float>>(CUDABLAS_GEMM_ARGTYPES(c10::complex<float>));
|
| 62 |
+
template <>
|
| 63 |
+
void gemm<at::Half>(CUDABLAS_GEMM_ARGTYPES(at::Half));
|
| 64 |
+
template <>
|
| 65 |
+
void gemm<at::BFloat16>(CUDABLAS_GEMM_ARGTYPES(at::BFloat16));
|
| 66 |
+
|
| 67 |
+
template <typename Dtype>
|
| 68 |
+
inline void gemm_internal(CUDABLAS_GEMM_ARGTYPES(Dtype)) {
|
| 69 |
+
static_assert(false&&sizeof(Dtype),"at::cuda::blas::gemm_internal: not implemented");
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
template <>
|
| 73 |
+
void gemm_internal<double>(CUDABLAS_GEMM_ARGTYPES(double));
|
| 74 |
+
template <>
|
| 75 |
+
void gemm_internal<float>(CUDABLAS_GEMM_ARGTYPES(float));
|
| 76 |
+
template <>
|
| 77 |
+
void gemm_internal<c10::complex<double>>(CUDABLAS_GEMM_ARGTYPES(c10::complex<double>));
|
| 78 |
+
template <>
|
| 79 |
+
void gemm_internal<c10::complex<float>>(CUDABLAS_GEMM_ARGTYPES(c10::complex<float>));
|
| 80 |
+
template <>
|
| 81 |
+
void gemm_internal<at::Half>(CUDABLAS_GEMM_ARGTYPES(at::Half));
|
| 82 |
+
template <>
|
| 83 |
+
void gemm_internal<at::BFloat16>(CUDABLAS_GEMM_ARGTYPES(at::BFloat16));
|
| 84 |
+
|
| 85 |
+
enum GEMMAndBiasActivationEpilogue {
|
| 86 |
+
None,
|
| 87 |
+
RELU,
|
| 88 |
+
GELU,
|
| 89 |
+
};
|
| 90 |
+
|
| 91 |
+
// NOTE: GELU activation is not supported prior to CUDA 11.4 and will
|
| 92 |
+
// do nothing if passed in that case.
|
| 93 |
+
template <typename Dtype>
|
| 94 |
+
void gemm_and_bias(
|
| 95 |
+
bool transpose_mat1,
|
| 96 |
+
bool transpose_mat2,
|
| 97 |
+
int64_t m,
|
| 98 |
+
int64_t n,
|
| 99 |
+
int64_t k,
|
| 100 |
+
at::opmath_type<Dtype> alpha_val,
|
| 101 |
+
const Dtype* mat1_ptr,
|
| 102 |
+
int64_t mat1_ld,
|
| 103 |
+
const Dtype* mat2_ptr,
|
| 104 |
+
int64_t mat2_ld,
|
| 105 |
+
const Dtype* bias,
|
| 106 |
+
Dtype* result_ptr,
|
| 107 |
+
int64_t result_ld,
|
| 108 |
+
GEMMAndBiasActivationEpilogue activation = GEMMAndBiasActivationEpilogue::None);
|
| 109 |
+
|
| 110 |
+
void int8_gemm(
|
| 111 |
+
bool transpose_mat1,
|
| 112 |
+
bool transpose_mat2,
|
| 113 |
+
int64_t m,
|
| 114 |
+
int64_t n,
|
| 115 |
+
int64_t k,
|
| 116 |
+
const int8_t* mat1_ptr,
|
| 117 |
+
int64_t mat1_ld,
|
| 118 |
+
const int8_t* mat2_ptr,
|
| 119 |
+
int64_t mat2_ld,
|
| 120 |
+
int32_t* result_ptr,
|
| 121 |
+
int64_t result_ld);
|
| 122 |
+
|
| 123 |
+
void scaled_gemm(
|
| 124 |
+
char transa,
|
| 125 |
+
char transb,
|
| 126 |
+
int64_t m,
|
| 127 |
+
int64_t n,
|
| 128 |
+
int64_t k,
|
| 129 |
+
const void* mat1_ptr,
|
| 130 |
+
const void* mat1_scale_ptr,
|
| 131 |
+
int64_t mat1_ld,
|
| 132 |
+
ScalarType mat1_dtype,
|
| 133 |
+
const void* mat2_ptr,
|
| 134 |
+
const void* mat2_scale_ptr,
|
| 135 |
+
int64_t mat2_ld,
|
| 136 |
+
ScalarType mat2_dtype,
|
| 137 |
+
const void* bias_ptr,
|
| 138 |
+
ScalarType bias_dtype,
|
| 139 |
+
void* result_ptr,
|
| 140 |
+
const void* result_scale_ptr,
|
| 141 |
+
int64_t result_ld,
|
| 142 |
+
ScalarType result_dtype,
|
| 143 |
+
void* amax_ptr,
|
| 144 |
+
bool use_fast_accum);
|
| 145 |
+
|
| 146 |
+
#define CUDABLAS_BGEMM_ARGTYPES(Dtype) \
|
| 147 |
+
char transa, char transb, int64_t m, int64_t n, int64_t k, at::opmath_type<Dtype> alpha, \
|
| 148 |
+
const Dtype *a, int64_t lda, int64_t stridea, \
|
| 149 |
+
const Dtype *b, int64_t ldb, int64_t strideb, \
|
| 150 |
+
at::opmath_type<Dtype> beta, Dtype *c, int64_t ldc, int64_t stridec, int64_t num_batches
|
| 151 |
+
|
| 152 |
+
#define CUDABLAS_BGEMM_ARGS(Dtype) \
|
| 153 |
+
transa, transb, m, n, k, alpha, a, lda, stridea, b, ldb, strideb, beta, c, ldc, stridec, num_batches
|
| 154 |
+
|
| 155 |
+
template <typename Dtype>
|
| 156 |
+
inline void bgemm(CUDABLAS_BGEMM_ARGTYPES(Dtype)) {
|
| 157 |
+
static_assert(false&&sizeof(Dtype),"at::cuda::blas::bgemm: not implemented");
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
template <>
|
| 161 |
+
void bgemm<double>(CUDABLAS_BGEMM_ARGTYPES(double));
|
| 162 |
+
template <>
|
| 163 |
+
void bgemm<float>(CUDABLAS_BGEMM_ARGTYPES(float));
|
| 164 |
+
template <>
|
| 165 |
+
void bgemm<c10::complex<double>>(CUDABLAS_BGEMM_ARGTYPES(c10::complex<double>));
|
| 166 |
+
template <>
|
| 167 |
+
void bgemm<c10::complex<float>>(CUDABLAS_BGEMM_ARGTYPES(c10::complex<float>));
|
| 168 |
+
template <>
|
| 169 |
+
void bgemm<at::Half>(CUDABLAS_BGEMM_ARGTYPES(at::Half));
|
| 170 |
+
template <>
|
| 171 |
+
void bgemm<at::BFloat16>(CUDABLAS_BGEMM_ARGTYPES(at::BFloat16));
|
| 172 |
+
|
| 173 |
+
template <typename Dtype>
|
| 174 |
+
inline void bgemm_internal(CUDABLAS_BGEMM_ARGTYPES(Dtype)) {
|
| 175 |
+
static_assert(false&&sizeof(Dtype),"at::cuda::blas::bgemm_internal: not implemented");
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
template <>
|
| 179 |
+
void bgemm_internal<double>(CUDABLAS_BGEMM_ARGTYPES(double));
|
| 180 |
+
template <>
|
| 181 |
+
void bgemm_internal<float>(CUDABLAS_BGEMM_ARGTYPES(float));
|
| 182 |
+
template <>
|
| 183 |
+
void bgemm_internal<c10::complex<double>>(CUDABLAS_BGEMM_ARGTYPES(c10::complex<double>));
|
| 184 |
+
template <>
|
| 185 |
+
void bgemm_internal<c10::complex<float>>(CUDABLAS_BGEMM_ARGTYPES(c10::complex<float>));
|
| 186 |
+
template <>
|
| 187 |
+
void bgemm_internal<at::Half>(CUDABLAS_BGEMM_ARGTYPES(at::Half));
|
| 188 |
+
template <>
|
| 189 |
+
void bgemm_internal<at::BFloat16>(CUDABLAS_BGEMM_ARGTYPES(at::BFloat16));
|
| 190 |
+
|
| 191 |
+
#define CUDABLAS_TRSM_ARGTYPES(Dtype) \
|
| 192 |
+
cublasHandle_t handle, cublasSideMode_t side, cublasFillMode_t uplo, \
|
| 193 |
+
cublasOperation_t trans, cublasDiagType_t diag, int m, int n, \
|
| 194 |
+
const Dtype *alpha, const Dtype *A, int lda, Dtype *B, int ldb
|
| 195 |
+
|
| 196 |
+
template <typename Dtype>
|
| 197 |
+
inline void trsm(CUDABLAS_TRSM_ARGTYPES(Dtype)) {
|
| 198 |
+
static_assert(false&&sizeof(Dtype), "at::cuda::blas::trsm: not implemented");
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
template <>
|
| 202 |
+
TORCH_CUDA_CU_API void trsm<float>(CUDABLAS_TRSM_ARGTYPES(float));
|
| 203 |
+
template <>
|
| 204 |
+
TORCH_CUDA_CU_API void trsm<double>(CUDABLAS_TRSM_ARGTYPES(double));
|
| 205 |
+
template <>
|
| 206 |
+
TORCH_CUDA_CU_API void trsm<c10::complex<float>>(CUDABLAS_TRSM_ARGTYPES(c10::complex<float>));
|
| 207 |
+
template <>
|
| 208 |
+
TORCH_CUDA_CU_API void trsm<c10::complex<double>>(CUDABLAS_TRSM_ARGTYPES(c10::complex<double>));
|
| 209 |
+
|
| 210 |
+
#define CUDABLAS_TRSM_BATCHED_ARGTYPES(Dtype) \
|
| 211 |
+
cublasHandle_t handle, cublasSideMode_t side, cublasFillMode_t uplo, \
|
| 212 |
+
cublasOperation_t trans, cublasDiagType_t diag, int m, int n, \
|
| 213 |
+
const Dtype *alpha, Dtype *A[], int lda, Dtype *B[], int ldb, \
|
| 214 |
+
int batchCount
|
| 215 |
+
|
| 216 |
+
template <typename Dtype>
|
| 217 |
+
inline void trsmBatched(CUDABLAS_TRSM_BATCHED_ARGTYPES(Dtype)) {
|
| 218 |
+
static_assert(false&&sizeof(Dtype), "at::cuda::blas::trsmBatched: not implemented");
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
template <>
|
| 222 |
+
TORCH_CUDA_CU_API void trsmBatched<float>(CUDABLAS_TRSM_BATCHED_ARGTYPES(float));
|
| 223 |
+
template <>
|
| 224 |
+
TORCH_CUDA_CU_API void trsmBatched<double>(CUDABLAS_TRSM_BATCHED_ARGTYPES(double));
|
| 225 |
+
template <>
|
| 226 |
+
TORCH_CUDA_CU_API void trsmBatched<c10::complex<float>>(CUDABLAS_TRSM_BATCHED_ARGTYPES(c10::complex<float>));
|
| 227 |
+
template <>
|
| 228 |
+
TORCH_CUDA_CU_API void trsmBatched<c10::complex<double>>(CUDABLAS_TRSM_BATCHED_ARGTYPES(c10::complex<double>));
|
| 229 |
+
|
| 230 |
+
/* LEVEL 2 BLAS FUNCTIONS */
|
| 231 |
+
|
| 232 |
+
#define CUDABLAS_GEMV_ARGTYPES(Dtype) \
|
| 233 |
+
char trans, int64_t m, int64_t n, Dtype alpha, const Dtype *a, int64_t lda, \
|
| 234 |
+
const Dtype *x, int64_t incx, Dtype beta, Dtype *y, int64_t incy
|
| 235 |
+
|
| 236 |
+
template <typename Dtype>
|
| 237 |
+
inline void gemv(CUDABLAS_GEMV_ARGTYPES(Dtype)) {
|
| 238 |
+
static_assert(false&&sizeof(Dtype), "at::cuda::blas::gemv: not implemented");
|
| 239 |
+
}
|
| 240 |
+
|
| 241 |
+
template <>
|
| 242 |
+
void gemv<double>(CUDABLAS_GEMV_ARGTYPES(double));
|
| 243 |
+
template <>
|
| 244 |
+
void gemv<float>(CUDABLAS_GEMV_ARGTYPES(float));
|
| 245 |
+
template <>
|
| 246 |
+
void gemv<c10::complex<double>>(CUDABLAS_GEMV_ARGTYPES(c10::complex<double>));
|
| 247 |
+
template <>
|
| 248 |
+
void gemv<c10::complex<float>>(CUDABLAS_GEMV_ARGTYPES(c10::complex<float>));
|
| 249 |
+
template <>
|
| 250 |
+
void gemv<at::Half>(CUDABLAS_GEMV_ARGTYPES(at::Half));
|
| 251 |
+
template <>
|
| 252 |
+
void gemv<at::BFloat16>(CUDABLAS_GEMV_ARGTYPES(at::BFloat16));
|
| 253 |
+
|
| 254 |
+
/* LEVEL 1 BLAS FUNCTIONS */
|
| 255 |
+
|
| 256 |
+
#define CUDABLAS_DOT_ARGTYPES(Dtype) \
|
| 257 |
+
cublasHandle_t handle, int n, const Dtype *x, int incx, const Dtype *y, \
|
| 258 |
+
int incy, Dtype *result
|
| 259 |
+
|
| 260 |
+
template <typename Dtype>
|
| 261 |
+
inline void dot(CUDABLAS_DOT_ARGTYPES(Dtype)) {
|
| 262 |
+
static_assert(false&&sizeof(Dtype),"at::cuda::blas::dot: not implemented");
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
template <>
|
| 266 |
+
void dot<double>(CUDABLAS_DOT_ARGTYPES(double));
|
| 267 |
+
template <>
|
| 268 |
+
void dot<float>(CUDABLAS_DOT_ARGTYPES(float));
|
| 269 |
+
template <>
|
| 270 |
+
void dot<at::Half>(CUDABLAS_DOT_ARGTYPES(at::Half));
|
| 271 |
+
template <>
|
| 272 |
+
void dot<at::BFloat16>(CUDABLAS_DOT_ARGTYPES(at::BFloat16));
|
| 273 |
+
template <>
|
| 274 |
+
void dot<c10::complex<double>>(CUDABLAS_DOT_ARGTYPES(c10::complex<double>));
|
| 275 |
+
template <>
|
| 276 |
+
void dot<c10::complex<float>>(CUDABLAS_DOT_ARGTYPES(c10::complex<float>));
|
| 277 |
+
|
| 278 |
+
template <typename Dtype>
|
| 279 |
+
inline void vdot(CUDABLAS_DOT_ARGTYPES(Dtype)) {
|
| 280 |
+
static_assert(false&&sizeof(Dtype),"at::cuda::blas::vdot: not implemented");
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
template <>
|
| 284 |
+
void vdot<c10::complex<float>>(CUDABLAS_DOT_ARGTYPES(c10::complex<float>));
|
| 285 |
+
template <>
|
| 286 |
+
void vdot<c10::complex<double>>(CUDABLAS_DOT_ARGTYPES(c10::complex<double>));
|
| 287 |
+
|
| 288 |
+
#define CUDABLAS_GETRS_ARGTYPES(Dtype) \
|
| 289 |
+
cublasHandle_t handle, cublasOperation_t trans, \
|
| 290 |
+
int n, int nrhs, Dtype** dA_array, int lda, int* ipiv_array, \
|
| 291 |
+
Dtype** dB_array, int ldb, int* info_array, int batchsize
|
| 292 |
+
|
| 293 |
+
template<class Dtype>
|
| 294 |
+
void getrsBatched(CUDABLAS_GETRS_ARGTYPES(Dtype)) {
|
| 295 |
+
static_assert(false&&sizeof(Dtype),"at::cuda::blas::getrsBatched: not implemented");
|
| 296 |
+
}
|
| 297 |
+
template<>
|
| 298 |
+
TORCH_CUDA_CU_API void getrsBatched<float>(CUDABLAS_GETRS_ARGTYPES(float));
|
| 299 |
+
template<>
|
| 300 |
+
TORCH_CUDA_CU_API void getrsBatched<double>(CUDABLAS_GETRS_ARGTYPES(double));
|
| 301 |
+
template<>
|
| 302 |
+
TORCH_CUDA_CU_API void getrsBatched<c10::complex<float>>(CUDABLAS_GETRS_ARGTYPES(c10::complex<float>));
|
| 303 |
+
template<>
|
| 304 |
+
TORCH_CUDA_CU_API void getrsBatched<c10::complex<double>>(CUDABLAS_GETRS_ARGTYPES(c10::complex<double>));
|
| 305 |
+
|
| 306 |
+
#define CUDABLAS_GEQRF_BATCHED_ARGTYPES(Dtype) \
|
| 307 |
+
cublasHandle_t handle, int m, int n, Dtype **A_array, int lda, \
|
| 308 |
+
Dtype **tau_array, int *info, int batchsize
|
| 309 |
+
|
| 310 |
+
template <class Dtype>
|
| 311 |
+
void geqrfBatched(CUDABLAS_GEQRF_BATCHED_ARGTYPES(Dtype)) {
|
| 312 |
+
static_assert(false&&sizeof(Dtype), "at::cuda::blas::geqrfBatched: not implemented");
|
| 313 |
+
}
|
| 314 |
+
template <>
|
| 315 |
+
TORCH_CUDA_CU_API void geqrfBatched<float>(CUDABLAS_GEQRF_BATCHED_ARGTYPES(float));
|
| 316 |
+
template <>
|
| 317 |
+
TORCH_CUDA_CU_API void geqrfBatched<double>(CUDABLAS_GEQRF_BATCHED_ARGTYPES(double));
|
| 318 |
+
template <>
|
| 319 |
+
TORCH_CUDA_CU_API void geqrfBatched<c10::complex<double>>(
|
| 320 |
+
CUDABLAS_GEQRF_BATCHED_ARGTYPES(c10::complex<double>));
|
| 321 |
+
template <>
|
| 322 |
+
TORCH_CUDA_CU_API void geqrfBatched<c10::complex<float>>(
|
| 323 |
+
CUDABLAS_GEQRF_BATCHED_ARGTYPES(c10::complex<float>));
|
| 324 |
+
|
| 325 |
+
#define CUDABLAS_GETRF_ARGTYPES(Dtype) \
|
| 326 |
+
int n, Dtype** dA_array, int ldda, int* ipiv_array, int* info_array, int batchsize
|
| 327 |
+
|
| 328 |
+
template<class Dtype>
|
| 329 |
+
void getrfBatched(CUDABLAS_GETRF_ARGTYPES(Dtype)) {
|
| 330 |
+
TORCH_CHECK(false, "at::cuda::blas::getrfBatched: not implemented");
|
| 331 |
+
}
|
| 332 |
+
template<>
|
| 333 |
+
TORCH_CUDA_CU_API void getrfBatched<float>(CUDABLAS_GETRF_ARGTYPES(float));
|
| 334 |
+
template<>
|
| 335 |
+
TORCH_CUDA_CU_API void getrfBatched<double>(CUDABLAS_GETRF_ARGTYPES(double));
|
| 336 |
+
template<>
|
| 337 |
+
TORCH_CUDA_CU_API void getrfBatched<c10::complex<double>>(CUDABLAS_GETRF_ARGTYPES(c10::complex<double>));
|
| 338 |
+
template<>
|
| 339 |
+
TORCH_CUDA_CU_API void getrfBatched<c10::complex<float>>(CUDABLAS_GETRF_ARGTYPES(c10::complex<float>));
|
| 340 |
+
|
| 341 |
+
#define CUDABLAS_GELS_BATCHED_ARGTYPES(Dtype) \
|
| 342 |
+
cublasHandle_t handle, cublasOperation_t trans, int m, int n, int nrhs, Dtype** dA_array, int ldda, Dtype** dC_array, int lddc, int* info, int *devInfoArray, int batchSize
|
| 343 |
+
|
| 344 |
+
template <class Dtype>
|
| 345 |
+
void gelsBatched(CUDABLAS_GELS_BATCHED_ARGTYPES(Dtype)) {
|
| 346 |
+
static_assert(false&&sizeof(Dtype),"at::cuda::blas::gelsBatched: not implemented");
|
| 347 |
+
}
|
| 348 |
+
|
| 349 |
+
template<>
|
| 350 |
+
TORCH_CUDA_CU_API void gelsBatched<double>(CUDABLAS_GELS_BATCHED_ARGTYPES(double));
|
| 351 |
+
template<>
|
| 352 |
+
TORCH_CUDA_CU_API void gelsBatched<float>(CUDABLAS_GELS_BATCHED_ARGTYPES(float));
|
| 353 |
+
template<>
|
| 354 |
+
TORCH_CUDA_CU_API void gelsBatched<c10::complex<double>>(CUDABLAS_GELS_BATCHED_ARGTYPES(c10::complex<double>));
|
| 355 |
+
template<>
|
| 356 |
+
TORCH_CUDA_CU_API void gelsBatched<c10::complex<float>>(CUDABLAS_GELS_BATCHED_ARGTYPES(c10::complex<float>));
|
| 357 |
+
|
| 358 |
+
} // namespace at::cuda::blas
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAConfig.h
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
// Test these using #if AT_CUDNN_ENABLED(), not #ifdef, so that it's
|
| 4 |
+
// obvious if you forgot to include Config.h
|
| 5 |
+
// c.f. https://stackoverflow.com/questions/33759787/generating-an-error-if-checked-boolean-macro-is-not-defined
|
| 6 |
+
//
|
| 7 |
+
// NB: This header MUST NOT be included from other headers; it should
|
| 8 |
+
// only be included from C++ files.
|
| 9 |
+
#define AT_CUDNN_ENABLED() 1
|
| 10 |
+
#define AT_CUSPARSELT_ENABLED() 1
|
| 11 |
+
#define AT_ROCM_ENABLED() 0
|
| 12 |
+
#define AT_MAGMA_ENABLED() 1
|
| 13 |
+
|
| 14 |
+
// Needed for hipMAGMA to correctly identify implementation
|
| 15 |
+
#if (AT_ROCM_ENABLED() && AT_MAGMA_ENABLED())
|
| 16 |
+
#define HAVE_HIP 1
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
#define NVCC_FLAGS_EXTRA "-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_90,code=sm_90"
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAContextLight.h
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
// Light-weight version of CUDAContext.h with fewer transitive includes
|
| 3 |
+
|
| 4 |
+
#include <cstdint>
|
| 5 |
+
|
| 6 |
+
#include <cuda_runtime_api.h>
|
| 7 |
+
#include <cusparse.h>
|
| 8 |
+
#include <cublas_v2.h>
|
| 9 |
+
|
| 10 |
+
// cublasLT was introduced in CUDA 10.1 but we enable only for 11.1 that also
|
| 11 |
+
// added bf16 support
|
| 12 |
+
#include <cublasLt.h>
|
| 13 |
+
|
| 14 |
+
#ifdef CUDART_VERSION
|
| 15 |
+
#include <cusolverDn.h>
|
| 16 |
+
#endif
|
| 17 |
+
|
| 18 |
+
#if defined(USE_CUDSS)
|
| 19 |
+
#include <cudss.h>
|
| 20 |
+
#endif
|
| 21 |
+
|
| 22 |
+
#if defined(USE_ROCM)
|
| 23 |
+
#include <hipsolver/hipsolver.h>
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
#include <c10/core/Allocator.h>
|
| 27 |
+
#include <c10/cuda/CUDAFunctions.h>
|
| 28 |
+
|
| 29 |
+
namespace c10 {
|
| 30 |
+
struct Allocator;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
namespace at::cuda {
|
| 34 |
+
|
| 35 |
+
/*
|
| 36 |
+
A common CUDA interface for ATen.
|
| 37 |
+
|
| 38 |
+
This interface is distinct from CUDAHooks, which defines an interface that links
|
| 39 |
+
to both CPU-only and CUDA builds. That interface is intended for runtime
|
| 40 |
+
dispatch and should be used from files that are included in both CPU-only and
|
| 41 |
+
CUDA builds.
|
| 42 |
+
|
| 43 |
+
CUDAContext, on the other hand, should be preferred by files only included in
|
| 44 |
+
CUDA builds. It is intended to expose CUDA functionality in a consistent
|
| 45 |
+
manner.
|
| 46 |
+
|
| 47 |
+
This means there is some overlap between the CUDAContext and CUDAHooks, but
|
| 48 |
+
the choice of which to use is simple: use CUDAContext when in a CUDA-only file,
|
| 49 |
+
use CUDAHooks otherwise.
|
| 50 |
+
|
| 51 |
+
Note that CUDAContext simply defines an interface with no associated class.
|
| 52 |
+
It is expected that the modules whose functions compose this interface will
|
| 53 |
+
manage their own state. There is only a single CUDA context/state.
|
| 54 |
+
*/
|
| 55 |
+
|
| 56 |
+
/**
|
| 57 |
+
* DEPRECATED: use device_count() instead
|
| 58 |
+
*/
|
| 59 |
+
inline int64_t getNumGPUs() {
|
| 60 |
+
return c10::cuda::device_count();
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
/**
|
| 64 |
+
* CUDA is available if we compiled with CUDA, and there are one or more
|
| 65 |
+
* devices. If we compiled with CUDA but there is a driver problem, etc.,
|
| 66 |
+
* this function will report CUDA is not available (rather than raise an error.)
|
| 67 |
+
*/
|
| 68 |
+
inline bool is_available() {
|
| 69 |
+
return c10::cuda::device_count() > 0;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
TORCH_CUDA_CPP_API cudaDeviceProp* getCurrentDeviceProperties();
|
| 73 |
+
|
| 74 |
+
TORCH_CUDA_CPP_API int warp_size();
|
| 75 |
+
|
| 76 |
+
TORCH_CUDA_CPP_API cudaDeviceProp* getDeviceProperties(c10::DeviceIndex device);
|
| 77 |
+
|
| 78 |
+
TORCH_CUDA_CPP_API bool canDeviceAccessPeer(
|
| 79 |
+
c10::DeviceIndex device,
|
| 80 |
+
c10::DeviceIndex peer_device);
|
| 81 |
+
|
| 82 |
+
TORCH_CUDA_CPP_API c10::Allocator* getCUDADeviceAllocator();
|
| 83 |
+
|
| 84 |
+
/* Handles */
|
| 85 |
+
TORCH_CUDA_CPP_API cusparseHandle_t getCurrentCUDASparseHandle();
|
| 86 |
+
TORCH_CUDA_CPP_API cublasHandle_t getCurrentCUDABlasHandle();
|
| 87 |
+
TORCH_CUDA_CPP_API cublasLtHandle_t getCurrentCUDABlasLtHandle();
|
| 88 |
+
|
| 89 |
+
TORCH_CUDA_CPP_API void clearCublasWorkspaces();
|
| 90 |
+
|
| 91 |
+
#if defined(CUDART_VERSION) || defined(USE_ROCM)
|
| 92 |
+
TORCH_CUDA_CPP_API cusolverDnHandle_t getCurrentCUDASolverDnHandle();
|
| 93 |
+
#endif
|
| 94 |
+
|
| 95 |
+
#if defined(USE_CUDSS)
|
| 96 |
+
TORCH_CUDA_CPP_API cudssHandle_t getCurrentCudssHandle();
|
| 97 |
+
#endif
|
| 98 |
+
|
| 99 |
+
} // namespace at::cuda
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDADataType.h
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <c10/core/ScalarType.h>
|
| 4 |
+
|
| 5 |
+
#include <cuda.h>
|
| 6 |
+
#include <library_types.h>
|
| 7 |
+
|
| 8 |
+
namespace at::cuda {
|
| 9 |
+
|
| 10 |
+
template <typename scalar_t>
|
| 11 |
+
cudaDataType getCudaDataType() {
|
| 12 |
+
static_assert(false && sizeof(scalar_t), "Cannot convert type to cudaDataType.");
|
| 13 |
+
return {};
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
template<> inline cudaDataType getCudaDataType<at::Half>() {
|
| 17 |
+
return CUDA_R_16F;
|
| 18 |
+
}
|
| 19 |
+
template<> inline cudaDataType getCudaDataType<float>() {
|
| 20 |
+
return CUDA_R_32F;
|
| 21 |
+
}
|
| 22 |
+
template<> inline cudaDataType getCudaDataType<double>() {
|
| 23 |
+
return CUDA_R_64F;
|
| 24 |
+
}
|
| 25 |
+
template<> inline cudaDataType getCudaDataType<c10::complex<c10::Half>>() {
|
| 26 |
+
return CUDA_C_16F;
|
| 27 |
+
}
|
| 28 |
+
template<> inline cudaDataType getCudaDataType<c10::complex<float>>() {
|
| 29 |
+
return CUDA_C_32F;
|
| 30 |
+
}
|
| 31 |
+
template<> inline cudaDataType getCudaDataType<c10::complex<double>>() {
|
| 32 |
+
return CUDA_C_64F;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
template<> inline cudaDataType getCudaDataType<uint8_t>() {
|
| 36 |
+
return CUDA_R_8U;
|
| 37 |
+
}
|
| 38 |
+
template<> inline cudaDataType getCudaDataType<int8_t>() {
|
| 39 |
+
return CUDA_R_8I;
|
| 40 |
+
}
|
| 41 |
+
template<> inline cudaDataType getCudaDataType<int>() {
|
| 42 |
+
return CUDA_R_32I;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
template<> inline cudaDataType getCudaDataType<int16_t>() {
|
| 46 |
+
return CUDA_R_16I;
|
| 47 |
+
}
|
| 48 |
+
template<> inline cudaDataType getCudaDataType<int64_t>() {
|
| 49 |
+
return CUDA_R_64I;
|
| 50 |
+
}
|
| 51 |
+
template<> inline cudaDataType getCudaDataType<at::BFloat16>() {
|
| 52 |
+
return CUDA_R_16BF;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
inline cudaDataType ScalarTypeToCudaDataType(const c10::ScalarType& scalar_type) {
|
| 56 |
+
switch (scalar_type) {
|
| 57 |
+
case c10::ScalarType::Byte:
|
| 58 |
+
return CUDA_R_8U;
|
| 59 |
+
case c10::ScalarType::Char:
|
| 60 |
+
return CUDA_R_8I;
|
| 61 |
+
case c10::ScalarType::Int:
|
| 62 |
+
return CUDA_R_32I;
|
| 63 |
+
case c10::ScalarType::Half:
|
| 64 |
+
return CUDA_R_16F;
|
| 65 |
+
case c10::ScalarType::Float:
|
| 66 |
+
return CUDA_R_32F;
|
| 67 |
+
case c10::ScalarType::Double:
|
| 68 |
+
return CUDA_R_64F;
|
| 69 |
+
case c10::ScalarType::ComplexHalf:
|
| 70 |
+
return CUDA_C_16F;
|
| 71 |
+
case c10::ScalarType::ComplexFloat:
|
| 72 |
+
return CUDA_C_32F;
|
| 73 |
+
case c10::ScalarType::ComplexDouble:
|
| 74 |
+
return CUDA_C_64F;
|
| 75 |
+
case c10::ScalarType::Short:
|
| 76 |
+
return CUDA_R_16I;
|
| 77 |
+
case c10::ScalarType::Long:
|
| 78 |
+
return CUDA_R_64I;
|
| 79 |
+
case c10::ScalarType::BFloat16:
|
| 80 |
+
return CUDA_R_16BF;
|
| 81 |
+
#if defined(CUDA_VERSION) && CUDA_VERSION >= 11080
|
| 82 |
+
case c10::ScalarType::Float8_e4m3fn:
|
| 83 |
+
return CUDA_R_8F_E4M3;
|
| 84 |
+
case c10::ScalarType::Float8_e5m2:
|
| 85 |
+
return CUDA_R_8F_E5M2;
|
| 86 |
+
#endif
|
| 87 |
+
#if defined(USE_ROCM)
|
| 88 |
+
#if defined(HIP_NEW_TYPE_ENUMS)
|
| 89 |
+
case c10::ScalarType::Float8_e4m3fnuz:
|
| 90 |
+
return HIP_R_8F_E4M3_FNUZ;
|
| 91 |
+
case c10::ScalarType::Float8_e5m2fnuz:
|
| 92 |
+
return HIP_R_8F_E5M2_FNUZ;
|
| 93 |
+
#else
|
| 94 |
+
case c10::ScalarType::Float8_e4m3fnuz:
|
| 95 |
+
return static_cast<hipDataType>(1000);
|
| 96 |
+
case c10::ScalarType::Float8_e5m2fnuz:
|
| 97 |
+
return static_cast<hipDataType>(1001);
|
| 98 |
+
#endif
|
| 99 |
+
#endif
|
| 100 |
+
default:
|
| 101 |
+
TORCH_INTERNAL_ASSERT(false, "Cannot convert ScalarType ", scalar_type, " to cudaDataType.")
|
| 102 |
+
}
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
} // namespace at::cuda
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDADevice.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <ATen/cuda/Exceptions.h>
|
| 4 |
+
|
| 5 |
+
#include <cuda.h>
|
| 6 |
+
#include <cuda_runtime.h>
|
| 7 |
+
|
| 8 |
+
namespace at::cuda {
|
| 9 |
+
|
| 10 |
+
inline Device getDeviceFromPtr(void* ptr) {
|
| 11 |
+
cudaPointerAttributes attr{};
|
| 12 |
+
|
| 13 |
+
AT_CUDA_CHECK(cudaPointerGetAttributes(&attr, ptr));
|
| 14 |
+
|
| 15 |
+
#if !defined(USE_ROCM)
|
| 16 |
+
TORCH_CHECK(attr.type != cudaMemoryTypeUnregistered,
|
| 17 |
+
"The specified pointer resides on host memory and is not registered with any CUDA device.");
|
| 18 |
+
#endif
|
| 19 |
+
|
| 20 |
+
return {c10::DeviceType::CUDA, static_cast<DeviceIndex>(attr.device)};
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
} // namespace at::cuda
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAEvent.h
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <ATen/cuda/ATenCUDAGeneral.h>
|
| 4 |
+
#include <ATen/cuda/CUDAContext.h>
|
| 5 |
+
#include <c10/core/impl/GPUTrace.h>
|
| 6 |
+
#include <c10/cuda/CUDAStream.h>
|
| 7 |
+
#include <c10/cuda/CUDAGuard.h>
|
| 8 |
+
#include <ATen/cuda/Exceptions.h>
|
| 9 |
+
#include <c10/util/Exception.h>
|
| 10 |
+
|
| 11 |
+
#include <cuda_runtime_api.h>
|
| 12 |
+
|
| 13 |
+
#include <cstdint>
|
| 14 |
+
#include <utility>
|
| 15 |
+
|
| 16 |
+
namespace at::cuda {
|
| 17 |
+
|
| 18 |
+
/*
|
| 19 |
+
* CUDAEvents are movable not copyable wrappers around CUDA's events.
|
| 20 |
+
*
|
| 21 |
+
* CUDAEvents are constructed lazily when first recorded unless it is
|
| 22 |
+
* reconstructed from a cudaIpcEventHandle_t. The event has a device, and this
|
| 23 |
+
* device is acquired from the first recording stream. However, if reconstructed
|
| 24 |
+
* from a handle, the device should be explicitly specified; or if ipc_handle() is
|
| 25 |
+
* called before the event is ever recorded, it will use the current device.
|
| 26 |
+
* Later streams that record the event must match this device.
|
| 27 |
+
*/
|
| 28 |
+
struct TORCH_CUDA_CPP_API CUDAEvent {
|
| 29 |
+
// Constructors
|
| 30 |
+
// Default value for `flags` is specified below - it's cudaEventDisableTiming
|
| 31 |
+
CUDAEvent() noexcept = default;
|
| 32 |
+
CUDAEvent(unsigned int flags) noexcept : flags_{flags} {}
|
| 33 |
+
|
| 34 |
+
CUDAEvent(
|
| 35 |
+
DeviceIndex device_index, const cudaIpcEventHandle_t* handle) : device_index_(device_index) {
|
| 36 |
+
CUDAGuard guard(device_index_);
|
| 37 |
+
|
| 38 |
+
AT_CUDA_CHECK(cudaIpcOpenEventHandle(&event_, *handle));
|
| 39 |
+
is_created_ = true;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
// Note: event destruction done on creating device to avoid creating a
|
| 43 |
+
// CUDA context on other devices.
|
| 44 |
+
~CUDAEvent() {
|
| 45 |
+
try {
|
| 46 |
+
if (is_created_) {
|
| 47 |
+
CUDAGuard guard(device_index_);
|
| 48 |
+
const c10::impl::PyInterpreter* interp = c10::impl::GPUTrace::get_trace();
|
| 49 |
+
if (C10_UNLIKELY(interp)) {
|
| 50 |
+
(*interp)->trace_gpu_event_deletion(at::kCUDA, reinterpret_cast<uintptr_t>(event_));
|
| 51 |
+
}
|
| 52 |
+
AT_CUDA_CHECK(cudaEventDestroy(event_));
|
| 53 |
+
}
|
| 54 |
+
} catch (...) { /* No throw */ }
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
CUDAEvent(const CUDAEvent&) = delete;
|
| 58 |
+
CUDAEvent& operator=(const CUDAEvent&) = delete;
|
| 59 |
+
|
| 60 |
+
CUDAEvent(CUDAEvent&& other) noexcept { moveHelper(std::move(other)); }
|
| 61 |
+
CUDAEvent& operator=(CUDAEvent&& other) noexcept {
|
| 62 |
+
if (this != &other) {
|
| 63 |
+
moveHelper(std::move(other));
|
| 64 |
+
}
|
| 65 |
+
return *this;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
operator cudaEvent_t() const { return event(); }
|
| 69 |
+
|
| 70 |
+
// Less than operator (to allow use in sets)
|
| 71 |
+
friend bool operator<(const CUDAEvent& left, const CUDAEvent& right) {
|
| 72 |
+
return left.event_ < right.event_;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
std::optional<at::Device> device() const {
|
| 76 |
+
if (is_created_) {
|
| 77 |
+
return at::Device(at::kCUDA, device_index_);
|
| 78 |
+
} else {
|
| 79 |
+
return {};
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
bool isCreated() const { return is_created_; }
|
| 84 |
+
DeviceIndex device_index() const {return device_index_;}
|
| 85 |
+
cudaEvent_t event() const { return event_; }
|
| 86 |
+
|
| 87 |
+
// Note: cudaEventQuery can be safely called from any device
|
| 88 |
+
bool query() const {
|
| 89 |
+
if (!is_created_) {
|
| 90 |
+
return true;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
cudaError_t err = cudaEventQuery(event_);
|
| 94 |
+
if (err == cudaSuccess) {
|
| 95 |
+
return true;
|
| 96 |
+
} else if (err != cudaErrorNotReady) {
|
| 97 |
+
C10_CUDA_CHECK(err);
|
| 98 |
+
} else {
|
| 99 |
+
// ignore and clear the error if not ready
|
| 100 |
+
(void)cudaGetLastError();
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
return false;
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
void record() { record(getCurrentCUDAStream()); }
|
| 107 |
+
|
| 108 |
+
void recordOnce(const CUDAStream& stream) {
|
| 109 |
+
if (!was_recorded_) record(stream);
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
// Note: cudaEventRecord must be called on the same device as the event.
|
| 113 |
+
void record(const CUDAStream& stream) {
|
| 114 |
+
if (!is_created_) {
|
| 115 |
+
createEvent(stream.device_index());
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
TORCH_CHECK(device_index_ == stream.device_index(), "Event device ", device_index_,
|
| 119 |
+
" does not match recording stream's device ", stream.device_index(), ".");
|
| 120 |
+
CUDAGuard guard(device_index_);
|
| 121 |
+
AT_CUDA_CHECK(cudaEventRecord(event_, stream));
|
| 122 |
+
const c10::impl::PyInterpreter* interp = c10::impl::GPUTrace::get_trace();
|
| 123 |
+
if (C10_UNLIKELY(interp)) {
|
| 124 |
+
(*interp)->trace_gpu_event_record(at::kCUDA,
|
| 125 |
+
reinterpret_cast<uintptr_t>(event_),
|
| 126 |
+
reinterpret_cast<uintptr_t>(stream.stream())
|
| 127 |
+
);
|
| 128 |
+
}
|
| 129 |
+
was_recorded_ = true;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
// Note: cudaStreamWaitEvent must be called on the same device as the stream.
|
| 133 |
+
// The event has no actual GPU resources associated with it.
|
| 134 |
+
void block(const CUDAStream& stream) {
|
| 135 |
+
if (is_created_) {
|
| 136 |
+
CUDAGuard guard(stream.device_index());
|
| 137 |
+
AT_CUDA_CHECK(cudaStreamWaitEvent(stream, event_, 0));
|
| 138 |
+
const c10::impl::PyInterpreter* interp = c10::impl::GPUTrace::get_trace();
|
| 139 |
+
if (C10_UNLIKELY(interp)) {
|
| 140 |
+
(*interp)->trace_gpu_event_wait(at::kCUDA,
|
| 141 |
+
reinterpret_cast<uintptr_t>(event_),
|
| 142 |
+
reinterpret_cast<uintptr_t>(stream.stream())
|
| 143 |
+
);
|
| 144 |
+
}
|
| 145 |
+
}
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
// Note: cudaEventElapsedTime can be safely called from any device
|
| 149 |
+
float elapsed_time(const CUDAEvent& other) const {
|
| 150 |
+
TORCH_CHECK(is_created_ && other.isCreated(),
|
| 151 |
+
"Both events must be recorded before calculating elapsed time.");
|
| 152 |
+
float time_ms = 0;
|
| 153 |
+
// We do not strictly have to set the device index to the same as our event,
|
| 154 |
+
// but if we don't and the current device is not initialized, it will
|
| 155 |
+
// create a new cuda context, which will consume a lot of memory.
|
| 156 |
+
CUDAGuard guard(device_index_);
|
| 157 |
+
// raise cudaErrorNotReady if either event is recorded but not yet completed
|
| 158 |
+
AT_CUDA_CHECK(cudaEventElapsedTime(&time_ms, event_, other.event_));
|
| 159 |
+
return time_ms;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
// Note: cudaEventSynchronize can be safely called from any device
|
| 163 |
+
void synchronize() const {
|
| 164 |
+
if (is_created_) {
|
| 165 |
+
const c10::impl::PyInterpreter* interp = c10::impl::GPUTrace::get_trace();
|
| 166 |
+
if (C10_UNLIKELY(interp)) {
|
| 167 |
+
(*interp)->trace_gpu_event_synchronization(at::kCUDA, reinterpret_cast<uintptr_t>(event_));
|
| 168 |
+
}
|
| 169 |
+
AT_CUDA_CHECK(cudaEventSynchronize(event_));
|
| 170 |
+
}
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
// Note: cudaIpcGetEventHandle must be called on the same device as the event
|
| 174 |
+
void ipc_handle(cudaIpcEventHandle_t * handle) {
|
| 175 |
+
if (!is_created_) {
|
| 176 |
+
// this CUDAEvent object was initially constructed from flags but event_
|
| 177 |
+
// is not created yet.
|
| 178 |
+
createEvent(getCurrentCUDAStream().device_index());
|
| 179 |
+
}
|
| 180 |
+
CUDAGuard guard(device_index_);
|
| 181 |
+
AT_CUDA_CHECK(cudaIpcGetEventHandle(handle, event_));
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
private:
|
| 185 |
+
unsigned int flags_ = cudaEventDisableTiming;
|
| 186 |
+
bool is_created_ = false;
|
| 187 |
+
bool was_recorded_ = false;
|
| 188 |
+
DeviceIndex device_index_ = -1;
|
| 189 |
+
cudaEvent_t event_{};
|
| 190 |
+
|
| 191 |
+
void createEvent(DeviceIndex device_index) {
|
| 192 |
+
device_index_ = device_index;
|
| 193 |
+
CUDAGuard guard(device_index_);
|
| 194 |
+
AT_CUDA_CHECK(cudaEventCreateWithFlags(&event_, flags_));
|
| 195 |
+
const c10::impl::PyInterpreter* interp = c10::impl::GPUTrace::get_trace();
|
| 196 |
+
if (C10_UNLIKELY(interp)) {
|
| 197 |
+
(*interp)->trace_gpu_event_creation(at::kCUDA, reinterpret_cast<uintptr_t>(event_));
|
| 198 |
+
}
|
| 199 |
+
is_created_ = true;
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
void moveHelper(CUDAEvent&& other) {
|
| 203 |
+
std::swap(flags_, other.flags_);
|
| 204 |
+
std::swap(is_created_, other.is_created_);
|
| 205 |
+
std::swap(was_recorded_, other.was_recorded_);
|
| 206 |
+
std::swap(device_index_, other.device_index_);
|
| 207 |
+
std::swap(event_, other.event_);
|
| 208 |
+
}
|
| 209 |
+
};
|
| 210 |
+
|
| 211 |
+
} // namespace at::cuda
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAGeneratorImpl.h
ADDED
|
@@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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <ATen/Context.h>
|
| 4 |
+
#include <ATen/core/Generator.h>
|
| 5 |
+
#include <ATen/core/TensorBase.h>
|
| 6 |
+
#include <ATen/cuda/PhiloxCudaState.h>
|
| 7 |
+
#include <atomic>
|
| 8 |
+
#include <limits>
|
| 9 |
+
#include <memory>
|
| 10 |
+
#include <unordered_set>
|
| 11 |
+
namespace at {
|
| 12 |
+
|
| 13 |
+
namespace cuda {
|
| 14 |
+
struct CUDAGraph;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
/**
|
| 18 |
+
* Note [CUDA Graph-safe RNG states]
|
| 19 |
+
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 20 |
+
*
|
| 21 |
+
* Strategy:
|
| 22 |
+
* ~~~~~~~~~
|
| 23 |
+
* (It helps to look at
|
| 24 |
+
* cuda/detail/PhiloxCudaStateRaw.cuh and
|
| 25 |
+
* cuda/detail/UnpackRaw.cuh
|
| 26 |
+
* while you read this.)
|
| 27 |
+
*
|
| 28 |
+
* A CUDA graph containing multiple RNG ops behaves like a
|
| 29 |
+
* single giant kernel from the perspective of ops external
|
| 30 |
+
* to the graph. During graph capture, logic in CUDAGeneratorImpl
|
| 31 |
+
* records the total of all offset increments that occur in the
|
| 32 |
+
* graphed region, and records the final total as the offset for
|
| 33 |
+
* the entire graph.
|
| 34 |
+
*
|
| 35 |
+
* When the graph reruns, the logic that reruns it
|
| 36 |
+
* increments this device's CUDA generator's offset
|
| 37 |
+
* by that total.
|
| 38 |
+
*
|
| 39 |
+
* Meanwhile, within the graph, at capture time, instead of
|
| 40 |
+
* populating PhiloxCudaStates with the uint64_t offset pulled
|
| 41 |
+
* directly from the global state, PhiloxCudaState uses a pointer
|
| 42 |
+
* to a one-element stream-local int64_t device tensor
|
| 43 |
+
* holding an initial offset value, and a uint64_t holding an
|
| 44 |
+
* intra-graph offset. (The intra-graph offset starts from zero
|
| 45 |
+
* when capture begins.) In each consumer kernel,
|
| 46 |
+
* at::cuda::philox::unpack computes the offset to use for this kernel
|
| 47 |
+
* as intra-graph offset + *initial offset.
|
| 48 |
+
*
|
| 49 |
+
* When the graph reruns, the logic that reruns it first
|
| 50 |
+
* fill_s the initial offset tensor with this device's
|
| 51 |
+
* CUDA generator's current offset.
|
| 52 |
+
*
|
| 53 |
+
* The control flow above ensures graphed execution is bitwise
|
| 54 |
+
* identical to eager execution as long as RNG ops are enqueued
|
| 55 |
+
* from a single thread, even if RNG ops and graphs containing
|
| 56 |
+
* RNG ops are enqueued and run simultaneously on multiple streams.
|
| 57 |
+
*
|
| 58 |
+
* Usage:
|
| 59 |
+
* ~~~~~~
|
| 60 |
+
* PhiloxCudaState in this file, and unpack() in
|
| 61 |
+
* cuda/CUDAGraphsUtils.cuh allow non-divergent use of
|
| 62 |
+
* CUDAGeneratorImpl whether graph capture is underway or not.
|
| 63 |
+
*
|
| 64 |
+
* Each PhiloxCudaState instance should be used for one and only one
|
| 65 |
+
* consumer kernel.
|
| 66 |
+
*
|
| 67 |
+
* Example (see e.g. native/cuda/Dropout.cu):
|
| 68 |
+
*
|
| 69 |
+
* #include <ATen/cuda/CUDAGeneratorImpl.h>
|
| 70 |
+
* #include <ATen/cuda/CUDAGraphsUtils.cuh>
|
| 71 |
+
*
|
| 72 |
+
* __global__ void kernel(..., PhiloxCudaState philox_args) {
|
| 73 |
+
* auto seeds = at::cuda::philox::unpack(philox_args);
|
| 74 |
+
* IndexType idx = blockIdx.x * blockDim.x + threadIdx.x;
|
| 75 |
+
* curandStatePhilox4_32_10_t state;
|
| 76 |
+
* curand_init(std::get<0>(seeds), // seed
|
| 77 |
+
* idx, // per-thread subsequence
|
| 78 |
+
* std::get<1>(seeds), // offset in subsequence
|
| 79 |
+
* &state);
|
| 80 |
+
* ...
|
| 81 |
+
* }
|
| 82 |
+
*
|
| 83 |
+
* host_caller(...) {
|
| 84 |
+
* PhiloxCudaState rng_engine_inputs;
|
| 85 |
+
* {
|
| 86 |
+
* // See Note [Acquire lock when using random generators]
|
| 87 |
+
* std::lock_guard<std::mutex> lock(gen->mutex_);
|
| 88 |
+
*
|
| 89 |
+
* // gen could be HostState or DevState here! No divergent code needed!
|
| 90 |
+
* rng_engine_inputs = gen->philox_cuda_state(offset_increment);
|
| 91 |
+
* }
|
| 92 |
+
* kernel<<<...>>>(..., rng_engine_inputs);
|
| 93 |
+
* }
|
| 94 |
+
*
|
| 95 |
+
*/
|
| 96 |
+
|
| 97 |
+
struct CUDAGeneratorState : public c10::intrusive_ptr_target {
|
| 98 |
+
uint64_t seed_;
|
| 99 |
+
uint64_t philox_offset_per_thread_;
|
| 100 |
+
uint32_t offset_intragraph_;
|
| 101 |
+
bool capturing_{};
|
| 102 |
+
std::unordered_set<cuda::CUDAGraph*> registered_graphs_;
|
| 103 |
+
at::TensorBase seed_extragraph_{};
|
| 104 |
+
at::TensorBase offset_extragraph_{};
|
| 105 |
+
|
| 106 |
+
CUDAGeneratorState(
|
| 107 |
+
uint64_t seed = default_rng_seed_val,
|
| 108 |
+
uint64_t philox_offset_per_thread = 0,
|
| 109 |
+
uint32_t offset_intragraph = 0)
|
| 110 |
+
: seed_(seed),
|
| 111 |
+
philox_offset_per_thread_(philox_offset_per_thread),
|
| 112 |
+
offset_intragraph_(offset_intragraph) {}
|
| 113 |
+
|
| 114 |
+
void increase(uint64_t increment);
|
| 115 |
+
|
| 116 |
+
void register_graph(cuda::CUDAGraph* graph);
|
| 117 |
+
void unregister_graph(cuda::CUDAGraph* graph);
|
| 118 |
+
|
| 119 |
+
void capture_prologue();
|
| 120 |
+
// capture_epilogue returns the wholegraph_increment
|
| 121 |
+
uint64_t capture_epilogue();
|
| 122 |
+
void replay_prologue(uint64_t wholegraph_increment);
|
| 123 |
+
c10::intrusive_ptr<CUDAGeneratorState> clone();
|
| 124 |
+
};
|
| 125 |
+
|
| 126 |
+
struct TORCH_CUDA_CPP_API CUDAGeneratorImpl : public c10::GeneratorImpl {
|
| 127 |
+
// Constructors
|
| 128 |
+
CUDAGeneratorImpl(DeviceIndex device_index = -1);
|
| 129 |
+
CUDAGeneratorImpl(
|
| 130 |
+
DeviceIndex device_index,
|
| 131 |
+
c10::intrusive_ptr<CUDAGeneratorState> state_);
|
| 132 |
+
~CUDAGeneratorImpl() override = default;
|
| 133 |
+
|
| 134 |
+
// CUDAGeneratorImpl methods
|
| 135 |
+
std::shared_ptr<CUDAGeneratorImpl> clone() const;
|
| 136 |
+
void set_current_seed(uint64_t seed) override;
|
| 137 |
+
void set_offset(uint64_t offset) override;
|
| 138 |
+
uint64_t get_offset() const override;
|
| 139 |
+
uint64_t current_seed() const override;
|
| 140 |
+
uint64_t seed() override;
|
| 141 |
+
void set_state(const c10::TensorImpl& new_state) override;
|
| 142 |
+
c10::intrusive_ptr<c10::TensorImpl> get_state() const override;
|
| 143 |
+
void graphsafe_set_state(
|
| 144 |
+
const c10::intrusive_ptr<GeneratorImpl>& state) override;
|
| 145 |
+
c10::intrusive_ptr<c10::GeneratorImpl> graphsafe_get_state() const override;
|
| 146 |
+
|
| 147 |
+
void set_philox_offset_per_thread(uint64_t offset);
|
| 148 |
+
uint64_t philox_offset_per_thread() const;
|
| 149 |
+
|
| 150 |
+
void register_graph(cuda::CUDAGraph* graph);
|
| 151 |
+
void unregister_graph(cuda::CUDAGraph* graph);
|
| 152 |
+
|
| 153 |
+
// Generates a PhiloxCudaState with a specified increment, and increment
|
| 154 |
+
// current state
|
| 155 |
+
PhiloxCudaState philox_cuda_state(uint64_t increment);
|
| 156 |
+
|
| 157 |
+
bool reset_rnn_state() {
|
| 158 |
+
return !no_reset_rnn_state_.test_and_set();
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
// Temporarily accommodates call sites that use philox_engine_inputs.
|
| 162 |
+
// Allows incremental refactor of call sites to use philox_cuda_state.
|
| 163 |
+
std::pair<uint64_t, uint64_t> philox_engine_inputs(uint64_t increment);
|
| 164 |
+
|
| 165 |
+
static c10::DeviceType device_type();
|
| 166 |
+
|
| 167 |
+
private:
|
| 168 |
+
CUDAGeneratorImpl* clone_impl() const override;
|
| 169 |
+
|
| 170 |
+
c10::intrusive_ptr<CUDAGeneratorState> state_;
|
| 171 |
+
std::atomic_flag no_reset_rnn_state_;
|
| 172 |
+
};
|
| 173 |
+
|
| 174 |
+
namespace cuda::detail {
|
| 175 |
+
|
| 176 |
+
TORCH_CUDA_CPP_API const Generator& getDefaultCUDAGenerator(
|
| 177 |
+
DeviceIndex device_index = -1);
|
| 178 |
+
TORCH_CUDA_CPP_API Generator createCUDAGenerator(DeviceIndex device_index = -1);
|
| 179 |
+
|
| 180 |
+
} // namespace cuda::detail
|
| 181 |
+
} // namespace at
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAGraph.h
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <ATen/Tensor.h>
|
| 4 |
+
#include <c10/core/Device.h>
|
| 5 |
+
#include <c10/cuda/CUDAGraphsC10Utils.h>
|
| 6 |
+
#include <c10/cuda/CUDAStream.h>
|
| 7 |
+
#include <c10/util/flat_hash_map.h>
|
| 8 |
+
|
| 9 |
+
namespace at {
|
| 10 |
+
|
| 11 |
+
struct Generator;
|
| 12 |
+
struct CUDAGeneratorImpl;
|
| 13 |
+
struct CUDAGeneratorState;
|
| 14 |
+
|
| 15 |
+
namespace cuda {
|
| 16 |
+
|
| 17 |
+
// Standalone way to get a unique mempool id usable as a pool=... argument
|
| 18 |
+
// to CUDAGraph::capture_begin
|
| 19 |
+
TORCH_CUDA_CPP_API MempoolId_t graph_pool_handle();
|
| 20 |
+
|
| 21 |
+
struct TORCH_CUDA_CPP_API CUDAGraph {
|
| 22 |
+
CUDAGraph();
|
| 23 |
+
~CUDAGraph();
|
| 24 |
+
|
| 25 |
+
static void inc_pending_event_queries();
|
| 26 |
+
static void dec_pending_event_queries();
|
| 27 |
+
static int num_pending_event_queries();
|
| 28 |
+
// See Note [Explicit Registration of Generators to the CUDA Graph]
|
| 29 |
+
void register_generator_state(c10::intrusive_ptr<at::CUDAGeneratorState> state);
|
| 30 |
+
void register_generator_state(const at::Generator& generator);
|
| 31 |
+
void capture_begin(
|
| 32 |
+
MempoolId_t pool = {0, 0},
|
| 33 |
+
cudaStreamCaptureMode capture_mode = cudaStreamCaptureModeGlobal);
|
| 34 |
+
void capture_end();
|
| 35 |
+
void replay();
|
| 36 |
+
void reset();
|
| 37 |
+
MempoolId_t pool();
|
| 38 |
+
void enable_debug_mode();
|
| 39 |
+
void debug_dump(const std::string& debug_path);
|
| 40 |
+
|
| 41 |
+
protected:
|
| 42 |
+
cudaGraph_t graph_ = nullptr;
|
| 43 |
+
cudaGraphExec_t graph_exec_ = nullptr;
|
| 44 |
+
|
| 45 |
+
static std::atomic<int> pending_event_queries;
|
| 46 |
+
|
| 47 |
+
// internal states so reset() can do its best cleaning up
|
| 48 |
+
// Set to true in capture_end if cudaStreamEndCapture succeeded
|
| 49 |
+
// Set back to false soon after, when graph_ is consumed by cudaGraphInstantiate
|
| 50 |
+
// to create graph_exec_, then graph_ is deleted
|
| 51 |
+
bool has_graph_ = false;
|
| 52 |
+
// Set to true in capture_end if cudaGraphInstantiate succeeded
|
| 53 |
+
bool has_graph_exec_ = false;
|
| 54 |
+
|
| 55 |
+
// the ID assigned by cuda during graph capture,
|
| 56 |
+
// used to identify when a stream is participating in capture
|
| 57 |
+
CaptureId_t capture_id_ = -1;
|
| 58 |
+
|
| 59 |
+
// uuid used to request a particular private mempool from CUDACachingAllocator.
|
| 60 |
+
// By default, this will be set to {id_, 0}.
|
| 61 |
+
//
|
| 62 |
+
// If capture_begin is called with "pool=other_graph.pool()", this graph's mempool_id_
|
| 63 |
+
// will be set to the other graph's mempool_id_, and therefore share a mempool with the
|
| 64 |
+
// other graph.
|
| 65 |
+
//
|
| 66 |
+
// If capture_begin is called with "pool=handle" where "handle" came from graph_pool_handle(),
|
| 67 |
+
// it will share a mempool with any other captures that used "pool=handle".
|
| 68 |
+
//
|
| 69 |
+
// Sharing a mempool across graphs saves memory, and it's safe if you
|
| 70 |
+
// know you'll replay those graphs in the same order you captured them.
|
| 71 |
+
MempoolId_t mempool_id_;
|
| 72 |
+
|
| 73 |
+
// Stream on which capture began
|
| 74 |
+
at::cuda::CUDAStream capture_stream_;
|
| 75 |
+
|
| 76 |
+
// multiple generator states and their wholegraph_increments in this graph
|
| 77 |
+
// that are managed by the CUDA Graph
|
| 78 |
+
ska::flat_hash_map<c10::intrusive_ptr<at::CUDAGeneratorState>, uint64_t>
|
| 79 |
+
captured_generator_states_;
|
| 80 |
+
|
| 81 |
+
// Device where capture occurred. Right now, for simplicity, we require all ops
|
| 82 |
+
// in a capture to run on the same device, but this is a limitation of CUDAGraph,
|
| 83 |
+
// not CUDA itself. We can straightforwardly modify CUDAGraph to support multi-device
|
| 84 |
+
// captures if needed.
|
| 85 |
+
int capture_dev_;
|
| 86 |
+
};
|
| 87 |
+
|
| 88 |
+
} // namespace cuda
|
| 89 |
+
} // namespace at
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAGraphsUtils.cuh
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <ATen/cuda/CUDAGeneratorImpl.h>
|
| 4 |
+
#include <ATen/cuda/CUDAEvent.h>
|
| 5 |
+
#include <ATen/cuda/PhiloxUtils.cuh>
|
| 6 |
+
#include <ATen/cuda/detail/CUDAHooks.h>
|
| 7 |
+
#include <ATen/detail/CUDAHooksInterface.h>
|
| 8 |
+
#include <c10/core/StreamGuard.h>
|
| 9 |
+
#include <c10/cuda/CUDAGraphsC10Utils.h>
|
| 10 |
+
#include <c10/cuda/CUDAGuard.h>
|
| 11 |
+
|
| 12 |
+
// c10/cuda/CUDAGraphsC10Utils.h has utils used by both c10 and aten.
|
| 13 |
+
// This file adds utils used by aten only.
|
| 14 |
+
|
| 15 |
+
namespace at::cuda {
|
| 16 |
+
|
| 17 |
+
using CaptureId_t = c10::cuda::CaptureId_t;
|
| 18 |
+
using CaptureStatus = c10::cuda::CaptureStatus;
|
| 19 |
+
|
| 20 |
+
// Use this version where you don't want to create a CUDA context if none exists.
|
| 21 |
+
inline CaptureStatus currentStreamCaptureStatus() {
|
| 22 |
+
// don't create a context if we don't have to
|
| 23 |
+
if (c10::cuda::hasPrimaryContext(c10::cuda::current_device())) {
|
| 24 |
+
return c10::cuda::currentStreamCaptureStatusMayInitCtx();
|
| 25 |
+
} else {
|
| 26 |
+
return CaptureStatus::None;
|
| 27 |
+
}
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
inline void assertNotCapturing(const std::string& attempt) {
|
| 31 |
+
auto status = currentStreamCaptureStatus();
|
| 32 |
+
TORCH_CHECK(status == CaptureStatus::None,
|
| 33 |
+
attempt,
|
| 34 |
+
" during CUDA graph capture. If you need this call to be captured, "
|
| 35 |
+
"please file an issue. "
|
| 36 |
+
"Current cudaStreamCaptureStatus: ",
|
| 37 |
+
status);
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
inline void errorIfCapturingCudnnBenchmark(const std::string& version_specific) {
|
| 41 |
+
auto status = currentStreamCaptureStatus();
|
| 42 |
+
TORCH_CHECK(status == CaptureStatus::None,
|
| 43 |
+
"Current cudaStreamCaptureStatus: ",
|
| 44 |
+
status,
|
| 45 |
+
"\nCapturing ",
|
| 46 |
+
version_specific,
|
| 47 |
+
"is prohibited. Possible causes of this error:\n"
|
| 48 |
+
"1. No warmup iterations occurred before capture.\n"
|
| 49 |
+
"2. The convolutions you're trying to capture use dynamic shapes, "
|
| 50 |
+
"in which case capturing them is generally prohibited.");
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
} // namespace at::cuda
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDASparse.h
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <ATen/cuda/CUDAContext.h>
|
| 4 |
+
#if defined(USE_ROCM)
|
| 5 |
+
#include <hipsparse/hipsparse-version.h>
|
| 6 |
+
#define HIPSPARSE_VERSION ((hipsparseVersionMajor*100000) + (hipsparseVersionMinor*100) + hipsparseVersionPatch)
|
| 7 |
+
#endif
|
| 8 |
+
|
| 9 |
+
// cuSparse Generic API added in CUDA 10.1
|
| 10 |
+
// Windows support added in CUDA 11.0
|
| 11 |
+
#if defined(CUDART_VERSION) && defined(CUSPARSE_VERSION) && ((CUSPARSE_VERSION >= 10300) || (CUSPARSE_VERSION >= 11000 && defined(_WIN32)))
|
| 12 |
+
#define AT_USE_CUSPARSE_GENERIC_API() 1
|
| 13 |
+
#else
|
| 14 |
+
#define AT_USE_CUSPARSE_GENERIC_API() 0
|
| 15 |
+
#endif
|
| 16 |
+
|
| 17 |
+
// cuSparse Generic API descriptor pointers were changed to const in CUDA 12.0
|
| 18 |
+
#if defined(CUDART_VERSION) && defined(CUSPARSE_VERSION) && \
|
| 19 |
+
(CUSPARSE_VERSION < 12000)
|
| 20 |
+
#define AT_USE_CUSPARSE_NON_CONST_DESCRIPTORS() 1
|
| 21 |
+
#else
|
| 22 |
+
#define AT_USE_CUSPARSE_NON_CONST_DESCRIPTORS() 0
|
| 23 |
+
#endif
|
| 24 |
+
|
| 25 |
+
#if defined(CUDART_VERSION) && defined(CUSPARSE_VERSION) && \
|
| 26 |
+
(CUSPARSE_VERSION >= 12000)
|
| 27 |
+
#define AT_USE_CUSPARSE_CONST_DESCRIPTORS() 1
|
| 28 |
+
#else
|
| 29 |
+
#define AT_USE_CUSPARSE_CONST_DESCRIPTORS() 0
|
| 30 |
+
#endif
|
| 31 |
+
|
| 32 |
+
#if defined(USE_ROCM)
|
| 33 |
+
// hipSparse const API added in v2.4.0
|
| 34 |
+
#if HIPSPARSE_VERSION >= 200400
|
| 35 |
+
#define AT_USE_HIPSPARSE_CONST_DESCRIPTORS() 1
|
| 36 |
+
#define AT_USE_HIPSPARSE_NON_CONST_DESCRIPTORS() 0
|
| 37 |
+
#define AT_USE_HIPSPARSE_GENERIC_API() 1
|
| 38 |
+
#else
|
| 39 |
+
#define AT_USE_HIPSPARSE_CONST_DESCRIPTORS() 0
|
| 40 |
+
#define AT_USE_HIPSPARSE_NON_CONST_DESCRIPTORS() 1
|
| 41 |
+
#define AT_USE_HIPSPARSE_GENERIC_API() 1
|
| 42 |
+
#endif
|
| 43 |
+
#else // USE_ROCM
|
| 44 |
+
#define AT_USE_HIPSPARSE_CONST_DESCRIPTORS() 0
|
| 45 |
+
#define AT_USE_HIPSPARSE_NON_CONST_DESCRIPTORS() 0
|
| 46 |
+
#define AT_USE_HIPSPARSE_GENERIC_API() 0
|
| 47 |
+
#endif // USE_ROCM
|
| 48 |
+
|
| 49 |
+
// cuSparse Generic API spsv function was added in CUDA 11.3.0
|
| 50 |
+
#if defined(CUDART_VERSION) && defined(CUSPARSE_VERSION) && (CUSPARSE_VERSION >= 11500)
|
| 51 |
+
#define AT_USE_CUSPARSE_GENERIC_SPSV() 1
|
| 52 |
+
#else
|
| 53 |
+
#define AT_USE_CUSPARSE_GENERIC_SPSV() 0
|
| 54 |
+
#endif
|
| 55 |
+
|
| 56 |
+
// cuSparse Generic API spsm function was added in CUDA 11.3.1
|
| 57 |
+
#if defined(CUDART_VERSION) && defined(CUSPARSE_VERSION) && (CUSPARSE_VERSION >= 11600)
|
| 58 |
+
#define AT_USE_CUSPARSE_GENERIC_SPSM() 1
|
| 59 |
+
#else
|
| 60 |
+
#define AT_USE_CUSPARSE_GENERIC_SPSM() 0
|
| 61 |
+
#endif
|
| 62 |
+
|
| 63 |
+
// cuSparse Generic API sddmm function was added in CUDA 11.2.1 (cuSparse version 11400)
|
| 64 |
+
#if defined(CUDART_VERSION) && defined(CUSPARSE_VERSION) && (CUSPARSE_VERSION >= 11400)
|
| 65 |
+
#define AT_USE_CUSPARSE_GENERIC_SDDMM() 1
|
| 66 |
+
#else
|
| 67 |
+
#define AT_USE_CUSPARSE_GENERIC_SDDMM() 0
|
| 68 |
+
#endif
|
| 69 |
+
|
| 70 |
+
// BSR triangular solve functions were added in hipSPARSE 1.11.2 (ROCm 4.5.0)
|
| 71 |
+
#if defined(CUDART_VERSION) || defined(USE_ROCM)
|
| 72 |
+
#define AT_USE_HIPSPARSE_TRIANGULAR_SOLVE() 1
|
| 73 |
+
#else
|
| 74 |
+
#define AT_USE_HIPSPARSE_TRIANGULAR_SOLVE() 0
|
| 75 |
+
#endif
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDASparseBlas.h
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
/*
|
| 4 |
+
Provides a subset of cuSPARSE functions as templates:
|
| 5 |
+
|
| 6 |
+
csrgeam2<scalar_t>(...)
|
| 7 |
+
|
| 8 |
+
where scalar_t is double, float, c10::complex<double> or c10::complex<float>.
|
| 9 |
+
The functions are available in at::cuda::sparse namespace.
|
| 10 |
+
*/
|
| 11 |
+
|
| 12 |
+
#include <ATen/cuda/CUDAContext.h>
|
| 13 |
+
#include <ATen/cuda/CUDASparse.h>
|
| 14 |
+
|
| 15 |
+
namespace at::cuda::sparse {
|
| 16 |
+
|
| 17 |
+
#define CUSPARSE_CSRGEAM2_BUFFERSIZE_ARGTYPES(scalar_t) \
|
| 18 |
+
cusparseHandle_t handle, int m, int n, const scalar_t *alpha, \
|
| 19 |
+
const cusparseMatDescr_t descrA, int nnzA, \
|
| 20 |
+
const scalar_t *csrSortedValA, const int *csrSortedRowPtrA, \
|
| 21 |
+
const int *csrSortedColIndA, const scalar_t *beta, \
|
| 22 |
+
const cusparseMatDescr_t descrB, int nnzB, \
|
| 23 |
+
const scalar_t *csrSortedValB, const int *csrSortedRowPtrB, \
|
| 24 |
+
const int *csrSortedColIndB, const cusparseMatDescr_t descrC, \
|
| 25 |
+
const scalar_t *csrSortedValC, const int *csrSortedRowPtrC, \
|
| 26 |
+
const int *csrSortedColIndC, size_t *pBufferSizeInBytes
|
| 27 |
+
|
| 28 |
+
template <typename scalar_t>
|
| 29 |
+
inline void csrgeam2_bufferSizeExt(
|
| 30 |
+
CUSPARSE_CSRGEAM2_BUFFERSIZE_ARGTYPES(scalar_t)) {
|
| 31 |
+
TORCH_INTERNAL_ASSERT(
|
| 32 |
+
false,
|
| 33 |
+
"at::cuda::sparse::csrgeam2_bufferSizeExt: not implemented for ",
|
| 34 |
+
typeid(scalar_t).name());
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
template <>
|
| 38 |
+
void csrgeam2_bufferSizeExt<float>(
|
| 39 |
+
CUSPARSE_CSRGEAM2_BUFFERSIZE_ARGTYPES(float));
|
| 40 |
+
template <>
|
| 41 |
+
void csrgeam2_bufferSizeExt<double>(
|
| 42 |
+
CUSPARSE_CSRGEAM2_BUFFERSIZE_ARGTYPES(double));
|
| 43 |
+
template <>
|
| 44 |
+
void csrgeam2_bufferSizeExt<c10::complex<float>>(
|
| 45 |
+
CUSPARSE_CSRGEAM2_BUFFERSIZE_ARGTYPES(c10::complex<float>));
|
| 46 |
+
template <>
|
| 47 |
+
void csrgeam2_bufferSizeExt<c10::complex<double>>(
|
| 48 |
+
CUSPARSE_CSRGEAM2_BUFFERSIZE_ARGTYPES(c10::complex<double>));
|
| 49 |
+
|
| 50 |
+
#define CUSPARSE_CSRGEAM2_NNZ_ARGTYPES() \
|
| 51 |
+
cusparseHandle_t handle, int m, int n, const cusparseMatDescr_t descrA, \
|
| 52 |
+
int nnzA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, \
|
| 53 |
+
const cusparseMatDescr_t descrB, int nnzB, const int *csrSortedRowPtrB, \
|
| 54 |
+
const int *csrSortedColIndB, const cusparseMatDescr_t descrC, \
|
| 55 |
+
int *csrSortedRowPtrC, int *nnzTotalDevHostPtr, void *workspace
|
| 56 |
+
|
| 57 |
+
template <typename scalar_t>
|
| 58 |
+
inline void csrgeam2Nnz(CUSPARSE_CSRGEAM2_NNZ_ARGTYPES()) {
|
| 59 |
+
TORCH_CUDASPARSE_CHECK(cusparseXcsrgeam2Nnz(
|
| 60 |
+
handle,
|
| 61 |
+
m,
|
| 62 |
+
n,
|
| 63 |
+
descrA,
|
| 64 |
+
nnzA,
|
| 65 |
+
csrSortedRowPtrA,
|
| 66 |
+
csrSortedColIndA,
|
| 67 |
+
descrB,
|
| 68 |
+
nnzB,
|
| 69 |
+
csrSortedRowPtrB,
|
| 70 |
+
csrSortedColIndB,
|
| 71 |
+
descrC,
|
| 72 |
+
csrSortedRowPtrC,
|
| 73 |
+
nnzTotalDevHostPtr,
|
| 74 |
+
workspace));
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
#define CUSPARSE_CSRGEAM2_ARGTYPES(scalar_t) \
|
| 78 |
+
cusparseHandle_t handle, int m, int n, const scalar_t *alpha, \
|
| 79 |
+
const cusparseMatDescr_t descrA, int nnzA, \
|
| 80 |
+
const scalar_t *csrSortedValA, const int *csrSortedRowPtrA, \
|
| 81 |
+
const int *csrSortedColIndA, const scalar_t *beta, \
|
| 82 |
+
const cusparseMatDescr_t descrB, int nnzB, \
|
| 83 |
+
const scalar_t *csrSortedValB, const int *csrSortedRowPtrB, \
|
| 84 |
+
const int *csrSortedColIndB, const cusparseMatDescr_t descrC, \
|
| 85 |
+
scalar_t *csrSortedValC, int *csrSortedRowPtrC, int *csrSortedColIndC, \
|
| 86 |
+
void *pBuffer
|
| 87 |
+
|
| 88 |
+
template <typename scalar_t>
|
| 89 |
+
inline void csrgeam2(CUSPARSE_CSRGEAM2_ARGTYPES(scalar_t)) {
|
| 90 |
+
TORCH_INTERNAL_ASSERT(
|
| 91 |
+
false,
|
| 92 |
+
"at::cuda::sparse::csrgeam2: not implemented for ",
|
| 93 |
+
typeid(scalar_t).name());
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
template <>
|
| 97 |
+
void csrgeam2<float>(CUSPARSE_CSRGEAM2_ARGTYPES(float));
|
| 98 |
+
template <>
|
| 99 |
+
void csrgeam2<double>(CUSPARSE_CSRGEAM2_ARGTYPES(double));
|
| 100 |
+
template <>
|
| 101 |
+
void csrgeam2<c10::complex<float>>(
|
| 102 |
+
CUSPARSE_CSRGEAM2_ARGTYPES(c10::complex<float>));
|
| 103 |
+
template <>
|
| 104 |
+
void csrgeam2<c10::complex<double>>(
|
| 105 |
+
CUSPARSE_CSRGEAM2_ARGTYPES(c10::complex<double>));
|
| 106 |
+
|
| 107 |
+
#define CUSPARSE_BSRMM_ARGTYPES(scalar_t) \
|
| 108 |
+
cusparseHandle_t handle, cusparseDirection_t dirA, \
|
| 109 |
+
cusparseOperation_t transA, cusparseOperation_t transB, int mb, int n, \
|
| 110 |
+
int kb, int nnzb, const scalar_t *alpha, \
|
| 111 |
+
const cusparseMatDescr_t descrA, const scalar_t *bsrValA, \
|
| 112 |
+
const int *bsrRowPtrA, const int *bsrColIndA, int blockDim, \
|
| 113 |
+
const scalar_t *B, int ldb, const scalar_t *beta, scalar_t *C, int ldc
|
| 114 |
+
|
| 115 |
+
template <typename scalar_t>
|
| 116 |
+
inline void bsrmm(CUSPARSE_BSRMM_ARGTYPES(scalar_t)) {
|
| 117 |
+
TORCH_INTERNAL_ASSERT(
|
| 118 |
+
false,
|
| 119 |
+
"at::cuda::sparse::bsrmm: not implemented for ",
|
| 120 |
+
typeid(scalar_t).name());
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
template <>
|
| 124 |
+
void bsrmm<float>(CUSPARSE_BSRMM_ARGTYPES(float));
|
| 125 |
+
template <>
|
| 126 |
+
void bsrmm<double>(CUSPARSE_BSRMM_ARGTYPES(double));
|
| 127 |
+
template <>
|
| 128 |
+
void bsrmm<c10::complex<float>>(CUSPARSE_BSRMM_ARGTYPES(c10::complex<float>));
|
| 129 |
+
template <>
|
| 130 |
+
void bsrmm<c10::complex<double>>(CUSPARSE_BSRMM_ARGTYPES(c10::complex<double>));
|
| 131 |
+
|
| 132 |
+
#define CUSPARSE_BSRMV_ARGTYPES(scalar_t) \
|
| 133 |
+
cusparseHandle_t handle, cusparseDirection_t dirA, \
|
| 134 |
+
cusparseOperation_t transA, int mb, int nb, int nnzb, \
|
| 135 |
+
const scalar_t *alpha, const cusparseMatDescr_t descrA, \
|
| 136 |
+
const scalar_t *bsrValA, const int *bsrRowPtrA, const int *bsrColIndA, \
|
| 137 |
+
int blockDim, const scalar_t *x, const scalar_t *beta, scalar_t *y
|
| 138 |
+
|
| 139 |
+
template <typename scalar_t>
|
| 140 |
+
inline void bsrmv(CUSPARSE_BSRMV_ARGTYPES(scalar_t)) {
|
| 141 |
+
TORCH_INTERNAL_ASSERT(
|
| 142 |
+
false,
|
| 143 |
+
"at::cuda::sparse::bsrmv: not implemented for ",
|
| 144 |
+
typeid(scalar_t).name());
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
template <>
|
| 148 |
+
void bsrmv<float>(CUSPARSE_BSRMV_ARGTYPES(float));
|
| 149 |
+
template <>
|
| 150 |
+
void bsrmv<double>(CUSPARSE_BSRMV_ARGTYPES(double));
|
| 151 |
+
template <>
|
| 152 |
+
void bsrmv<c10::complex<float>>(CUSPARSE_BSRMV_ARGTYPES(c10::complex<float>));
|
| 153 |
+
template <>
|
| 154 |
+
void bsrmv<c10::complex<double>>(CUSPARSE_BSRMV_ARGTYPES(c10::complex<double>));
|
| 155 |
+
|
| 156 |
+
#if AT_USE_HIPSPARSE_TRIANGULAR_SOLVE()
|
| 157 |
+
|
| 158 |
+
#define CUSPARSE_BSRSV2_BUFFER_ARGTYPES(scalar_t) \
|
| 159 |
+
cusparseHandle_t handle, cusparseDirection_t dirA, \
|
| 160 |
+
cusparseOperation_t transA, int mb, int nnzb, \
|
| 161 |
+
const cusparseMatDescr_t descrA, scalar_t *bsrValA, \
|
| 162 |
+
const int *bsrRowPtrA, const int *bsrColIndA, int blockDim, \
|
| 163 |
+
bsrsv2Info_t info, int *pBufferSizeInBytes
|
| 164 |
+
|
| 165 |
+
template <typename scalar_t>
|
| 166 |
+
inline void bsrsv2_bufferSize(CUSPARSE_BSRSV2_BUFFER_ARGTYPES(scalar_t)) {
|
| 167 |
+
TORCH_INTERNAL_ASSERT(
|
| 168 |
+
false,
|
| 169 |
+
"at::cuda::sparse::bsrsv2_bufferSize: not implemented for ",
|
| 170 |
+
typeid(scalar_t).name());
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
template <>
|
| 174 |
+
void bsrsv2_bufferSize<float>(CUSPARSE_BSRSV2_BUFFER_ARGTYPES(float));
|
| 175 |
+
template <>
|
| 176 |
+
void bsrsv2_bufferSize<double>(CUSPARSE_BSRSV2_BUFFER_ARGTYPES(double));
|
| 177 |
+
template <>
|
| 178 |
+
void bsrsv2_bufferSize<c10::complex<float>>(
|
| 179 |
+
CUSPARSE_BSRSV2_BUFFER_ARGTYPES(c10::complex<float>));
|
| 180 |
+
template <>
|
| 181 |
+
void bsrsv2_bufferSize<c10::complex<double>>(
|
| 182 |
+
CUSPARSE_BSRSV2_BUFFER_ARGTYPES(c10::complex<double>));
|
| 183 |
+
|
| 184 |
+
#define CUSPARSE_BSRSV2_ANALYSIS_ARGTYPES(scalar_t) \
|
| 185 |
+
cusparseHandle_t handle, cusparseDirection_t dirA, \
|
| 186 |
+
cusparseOperation_t transA, int mb, int nnzb, \
|
| 187 |
+
const cusparseMatDescr_t descrA, const scalar_t *bsrValA, \
|
| 188 |
+
const int *bsrRowPtrA, const int *bsrColIndA, int blockDim, \
|
| 189 |
+
bsrsv2Info_t info, cusparseSolvePolicy_t policy, void *pBuffer
|
| 190 |
+
|
| 191 |
+
template <typename scalar_t>
|
| 192 |
+
inline void bsrsv2_analysis(CUSPARSE_BSRSV2_ANALYSIS_ARGTYPES(scalar_t)) {
|
| 193 |
+
TORCH_INTERNAL_ASSERT(
|
| 194 |
+
false,
|
| 195 |
+
"at::cuda::sparse::bsrsv2_analysis: not implemented for ",
|
| 196 |
+
typeid(scalar_t).name());
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
template <>
|
| 200 |
+
void bsrsv2_analysis<float>(CUSPARSE_BSRSV2_ANALYSIS_ARGTYPES(float));
|
| 201 |
+
template <>
|
| 202 |
+
void bsrsv2_analysis<double>(CUSPARSE_BSRSV2_ANALYSIS_ARGTYPES(double));
|
| 203 |
+
template <>
|
| 204 |
+
void bsrsv2_analysis<c10::complex<float>>(
|
| 205 |
+
CUSPARSE_BSRSV2_ANALYSIS_ARGTYPES(c10::complex<float>));
|
| 206 |
+
template <>
|
| 207 |
+
void bsrsv2_analysis<c10::complex<double>>(
|
| 208 |
+
CUSPARSE_BSRSV2_ANALYSIS_ARGTYPES(c10::complex<double>));
|
| 209 |
+
|
| 210 |
+
#define CUSPARSE_BSRSV2_SOLVE_ARGTYPES(scalar_t) \
|
| 211 |
+
cusparseHandle_t handle, cusparseDirection_t dirA, \
|
| 212 |
+
cusparseOperation_t transA, int mb, int nnzb, const scalar_t *alpha, \
|
| 213 |
+
const cusparseMatDescr_t descrA, const scalar_t *bsrValA, \
|
| 214 |
+
const int *bsrRowPtrA, const int *bsrColIndA, int blockDim, \
|
| 215 |
+
bsrsv2Info_t info, const scalar_t *x, scalar_t *y, \
|
| 216 |
+
cusparseSolvePolicy_t policy, void *pBuffer
|
| 217 |
+
|
| 218 |
+
template <typename scalar_t>
|
| 219 |
+
inline void bsrsv2_solve(CUSPARSE_BSRSV2_SOLVE_ARGTYPES(scalar_t)) {
|
| 220 |
+
TORCH_INTERNAL_ASSERT(
|
| 221 |
+
false,
|
| 222 |
+
"at::cuda::sparse::bsrsv2_solve: not implemented for ",
|
| 223 |
+
typeid(scalar_t).name());
|
| 224 |
+
}
|
| 225 |
+
|
| 226 |
+
template <>
|
| 227 |
+
void bsrsv2_solve<float>(CUSPARSE_BSRSV2_SOLVE_ARGTYPES(float));
|
| 228 |
+
template <>
|
| 229 |
+
void bsrsv2_solve<double>(CUSPARSE_BSRSV2_SOLVE_ARGTYPES(double));
|
| 230 |
+
template <>
|
| 231 |
+
void bsrsv2_solve<c10::complex<float>>(
|
| 232 |
+
CUSPARSE_BSRSV2_SOLVE_ARGTYPES(c10::complex<float>));
|
| 233 |
+
template <>
|
| 234 |
+
void bsrsv2_solve<c10::complex<double>>(
|
| 235 |
+
CUSPARSE_BSRSV2_SOLVE_ARGTYPES(c10::complex<double>));
|
| 236 |
+
|
| 237 |
+
#define CUSPARSE_BSRSM2_BUFFER_ARGTYPES(scalar_t) \
|
| 238 |
+
cusparseHandle_t handle, cusparseDirection_t dirA, \
|
| 239 |
+
cusparseOperation_t transA, cusparseOperation_t transX, int mb, int n, \
|
| 240 |
+
int nnzb, const cusparseMatDescr_t descrA, scalar_t *bsrValA, \
|
| 241 |
+
const int *bsrRowPtrA, const int *bsrColIndA, int blockDim, \
|
| 242 |
+
bsrsm2Info_t info, int *pBufferSizeInBytes
|
| 243 |
+
|
| 244 |
+
template <typename scalar_t>
|
| 245 |
+
inline void bsrsm2_bufferSize(CUSPARSE_BSRSM2_BUFFER_ARGTYPES(scalar_t)) {
|
| 246 |
+
TORCH_INTERNAL_ASSERT(
|
| 247 |
+
false,
|
| 248 |
+
"at::cuda::sparse::bsrsm2_bufferSize: not implemented for ",
|
| 249 |
+
typeid(scalar_t).name());
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
template <>
|
| 253 |
+
void bsrsm2_bufferSize<float>(CUSPARSE_BSRSM2_BUFFER_ARGTYPES(float));
|
| 254 |
+
template <>
|
| 255 |
+
void bsrsm2_bufferSize<double>(CUSPARSE_BSRSM2_BUFFER_ARGTYPES(double));
|
| 256 |
+
template <>
|
| 257 |
+
void bsrsm2_bufferSize<c10::complex<float>>(
|
| 258 |
+
CUSPARSE_BSRSM2_BUFFER_ARGTYPES(c10::complex<float>));
|
| 259 |
+
template <>
|
| 260 |
+
void bsrsm2_bufferSize<c10::complex<double>>(
|
| 261 |
+
CUSPARSE_BSRSM2_BUFFER_ARGTYPES(c10::complex<double>));
|
| 262 |
+
|
| 263 |
+
#define CUSPARSE_BSRSM2_ANALYSIS_ARGTYPES(scalar_t) \
|
| 264 |
+
cusparseHandle_t handle, cusparseDirection_t dirA, \
|
| 265 |
+
cusparseOperation_t transA, cusparseOperation_t transX, int mb, int n, \
|
| 266 |
+
int nnzb, const cusparseMatDescr_t descrA, const scalar_t *bsrValA, \
|
| 267 |
+
const int *bsrRowPtrA, const int *bsrColIndA, int blockDim, \
|
| 268 |
+
bsrsm2Info_t info, cusparseSolvePolicy_t policy, void *pBuffer
|
| 269 |
+
|
| 270 |
+
template <typename scalar_t>
|
| 271 |
+
inline void bsrsm2_analysis(CUSPARSE_BSRSM2_ANALYSIS_ARGTYPES(scalar_t)) {
|
| 272 |
+
TORCH_INTERNAL_ASSERT(
|
| 273 |
+
false,
|
| 274 |
+
"at::cuda::sparse::bsrsm2_analysis: not implemented for ",
|
| 275 |
+
typeid(scalar_t).name());
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
template <>
|
| 279 |
+
void bsrsm2_analysis<float>(CUSPARSE_BSRSM2_ANALYSIS_ARGTYPES(float));
|
| 280 |
+
template <>
|
| 281 |
+
void bsrsm2_analysis<double>(CUSPARSE_BSRSM2_ANALYSIS_ARGTYPES(double));
|
| 282 |
+
template <>
|
| 283 |
+
void bsrsm2_analysis<c10::complex<float>>(
|
| 284 |
+
CUSPARSE_BSRSM2_ANALYSIS_ARGTYPES(c10::complex<float>));
|
| 285 |
+
template <>
|
| 286 |
+
void bsrsm2_analysis<c10::complex<double>>(
|
| 287 |
+
CUSPARSE_BSRSM2_ANALYSIS_ARGTYPES(c10::complex<double>));
|
| 288 |
+
|
| 289 |
+
#define CUSPARSE_BSRSM2_SOLVE_ARGTYPES(scalar_t) \
|
| 290 |
+
cusparseHandle_t handle, cusparseDirection_t dirA, \
|
| 291 |
+
cusparseOperation_t transA, cusparseOperation_t transX, int mb, int n, \
|
| 292 |
+
int nnzb, const scalar_t *alpha, const cusparseMatDescr_t descrA, \
|
| 293 |
+
const scalar_t *bsrValA, const int *bsrRowPtrA, const int *bsrColIndA, \
|
| 294 |
+
int blockDim, bsrsm2Info_t info, const scalar_t *B, int ldb, \
|
| 295 |
+
scalar_t *X, int ldx, cusparseSolvePolicy_t policy, void *pBuffer
|
| 296 |
+
|
| 297 |
+
template <typename scalar_t>
|
| 298 |
+
inline void bsrsm2_solve(CUSPARSE_BSRSM2_SOLVE_ARGTYPES(scalar_t)) {
|
| 299 |
+
TORCH_INTERNAL_ASSERT(
|
| 300 |
+
false,
|
| 301 |
+
"at::cuda::sparse::bsrsm2_solve: not implemented for ",
|
| 302 |
+
typeid(scalar_t).name());
|
| 303 |
+
}
|
| 304 |
+
|
| 305 |
+
template <>
|
| 306 |
+
void bsrsm2_solve<float>(CUSPARSE_BSRSM2_SOLVE_ARGTYPES(float));
|
| 307 |
+
template <>
|
| 308 |
+
void bsrsm2_solve<double>(CUSPARSE_BSRSM2_SOLVE_ARGTYPES(double));
|
| 309 |
+
template <>
|
| 310 |
+
void bsrsm2_solve<c10::complex<float>>(
|
| 311 |
+
CUSPARSE_BSRSM2_SOLVE_ARGTYPES(c10::complex<float>));
|
| 312 |
+
template <>
|
| 313 |
+
void bsrsm2_solve<c10::complex<double>>(
|
| 314 |
+
CUSPARSE_BSRSM2_SOLVE_ARGTYPES(c10::complex<double>));
|
| 315 |
+
|
| 316 |
+
#endif // AT_USE_HIPSPARSE_TRIANGULAR_SOLVE
|
| 317 |
+
|
| 318 |
+
} // namespace at::cuda::sparse
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDASparseDescriptors.h
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <ATen/Tensor.h>
|
| 4 |
+
#include <ATen/cuda/CUDAContext.h>
|
| 5 |
+
#include <ATen/cuda/CUDASparse.h>
|
| 6 |
+
|
| 7 |
+
#include <c10/core/ScalarType.h>
|
| 8 |
+
|
| 9 |
+
#if defined(USE_ROCM)
|
| 10 |
+
#include <type_traits>
|
| 11 |
+
#endif
|
| 12 |
+
|
| 13 |
+
namespace at::cuda::sparse {
|
| 14 |
+
|
| 15 |
+
template <typename T, cusparseStatus_t (*destructor)(T*)>
|
| 16 |
+
struct CuSparseDescriptorDeleter {
|
| 17 |
+
void operator()(T* x) {
|
| 18 |
+
if (x != nullptr) {
|
| 19 |
+
TORCH_CUDASPARSE_CHECK(destructor(x));
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
};
|
| 23 |
+
|
| 24 |
+
template <typename T, cusparseStatus_t (*destructor)(T*)>
|
| 25 |
+
class CuSparseDescriptor {
|
| 26 |
+
public:
|
| 27 |
+
T* descriptor() const {
|
| 28 |
+
return descriptor_.get();
|
| 29 |
+
}
|
| 30 |
+
T* descriptor() {
|
| 31 |
+
return descriptor_.get();
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
protected:
|
| 35 |
+
std::unique_ptr<T, CuSparseDescriptorDeleter<T, destructor>> descriptor_;
|
| 36 |
+
};
|
| 37 |
+
|
| 38 |
+
#if AT_USE_CUSPARSE_CONST_DESCRIPTORS() || AT_USE_HIPSPARSE_CONST_DESCRIPTORS()
|
| 39 |
+
template <typename T, cusparseStatus_t (*destructor)(const T*)>
|
| 40 |
+
struct ConstCuSparseDescriptorDeleter {
|
| 41 |
+
void operator()(T* x) {
|
| 42 |
+
if (x != nullptr) {
|
| 43 |
+
TORCH_CUDASPARSE_CHECK(destructor(x));
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
template <typename T, cusparseStatus_t (*destructor)(const T*)>
|
| 49 |
+
class ConstCuSparseDescriptor {
|
| 50 |
+
public:
|
| 51 |
+
T* descriptor() const {
|
| 52 |
+
return descriptor_.get();
|
| 53 |
+
}
|
| 54 |
+
T* descriptor() {
|
| 55 |
+
return descriptor_.get();
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
protected:
|
| 59 |
+
std::unique_ptr<T, ConstCuSparseDescriptorDeleter<T, destructor>> descriptor_;
|
| 60 |
+
};
|
| 61 |
+
#endif // AT_USE_CUSPARSE_CONST_DESCRIPTORS || AT_USE_HIPSPARSE_CONST_DESCRIPTORS
|
| 62 |
+
|
| 63 |
+
#if defined(USE_ROCM)
|
| 64 |
+
using cusparseMatDescr = std::remove_pointer<hipsparseMatDescr_t>::type;
|
| 65 |
+
using cusparseDnMatDescr = std::remove_pointer<hipsparseDnMatDescr_t>::type;
|
| 66 |
+
using cusparseDnVecDescr = std::remove_pointer<hipsparseDnVecDescr_t>::type;
|
| 67 |
+
using cusparseSpMatDescr = std::remove_pointer<hipsparseSpMatDescr_t>::type;
|
| 68 |
+
using cusparseSpMatDescr = std::remove_pointer<hipsparseSpMatDescr_t>::type;
|
| 69 |
+
using cusparseSpGEMMDescr = std::remove_pointer<hipsparseSpGEMMDescr_t>::type;
|
| 70 |
+
#if AT_USE_HIPSPARSE_TRIANGULAR_SOLVE()
|
| 71 |
+
using bsrsv2Info = std::remove_pointer<bsrsv2Info_t>::type;
|
| 72 |
+
using bsrsm2Info = std::remove_pointer<bsrsm2Info_t>::type;
|
| 73 |
+
#endif
|
| 74 |
+
#endif
|
| 75 |
+
|
| 76 |
+
// NOTE: This is only needed for CUDA 11 and earlier, since CUDA 12 introduced
|
| 77 |
+
// API for const descriptors
|
| 78 |
+
cusparseStatus_t destroyConstDnMat(const cusparseDnMatDescr* dnMatDescr);
|
| 79 |
+
|
| 80 |
+
class TORCH_CUDA_CPP_API CuSparseMatDescriptor
|
| 81 |
+
: public CuSparseDescriptor<cusparseMatDescr, &cusparseDestroyMatDescr> {
|
| 82 |
+
public:
|
| 83 |
+
CuSparseMatDescriptor() {
|
| 84 |
+
cusparseMatDescr_t raw_descriptor = nullptr;
|
| 85 |
+
TORCH_CUDASPARSE_CHECK(cusparseCreateMatDescr(&raw_descriptor));
|
| 86 |
+
descriptor_.reset(raw_descriptor);
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
CuSparseMatDescriptor(bool upper, bool unit) {
|
| 90 |
+
cusparseFillMode_t fill_mode =
|
| 91 |
+
upper ? CUSPARSE_FILL_MODE_UPPER : CUSPARSE_FILL_MODE_LOWER;
|
| 92 |
+
cusparseDiagType_t diag_type =
|
| 93 |
+
unit ? CUSPARSE_DIAG_TYPE_UNIT : CUSPARSE_DIAG_TYPE_NON_UNIT;
|
| 94 |
+
cusparseMatDescr_t raw_descriptor = nullptr;
|
| 95 |
+
TORCH_CUDASPARSE_CHECK(cusparseCreateMatDescr(&raw_descriptor));
|
| 96 |
+
TORCH_CUDASPARSE_CHECK(cusparseSetMatFillMode(raw_descriptor, fill_mode));
|
| 97 |
+
TORCH_CUDASPARSE_CHECK(cusparseSetMatDiagType(raw_descriptor, diag_type));
|
| 98 |
+
descriptor_.reset(raw_descriptor);
|
| 99 |
+
}
|
| 100 |
+
};
|
| 101 |
+
|
| 102 |
+
#if AT_USE_HIPSPARSE_TRIANGULAR_SOLVE()
|
| 103 |
+
|
| 104 |
+
class TORCH_CUDA_CPP_API CuSparseBsrsv2Info
|
| 105 |
+
: public CuSparseDescriptor<bsrsv2Info, &cusparseDestroyBsrsv2Info> {
|
| 106 |
+
public:
|
| 107 |
+
CuSparseBsrsv2Info() {
|
| 108 |
+
bsrsv2Info_t raw_descriptor = nullptr;
|
| 109 |
+
TORCH_CUDASPARSE_CHECK(cusparseCreateBsrsv2Info(&raw_descriptor));
|
| 110 |
+
descriptor_.reset(raw_descriptor);
|
| 111 |
+
}
|
| 112 |
+
};
|
| 113 |
+
|
| 114 |
+
class TORCH_CUDA_CPP_API CuSparseBsrsm2Info
|
| 115 |
+
: public CuSparseDescriptor<bsrsm2Info, &cusparseDestroyBsrsm2Info> {
|
| 116 |
+
public:
|
| 117 |
+
CuSparseBsrsm2Info() {
|
| 118 |
+
bsrsm2Info_t raw_descriptor = nullptr;
|
| 119 |
+
TORCH_CUDASPARSE_CHECK(cusparseCreateBsrsm2Info(&raw_descriptor));
|
| 120 |
+
descriptor_.reset(raw_descriptor);
|
| 121 |
+
}
|
| 122 |
+
};
|
| 123 |
+
|
| 124 |
+
#endif // AT_USE_HIPSPARSE_TRIANGULAR_SOLVE
|
| 125 |
+
|
| 126 |
+
#if AT_USE_CUSPARSE_GENERIC_API() || AT_USE_HIPSPARSE_GENERIC_API()
|
| 127 |
+
|
| 128 |
+
cusparseIndexType_t getCuSparseIndexType(const c10::ScalarType& scalar_type);
|
| 129 |
+
|
| 130 |
+
#if AT_USE_CUSPARSE_NON_CONST_DESCRIPTORS() || AT_USE_HIPSPARSE_NON_CONST_DESCRIPTORS()
|
| 131 |
+
class TORCH_CUDA_CPP_API CuSparseDnMatDescriptor
|
| 132 |
+
: public CuSparseDescriptor<cusparseDnMatDescr, &cusparseDestroyDnMat> {
|
| 133 |
+
public:
|
| 134 |
+
explicit CuSparseDnMatDescriptor(const Tensor& input, int64_t batch_offset = -1);
|
| 135 |
+
};
|
| 136 |
+
|
| 137 |
+
class TORCH_CUDA_CPP_API CuSparseConstDnMatDescriptor
|
| 138 |
+
: public CuSparseDescriptor<const cusparseDnMatDescr, &destroyConstDnMat> {
|
| 139 |
+
public:
|
| 140 |
+
explicit CuSparseConstDnMatDescriptor(const Tensor& input, int64_t batch_offset = -1);
|
| 141 |
+
cusparseDnMatDescr* unsafe_mutable_descriptor() const {
|
| 142 |
+
return const_cast<cusparseDnMatDescr*>(descriptor());
|
| 143 |
+
}
|
| 144 |
+
cusparseDnMatDescr* unsafe_mutable_descriptor() {
|
| 145 |
+
return const_cast<cusparseDnMatDescr*>(descriptor());
|
| 146 |
+
}
|
| 147 |
+
};
|
| 148 |
+
|
| 149 |
+
class TORCH_CUDA_CPP_API CuSparseDnVecDescriptor
|
| 150 |
+
: public CuSparseDescriptor<cusparseDnVecDescr, &cusparseDestroyDnVec> {
|
| 151 |
+
public:
|
| 152 |
+
explicit CuSparseDnVecDescriptor(const Tensor& input);
|
| 153 |
+
};
|
| 154 |
+
|
| 155 |
+
class TORCH_CUDA_CPP_API CuSparseSpMatDescriptor
|
| 156 |
+
: public CuSparseDescriptor<cusparseSpMatDescr, &cusparseDestroySpMat> {};
|
| 157 |
+
|
| 158 |
+
#elif AT_USE_CUSPARSE_CONST_DESCRIPTORS() || AT_USE_HIPSPARSE_CONST_DESCRIPTORS()
|
| 159 |
+
class TORCH_CUDA_CPP_API CuSparseDnMatDescriptor
|
| 160 |
+
: public ConstCuSparseDescriptor<
|
| 161 |
+
cusparseDnMatDescr,
|
| 162 |
+
&cusparseDestroyDnMat> {
|
| 163 |
+
public:
|
| 164 |
+
explicit CuSparseDnMatDescriptor(
|
| 165 |
+
const Tensor& input,
|
| 166 |
+
int64_t batch_offset = -1);
|
| 167 |
+
};
|
| 168 |
+
|
| 169 |
+
class TORCH_CUDA_CPP_API CuSparseConstDnMatDescriptor
|
| 170 |
+
: public ConstCuSparseDescriptor<
|
| 171 |
+
const cusparseDnMatDescr,
|
| 172 |
+
&destroyConstDnMat> {
|
| 173 |
+
public:
|
| 174 |
+
explicit CuSparseConstDnMatDescriptor(
|
| 175 |
+
const Tensor& input,
|
| 176 |
+
int64_t batch_offset = -1);
|
| 177 |
+
cusparseDnMatDescr* unsafe_mutable_descriptor() const {
|
| 178 |
+
return const_cast<cusparseDnMatDescr*>(descriptor());
|
| 179 |
+
}
|
| 180 |
+
cusparseDnMatDescr* unsafe_mutable_descriptor() {
|
| 181 |
+
return const_cast<cusparseDnMatDescr*>(descriptor());
|
| 182 |
+
}
|
| 183 |
+
};
|
| 184 |
+
|
| 185 |
+
class TORCH_CUDA_CPP_API CuSparseDnVecDescriptor
|
| 186 |
+
: public ConstCuSparseDescriptor<
|
| 187 |
+
cusparseDnVecDescr,
|
| 188 |
+
&cusparseDestroyDnVec> {
|
| 189 |
+
public:
|
| 190 |
+
explicit CuSparseDnVecDescriptor(const Tensor& input);
|
| 191 |
+
};
|
| 192 |
+
|
| 193 |
+
class TORCH_CUDA_CPP_API CuSparseSpMatDescriptor
|
| 194 |
+
: public ConstCuSparseDescriptor<
|
| 195 |
+
cusparseSpMatDescr,
|
| 196 |
+
&cusparseDestroySpMat> {};
|
| 197 |
+
#endif // AT_USE_CUSPARSE_CONST_DESCRIPTORS() || AT_USE_HIPSPARSE_CONST_DESCRIPTORS()
|
| 198 |
+
|
| 199 |
+
class TORCH_CUDA_CPP_API CuSparseSpMatCsrDescriptor
|
| 200 |
+
: public CuSparseSpMatDescriptor {
|
| 201 |
+
public:
|
| 202 |
+
explicit CuSparseSpMatCsrDescriptor(const Tensor& input, int64_t batch_offset = -1);
|
| 203 |
+
|
| 204 |
+
std::tuple<int64_t, int64_t, int64_t> get_size() {
|
| 205 |
+
int64_t rows = 0, cols = 0, nnz = 0;
|
| 206 |
+
TORCH_CUDASPARSE_CHECK(cusparseSpMatGetSize(
|
| 207 |
+
this->descriptor(),
|
| 208 |
+
&rows,
|
| 209 |
+
&cols,
|
| 210 |
+
&nnz));
|
| 211 |
+
return std::make_tuple(rows, cols, nnz);
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
void set_tensor(const Tensor& input) {
|
| 215 |
+
auto crow_indices = input.crow_indices();
|
| 216 |
+
auto col_indices = input.col_indices();
|
| 217 |
+
auto values = input.values();
|
| 218 |
+
|
| 219 |
+
TORCH_INTERNAL_ASSERT_DEBUG_ONLY(crow_indices.is_contiguous());
|
| 220 |
+
TORCH_INTERNAL_ASSERT_DEBUG_ONLY(col_indices.is_contiguous());
|
| 221 |
+
TORCH_INTERNAL_ASSERT_DEBUG_ONLY(values.is_contiguous());
|
| 222 |
+
TORCH_CUDASPARSE_CHECK(cusparseCsrSetPointers(
|
| 223 |
+
this->descriptor(),
|
| 224 |
+
crow_indices.data_ptr(),
|
| 225 |
+
col_indices.data_ptr(),
|
| 226 |
+
values.data_ptr()));
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
#if AT_USE_CUSPARSE_GENERIC_SPSV()
|
| 230 |
+
void set_mat_fill_mode(bool upper) {
|
| 231 |
+
cusparseFillMode_t fill_mode =
|
| 232 |
+
upper ? CUSPARSE_FILL_MODE_UPPER : CUSPARSE_FILL_MODE_LOWER;
|
| 233 |
+
TORCH_CUDASPARSE_CHECK(cusparseSpMatSetAttribute(
|
| 234 |
+
this->descriptor(),
|
| 235 |
+
CUSPARSE_SPMAT_FILL_MODE,
|
| 236 |
+
&fill_mode,
|
| 237 |
+
sizeof(fill_mode)));
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
void set_mat_diag_type(bool unit) {
|
| 241 |
+
cusparseDiagType_t diag_type =
|
| 242 |
+
unit ? CUSPARSE_DIAG_TYPE_UNIT : CUSPARSE_DIAG_TYPE_NON_UNIT;
|
| 243 |
+
TORCH_CUDASPARSE_CHECK(cusparseSpMatSetAttribute(
|
| 244 |
+
this->descriptor(),
|
| 245 |
+
CUSPARSE_SPMAT_DIAG_TYPE,
|
| 246 |
+
&diag_type,
|
| 247 |
+
sizeof(diag_type)));
|
| 248 |
+
}
|
| 249 |
+
#endif
|
| 250 |
+
};
|
| 251 |
+
|
| 252 |
+
#if AT_USE_CUSPARSE_GENERIC_SPSV()
|
| 253 |
+
class TORCH_CUDA_CPP_API CuSparseSpSVDescriptor
|
| 254 |
+
: public CuSparseDescriptor<cusparseSpSVDescr, &cusparseSpSV_destroyDescr> {
|
| 255 |
+
public:
|
| 256 |
+
CuSparseSpSVDescriptor() {
|
| 257 |
+
cusparseSpSVDescr_t raw_descriptor = nullptr;
|
| 258 |
+
TORCH_CUDASPARSE_CHECK(cusparseSpSV_createDescr(&raw_descriptor));
|
| 259 |
+
descriptor_.reset(raw_descriptor);
|
| 260 |
+
}
|
| 261 |
+
};
|
| 262 |
+
#endif
|
| 263 |
+
|
| 264 |
+
#if AT_USE_CUSPARSE_GENERIC_SPSM()
|
| 265 |
+
class TORCH_CUDA_CPP_API CuSparseSpSMDescriptor
|
| 266 |
+
: public CuSparseDescriptor<cusparseSpSMDescr, &cusparseSpSM_destroyDescr> {
|
| 267 |
+
public:
|
| 268 |
+
CuSparseSpSMDescriptor() {
|
| 269 |
+
cusparseSpSMDescr_t raw_descriptor = nullptr;
|
| 270 |
+
TORCH_CUDASPARSE_CHECK(cusparseSpSM_createDescr(&raw_descriptor));
|
| 271 |
+
descriptor_.reset(raw_descriptor);
|
| 272 |
+
}
|
| 273 |
+
};
|
| 274 |
+
#endif
|
| 275 |
+
|
| 276 |
+
class TORCH_CUDA_CPP_API CuSparseSpGEMMDescriptor
|
| 277 |
+
: public CuSparseDescriptor<cusparseSpGEMMDescr, &cusparseSpGEMM_destroyDescr> {
|
| 278 |
+
public:
|
| 279 |
+
CuSparseSpGEMMDescriptor() {
|
| 280 |
+
cusparseSpGEMMDescr_t raw_descriptor = nullptr;
|
| 281 |
+
TORCH_CUDASPARSE_CHECK(cusparseSpGEMM_createDescr(&raw_descriptor));
|
| 282 |
+
descriptor_.reset(raw_descriptor);
|
| 283 |
+
}
|
| 284 |
+
};
|
| 285 |
+
|
| 286 |
+
#endif // AT_USE_CUSPARSE_GENERIC_API() || AT_USE_HIPSPARSE_GENERIC_API()
|
| 287 |
+
|
| 288 |
+
} // namespace at::cuda::sparse
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDATensorMethods.cuh
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <ATen/Tensor.h>
|
| 4 |
+
#include <c10/util/Half.h>
|
| 5 |
+
|
| 6 |
+
#include <cuda.h>
|
| 7 |
+
#include <cuda_runtime.h>
|
| 8 |
+
#include <cuda_fp16.h>
|
| 9 |
+
|
| 10 |
+
namespace at {
|
| 11 |
+
template <>
|
| 12 |
+
inline __half* Tensor::data() const {
|
| 13 |
+
return reinterpret_cast<__half*>(data<Half>());
|
| 14 |
+
}
|
| 15 |
+
} // namespace at
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAUtils.h
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <ATen/cuda/CUDAContext.h>
|
| 4 |
+
|
| 5 |
+
namespace at::cuda {
|
| 6 |
+
|
| 7 |
+
// Check if every tensor in a list of tensors matches the current
|
| 8 |
+
// device.
|
| 9 |
+
inline bool check_device(ArrayRef<Tensor> ts) {
|
| 10 |
+
if (ts.empty()) {
|
| 11 |
+
return true;
|
| 12 |
+
}
|
| 13 |
+
Device curDevice = Device(kCUDA, current_device());
|
| 14 |
+
for (const Tensor& t : ts) {
|
| 15 |
+
if (t.device() != curDevice) return false;
|
| 16 |
+
}
|
| 17 |
+
return true;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
} // namespace at::cuda
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/CachingHostAllocator.h
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <ATen/core/CachingHostAllocator.h>
|
| 4 |
+
#include <c10/core/Allocator.h>
|
| 5 |
+
#include <c10/cuda/CUDAStream.h>
|
| 6 |
+
|
| 7 |
+
namespace at::cuda {
|
| 8 |
+
|
| 9 |
+
//
|
| 10 |
+
// A caching allocator for CUDA host allocations (pinned memory).
|
| 11 |
+
//
|
| 12 |
+
// This provides a drop-in replacement for THCudaHostAllocator, which re-uses
|
| 13 |
+
// freed pinned (page-locked) memory allocations. This avoids device
|
| 14 |
+
// synchronizations due to cudaFreeHost calls.
|
| 15 |
+
//
|
| 16 |
+
// To ensure correct behavior, THCCachingHostAllocator_recordEvent must be
|
| 17 |
+
// called anytime a pointer from this allocator is used in a cudaMemcpyAsync
|
| 18 |
+
// call between host and device, and passed the corresponding context from the
|
| 19 |
+
// allocation. This is currently invoked by at::native::copy_kernel_cuda.
|
| 20 |
+
//
|
| 21 |
+
TORCH_CUDA_CPP_API c10::Allocator* getCachingHostAllocator();
|
| 22 |
+
|
| 23 |
+
// Records an event in the specified stream. The allocation corresponding to the
|
| 24 |
+
// input `ptr`/`ctx` will not be re-used until the event has occurred.
|
| 25 |
+
TORCH_CUDA_CPP_API bool CachingHostAllocator_recordEvent(
|
| 26 |
+
void* ptr,
|
| 27 |
+
void* ctx,
|
| 28 |
+
c10::cuda::CUDAStream stream);
|
| 29 |
+
|
| 30 |
+
// Releases cached pinned memory allocations via cudaHostFree
|
| 31 |
+
TORCH_CUDA_CPP_API void CachingHostAllocator_emptyCache();
|
| 32 |
+
|
| 33 |
+
inline TORCH_CUDA_CPP_API at::DataPtr HostAlloc(size_t size) {
|
| 34 |
+
return getCachingHostAllocator()->allocate(size);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
} // namespace at::cuda
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/DeviceUtils.cuh
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <cuda.h>
|
| 4 |
+
#include <c10/util/complex.h>
|
| 5 |
+
#include <c10/util/Half.h>
|
| 6 |
+
|
| 7 |
+
__device__ __forceinline__ unsigned int ACTIVE_MASK()
|
| 8 |
+
{
|
| 9 |
+
#if !defined(USE_ROCM)
|
| 10 |
+
return __activemask();
|
| 11 |
+
#else
|
| 12 |
+
// will be ignored anyway
|
| 13 |
+
return 0xffffffff;
|
| 14 |
+
#endif
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
__device__ __forceinline__ void WARP_SYNC(unsigned mask = 0xffffffff) {
|
| 18 |
+
#if !defined(USE_ROCM)
|
| 19 |
+
return __syncwarp(mask);
|
| 20 |
+
#endif
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
#if defined(USE_ROCM)
|
| 24 |
+
__device__ __forceinline__ unsigned long long int WARP_BALLOT(int predicate)
|
| 25 |
+
{
|
| 26 |
+
return __ballot(predicate);
|
| 27 |
+
}
|
| 28 |
+
#else
|
| 29 |
+
__device__ __forceinline__ unsigned int WARP_BALLOT(int predicate, unsigned int mask = 0xffffffff)
|
| 30 |
+
{
|
| 31 |
+
#if !defined(USE_ROCM)
|
| 32 |
+
return __ballot_sync(mask, predicate);
|
| 33 |
+
#else
|
| 34 |
+
return __ballot(predicate);
|
| 35 |
+
#endif
|
| 36 |
+
}
|
| 37 |
+
#endif
|
| 38 |
+
|
| 39 |
+
template <typename T>
|
| 40 |
+
__device__ __forceinline__ T WARP_SHFL_XOR(T value, int laneMask, int width = warpSize, unsigned int mask = 0xffffffff)
|
| 41 |
+
{
|
| 42 |
+
#if !defined(USE_ROCM)
|
| 43 |
+
return __shfl_xor_sync(mask, value, laneMask, width);
|
| 44 |
+
#else
|
| 45 |
+
return __shfl_xor(value, laneMask, width);
|
| 46 |
+
#endif
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
template <typename T>
|
| 50 |
+
__device__ __forceinline__ T WARP_SHFL(T value, int srcLane, int width = warpSize, unsigned int mask = 0xffffffff)
|
| 51 |
+
{
|
| 52 |
+
#if !defined(USE_ROCM)
|
| 53 |
+
return __shfl_sync(mask, value, srcLane, width);
|
| 54 |
+
#else
|
| 55 |
+
return __shfl(value, srcLane, width);
|
| 56 |
+
#endif
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
template <typename T>
|
| 60 |
+
__device__ __forceinline__ T WARP_SHFL_UP(T value, unsigned int delta, int width = warpSize, unsigned int mask = 0xffffffff)
|
| 61 |
+
{
|
| 62 |
+
#if !defined(USE_ROCM)
|
| 63 |
+
return __shfl_up_sync(mask, value, delta, width);
|
| 64 |
+
#else
|
| 65 |
+
return __shfl_up(value, delta, width);
|
| 66 |
+
#endif
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
template <typename T>
|
| 70 |
+
__device__ __forceinline__ T WARP_SHFL_DOWN(T value, unsigned int delta, int width = warpSize, unsigned int mask = 0xffffffff)
|
| 71 |
+
{
|
| 72 |
+
#if !defined(USE_ROCM)
|
| 73 |
+
return __shfl_down_sync(mask, value, delta, width);
|
| 74 |
+
#else
|
| 75 |
+
return __shfl_down(value, delta, width);
|
| 76 |
+
#endif
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
#if defined(USE_ROCM)
|
| 80 |
+
template<>
|
| 81 |
+
__device__ __forceinline__ int64_t WARP_SHFL_DOWN<int64_t>(int64_t value, unsigned int delta, int width , unsigned int mask)
|
| 82 |
+
{
|
| 83 |
+
//(HIP doesn't support int64_t). Trick from https://devblogs.nvidia.com/faster-parallel-reductions-kepler/
|
| 84 |
+
int2 a = *reinterpret_cast<int2*>(&value);
|
| 85 |
+
a.x = __shfl_down(a.x, delta);
|
| 86 |
+
a.y = __shfl_down(a.y, delta);
|
| 87 |
+
return *reinterpret_cast<int64_t*>(&a);
|
| 88 |
+
}
|
| 89 |
+
#endif
|
| 90 |
+
|
| 91 |
+
template<>
|
| 92 |
+
__device__ __forceinline__ c10::Half WARP_SHFL_DOWN<c10::Half>(c10::Half value, unsigned int delta, int width, unsigned int mask)
|
| 93 |
+
{
|
| 94 |
+
return c10::Half(WARP_SHFL_DOWN<unsigned short>(value.x, delta, width, mask), c10::Half::from_bits_t{});
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
template <typename T>
|
| 98 |
+
__device__ __forceinline__ c10::complex<T> WARP_SHFL_DOWN(c10::complex<T> value, unsigned int delta, int width = warpSize, unsigned int mask = 0xffffffff)
|
| 99 |
+
{
|
| 100 |
+
#if !defined(USE_ROCM)
|
| 101 |
+
return c10::complex<T>(
|
| 102 |
+
__shfl_down_sync(mask, value.real_, delta, width),
|
| 103 |
+
__shfl_down_sync(mask, value.imag_, delta, width));
|
| 104 |
+
#else
|
| 105 |
+
return c10::complex<T>(
|
| 106 |
+
__shfl_down(value.real_, delta, width),
|
| 107 |
+
__shfl_down(value.imag_, delta, width));
|
| 108 |
+
#endif
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
/**
|
| 112 |
+
* For CC 3.5+, perform a load using __ldg
|
| 113 |
+
*/
|
| 114 |
+
template <typename T>
|
| 115 |
+
__device__ __forceinline__ T doLdg(const T* p) {
|
| 116 |
+
#if __CUDA_ARCH__ >= 350 && !defined(USE_ROCM)
|
| 117 |
+
return __ldg(p);
|
| 118 |
+
#else
|
| 119 |
+
return *p;
|
| 120 |
+
#endif
|
| 121 |
+
}
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/EmptyTensor.h
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
#include <ATen/core/TensorBase.h>
|
| 3 |
+
|
| 4 |
+
namespace at::detail {
|
| 5 |
+
|
| 6 |
+
TORCH_CUDA_CPP_API TensorBase empty_cuda(
|
| 7 |
+
IntArrayRef size,
|
| 8 |
+
ScalarType dtype,
|
| 9 |
+
std::optional<Device> device_opt,
|
| 10 |
+
std::optional<c10::MemoryFormat> memory_format_opt);
|
| 11 |
+
|
| 12 |
+
TORCH_CUDA_CPP_API TensorBase empty_cuda(
|
| 13 |
+
IntArrayRef size,
|
| 14 |
+
std::optional<ScalarType> dtype_opt,
|
| 15 |
+
std::optional<Layout> layout_opt,
|
| 16 |
+
std::optional<Device> device_opt,
|
| 17 |
+
std::optional<bool> pin_memory_opt,
|
| 18 |
+
std::optional<c10::MemoryFormat> memory_format_opt);
|
| 19 |
+
|
| 20 |
+
TORCH_CUDA_CPP_API TensorBase empty_cuda(
|
| 21 |
+
IntArrayRef size,
|
| 22 |
+
const TensorOptions &options);
|
| 23 |
+
|
| 24 |
+
TORCH_CUDA_CPP_API TensorBase empty_strided_cuda(
|
| 25 |
+
IntArrayRef size,
|
| 26 |
+
IntArrayRef stride,
|
| 27 |
+
ScalarType dtype,
|
| 28 |
+
std::optional<Device> device_opt);
|
| 29 |
+
|
| 30 |
+
TORCH_CUDA_CPP_API TensorBase empty_strided_cuda(
|
| 31 |
+
IntArrayRef size,
|
| 32 |
+
IntArrayRef stride,
|
| 33 |
+
std::optional<ScalarType> dtype_opt,
|
| 34 |
+
std::optional<Layout> layout_opt,
|
| 35 |
+
std::optional<Device> device_opt,
|
| 36 |
+
std::optional<bool> pin_memory_opt);
|
| 37 |
+
|
| 38 |
+
TORCH_CUDA_CPP_API TensorBase empty_strided_cuda(
|
| 39 |
+
IntArrayRef size,
|
| 40 |
+
IntArrayRef stride,
|
| 41 |
+
const TensorOptions &options);
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
} // namespace at::detail
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/Exceptions.h
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <cublas_v2.h>
|
| 4 |
+
#include <cusparse.h>
|
| 5 |
+
#include <c10/macros/Export.h>
|
| 6 |
+
|
| 7 |
+
#ifdef CUDART_VERSION
|
| 8 |
+
#include <cusolver_common.h>
|
| 9 |
+
#endif
|
| 10 |
+
|
| 11 |
+
#if defined(USE_CUDSS)
|
| 12 |
+
#include <cudss.h>
|
| 13 |
+
#endif
|
| 14 |
+
|
| 15 |
+
#include <ATen/Context.h>
|
| 16 |
+
#include <c10/util/Exception.h>
|
| 17 |
+
#include <c10/cuda/CUDAException.h>
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
namespace c10 {
|
| 21 |
+
|
| 22 |
+
class CuDNNError : public c10::Error {
|
| 23 |
+
using Error::Error;
|
| 24 |
+
};
|
| 25 |
+
|
| 26 |
+
} // namespace c10
|
| 27 |
+
|
| 28 |
+
#define AT_CUDNN_FRONTEND_CHECK(EXPR, ...) \
|
| 29 |
+
do { \
|
| 30 |
+
auto error_object = EXPR; \
|
| 31 |
+
if (!error_object.is_good()) { \
|
| 32 |
+
TORCH_CHECK_WITH(CuDNNError, false, \
|
| 33 |
+
"cuDNN Frontend error: ", error_object.get_message()); \
|
| 34 |
+
} \
|
| 35 |
+
} while (0) \
|
| 36 |
+
|
| 37 |
+
#define AT_CUDNN_CHECK_WITH_SHAPES(EXPR, ...) AT_CUDNN_CHECK(EXPR, "\n", ##__VA_ARGS__)
|
| 38 |
+
|
| 39 |
+
// See Note [CHECK macro]
|
| 40 |
+
#define AT_CUDNN_CHECK(EXPR, ...) \
|
| 41 |
+
do { \
|
| 42 |
+
cudnnStatus_t status = EXPR; \
|
| 43 |
+
if (status != CUDNN_STATUS_SUCCESS) { \
|
| 44 |
+
if (status == CUDNN_STATUS_NOT_SUPPORTED) { \
|
| 45 |
+
TORCH_CHECK_WITH(CuDNNError, false, \
|
| 46 |
+
"cuDNN error: ", \
|
| 47 |
+
cudnnGetErrorString(status), \
|
| 48 |
+
". This error may appear if you passed in a non-contiguous input.", ##__VA_ARGS__); \
|
| 49 |
+
} else { \
|
| 50 |
+
TORCH_CHECK_WITH(CuDNNError, false, \
|
| 51 |
+
"cuDNN error: ", cudnnGetErrorString(status), ##__VA_ARGS__); \
|
| 52 |
+
} \
|
| 53 |
+
} \
|
| 54 |
+
} while (0)
|
| 55 |
+
|
| 56 |
+
namespace at::cuda::blas {
|
| 57 |
+
C10_EXPORT const char* _cublasGetErrorEnum(cublasStatus_t error);
|
| 58 |
+
} // namespace at::cuda::blas
|
| 59 |
+
|
| 60 |
+
#define TORCH_CUDABLAS_CHECK(EXPR) \
|
| 61 |
+
do { \
|
| 62 |
+
cublasStatus_t __err = EXPR; \
|
| 63 |
+
TORCH_CHECK(__err == CUBLAS_STATUS_SUCCESS, \
|
| 64 |
+
"CUDA error: ", \
|
| 65 |
+
at::cuda::blas::_cublasGetErrorEnum(__err), \
|
| 66 |
+
" when calling `" #EXPR "`"); \
|
| 67 |
+
} while (0)
|
| 68 |
+
|
| 69 |
+
const char *cusparseGetErrorString(cusparseStatus_t status);
|
| 70 |
+
|
| 71 |
+
#define TORCH_CUDASPARSE_CHECK(EXPR) \
|
| 72 |
+
do { \
|
| 73 |
+
cusparseStatus_t __err = EXPR; \
|
| 74 |
+
TORCH_CHECK(__err == CUSPARSE_STATUS_SUCCESS, \
|
| 75 |
+
"CUDA error: ", \
|
| 76 |
+
cusparseGetErrorString(__err), \
|
| 77 |
+
" when calling `" #EXPR "`"); \
|
| 78 |
+
} while (0)
|
| 79 |
+
|
| 80 |
+
#if defined(USE_CUDSS)
|
| 81 |
+
namespace at::cuda::cudss {
|
| 82 |
+
C10_EXPORT const char* cudssGetErrorMessage(cudssStatus_t error);
|
| 83 |
+
} // namespace at::cuda::solver
|
| 84 |
+
|
| 85 |
+
#define TORCH_CUDSS_CHECK(EXPR) \
|
| 86 |
+
do { \
|
| 87 |
+
cudssStatus_t __err = EXPR; \
|
| 88 |
+
if (__err == CUDSS_STATUS_EXECUTION_FAILED) { \
|
| 89 |
+
TORCH_CHECK_LINALG( \
|
| 90 |
+
false, \
|
| 91 |
+
"cudss error: ", \
|
| 92 |
+
at::cuda::cudss::cudssGetErrorMessage(__err), \
|
| 93 |
+
", when calling `" #EXPR "`", \
|
| 94 |
+
". This error may appear if the input matrix contains NaN. ");\
|
| 95 |
+
} else { \
|
| 96 |
+
TORCH_CHECK( \
|
| 97 |
+
__err == CUDSS_STATUS_SUCCESS, \
|
| 98 |
+
"cudss error: ", \
|
| 99 |
+
at::cuda::cudss::cudssGetErrorMessage(__err), \
|
| 100 |
+
", when calling `" #EXPR "`. "); \
|
| 101 |
+
} \
|
| 102 |
+
} while (0)
|
| 103 |
+
#else
|
| 104 |
+
#define TORCH_CUDSS_CHECK(EXPR) EXPR
|
| 105 |
+
#endif
|
| 106 |
+
|
| 107 |
+
// cusolver related headers are only supported on cuda now
|
| 108 |
+
#ifdef CUDART_VERSION
|
| 109 |
+
|
| 110 |
+
namespace at::cuda::solver {
|
| 111 |
+
C10_EXPORT const char* cusolverGetErrorMessage(cusolverStatus_t status);
|
| 112 |
+
|
| 113 |
+
constexpr const char* _cusolver_backend_suggestion = \
|
| 114 |
+
"If you keep seeing this error, you may use " \
|
| 115 |
+
"`torch.backends.cuda.preferred_linalg_library()` to try " \
|
| 116 |
+
"linear algebra operators with other supported backends. " \
|
| 117 |
+
"See https://pytorch.org/docs/stable/backends.html#torch.backends.cuda.preferred_linalg_library";
|
| 118 |
+
|
| 119 |
+
} // namespace at::cuda::solver
|
| 120 |
+
|
| 121 |
+
// When cuda < 11.5, cusolver raises CUSOLVER_STATUS_EXECUTION_FAILED when input contains nan.
|
| 122 |
+
// When cuda >= 11.5, cusolver normally finishes execution and sets info array indicating convergence issue.
|
| 123 |
+
#define TORCH_CUSOLVER_CHECK(EXPR) \
|
| 124 |
+
do { \
|
| 125 |
+
cusolverStatus_t __err = EXPR; \
|
| 126 |
+
if ((CUDA_VERSION < 11500 && \
|
| 127 |
+
__err == CUSOLVER_STATUS_EXECUTION_FAILED) || \
|
| 128 |
+
(CUDA_VERSION >= 11500 && \
|
| 129 |
+
__err == CUSOLVER_STATUS_INVALID_VALUE)) { \
|
| 130 |
+
TORCH_CHECK_LINALG( \
|
| 131 |
+
false, \
|
| 132 |
+
"cusolver error: ", \
|
| 133 |
+
at::cuda::solver::cusolverGetErrorMessage(__err), \
|
| 134 |
+
", when calling `" #EXPR "`", \
|
| 135 |
+
". This error may appear if the input matrix contains NaN. ", \
|
| 136 |
+
at::cuda::solver::_cusolver_backend_suggestion); \
|
| 137 |
+
} else { \
|
| 138 |
+
TORCH_CHECK( \
|
| 139 |
+
__err == CUSOLVER_STATUS_SUCCESS, \
|
| 140 |
+
"cusolver error: ", \
|
| 141 |
+
at::cuda::solver::cusolverGetErrorMessage(__err), \
|
| 142 |
+
", when calling `" #EXPR "`. ", \
|
| 143 |
+
at::cuda::solver::_cusolver_backend_suggestion); \
|
| 144 |
+
} \
|
| 145 |
+
} while (0)
|
| 146 |
+
|
| 147 |
+
#else
|
| 148 |
+
#define TORCH_CUSOLVER_CHECK(EXPR) EXPR
|
| 149 |
+
#endif
|
| 150 |
+
|
| 151 |
+
#define AT_CUDA_CHECK(EXPR) C10_CUDA_CHECK(EXPR)
|
| 152 |
+
|
| 153 |
+
// For CUDA Driver API
|
| 154 |
+
//
|
| 155 |
+
// This is here instead of in c10 because NVRTC is loaded dynamically via a stub
|
| 156 |
+
// in ATen, and we need to use its nvrtcGetErrorString.
|
| 157 |
+
// See NOTE [ USE OF NVRTC AND DRIVER API ].
|
| 158 |
+
#if !defined(USE_ROCM)
|
| 159 |
+
|
| 160 |
+
#define AT_CUDA_DRIVER_CHECK(EXPR) \
|
| 161 |
+
do { \
|
| 162 |
+
CUresult __err = EXPR; \
|
| 163 |
+
if (__err != CUDA_SUCCESS) { \
|
| 164 |
+
const char* err_str; \
|
| 165 |
+
CUresult get_error_str_err C10_UNUSED = at::globalContext().getNVRTC().cuGetErrorString(__err, &err_str); \
|
| 166 |
+
if (get_error_str_err != CUDA_SUCCESS) { \
|
| 167 |
+
AT_ERROR("CUDA driver error: unknown error"); \
|
| 168 |
+
} else { \
|
| 169 |
+
AT_ERROR("CUDA driver error: ", err_str); \
|
| 170 |
+
} \
|
| 171 |
+
} \
|
| 172 |
+
} while (0)
|
| 173 |
+
|
| 174 |
+
#else
|
| 175 |
+
|
| 176 |
+
#define AT_CUDA_DRIVER_CHECK(EXPR) \
|
| 177 |
+
do { \
|
| 178 |
+
CUresult __err = EXPR; \
|
| 179 |
+
if (__err != CUDA_SUCCESS) { \
|
| 180 |
+
AT_ERROR("CUDA driver error: ", static_cast<int>(__err)); \
|
| 181 |
+
} \
|
| 182 |
+
} while (0)
|
| 183 |
+
|
| 184 |
+
#endif
|
| 185 |
+
|
| 186 |
+
// For CUDA NVRTC
|
| 187 |
+
//
|
| 188 |
+
// Note: As of CUDA 10, nvrtc error code 7, NVRTC_ERROR_BUILTIN_OPERATION_FAILURE,
|
| 189 |
+
// incorrectly produces the error string "NVRTC unknown error."
|
| 190 |
+
// The following maps it correctly.
|
| 191 |
+
//
|
| 192 |
+
// This is here instead of in c10 because NVRTC is loaded dynamically via a stub
|
| 193 |
+
// in ATen, and we need to use its nvrtcGetErrorString.
|
| 194 |
+
// See NOTE [ USE OF NVRTC AND DRIVER API ].
|
| 195 |
+
#define AT_CUDA_NVRTC_CHECK(EXPR) \
|
| 196 |
+
do { \
|
| 197 |
+
nvrtcResult __err = EXPR; \
|
| 198 |
+
if (__err != NVRTC_SUCCESS) { \
|
| 199 |
+
if (static_cast<int>(__err) != 7) { \
|
| 200 |
+
AT_ERROR("CUDA NVRTC error: ", at::globalContext().getNVRTC().nvrtcGetErrorString(__err)); \
|
| 201 |
+
} else { \
|
| 202 |
+
AT_ERROR("CUDA NVRTC error: NVRTC_ERROR_BUILTIN_OPERATION_FAILURE"); \
|
| 203 |
+
} \
|
| 204 |
+
} \
|
| 205 |
+
} while (0)
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/NumericLimits.cuh
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <cuda.h>
|
| 4 |
+
#include <limits.h>
|
| 5 |
+
#include <math.h>
|
| 6 |
+
#include <float.h>
|
| 7 |
+
|
| 8 |
+
// NumericLimits.cuh is a holder for numeric limits definitions of commonly used
|
| 9 |
+
// types. This header is very specific to ROCm HIP and may be removed in the future.
|
| 10 |
+
// This header is derived from the legacy THCNumerics.cuh.
|
| 11 |
+
|
| 12 |
+
// The lower_bound and upper_bound constants are same as lowest and max for
|
| 13 |
+
// integral types, but are -inf and +inf for floating point types. They are
|
| 14 |
+
// useful in implementing min, max, etc.
|
| 15 |
+
|
| 16 |
+
namespace at {
|
| 17 |
+
|
| 18 |
+
template <typename T>
|
| 19 |
+
struct numeric_limits {
|
| 20 |
+
};
|
| 21 |
+
|
| 22 |
+
// WARNING: the following at::numeric_limits definitions are there only to support
|
| 23 |
+
// HIP compilation for the moment. Use std::numeric_limits if you are not
|
| 24 |
+
// compiling for ROCm.
|
| 25 |
+
// from @colesbury: "The functions on numeric_limits aren't marked with
|
| 26 |
+
// __device__ which is why they don't work with ROCm. CUDA allows them
|
| 27 |
+
// because they're constexpr."
|
| 28 |
+
|
| 29 |
+
namespace {
|
| 30 |
+
// ROCm doesn't like INFINITY too.
|
| 31 |
+
constexpr double inf = INFINITY;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
template <>
|
| 35 |
+
struct numeric_limits<bool> {
|
| 36 |
+
static inline __host__ __device__ bool lowest() { return false; }
|
| 37 |
+
static inline __host__ __device__ bool max() { return true; }
|
| 38 |
+
static inline __host__ __device__ bool lower_bound() { return false; }
|
| 39 |
+
static inline __host__ __device__ bool upper_bound() { return true; }
|
| 40 |
+
};
|
| 41 |
+
|
| 42 |
+
template <>
|
| 43 |
+
struct numeric_limits<uint8_t> {
|
| 44 |
+
static inline __host__ __device__ uint8_t lowest() { return 0; }
|
| 45 |
+
static inline __host__ __device__ uint8_t max() { return UINT8_MAX; }
|
| 46 |
+
static inline __host__ __device__ uint8_t lower_bound() { return 0; }
|
| 47 |
+
static inline __host__ __device__ uint8_t upper_bound() { return UINT8_MAX; }
|
| 48 |
+
};
|
| 49 |
+
|
| 50 |
+
template <>
|
| 51 |
+
struct numeric_limits<int8_t> {
|
| 52 |
+
static inline __host__ __device__ int8_t lowest() { return INT8_MIN; }
|
| 53 |
+
static inline __host__ __device__ int8_t max() { return INT8_MAX; }
|
| 54 |
+
static inline __host__ __device__ int8_t lower_bound() { return INT8_MIN; }
|
| 55 |
+
static inline __host__ __device__ int8_t upper_bound() { return INT8_MAX; }
|
| 56 |
+
};
|
| 57 |
+
|
| 58 |
+
template <>
|
| 59 |
+
struct numeric_limits<int16_t> {
|
| 60 |
+
static inline __host__ __device__ int16_t lowest() { return INT16_MIN; }
|
| 61 |
+
static inline __host__ __device__ int16_t max() { return INT16_MAX; }
|
| 62 |
+
static inline __host__ __device__ int16_t lower_bound() { return INT16_MIN; }
|
| 63 |
+
static inline __host__ __device__ int16_t upper_bound() { return INT16_MAX; }
|
| 64 |
+
};
|
| 65 |
+
|
| 66 |
+
template <>
|
| 67 |
+
struct numeric_limits<int32_t> {
|
| 68 |
+
static inline __host__ __device__ int32_t lowest() { return INT32_MIN; }
|
| 69 |
+
static inline __host__ __device__ int32_t max() { return INT32_MAX; }
|
| 70 |
+
static inline __host__ __device__ int32_t lower_bound() { return INT32_MIN; }
|
| 71 |
+
static inline __host__ __device__ int32_t upper_bound() { return INT32_MAX; }
|
| 72 |
+
};
|
| 73 |
+
|
| 74 |
+
template <>
|
| 75 |
+
struct numeric_limits<int64_t> {
|
| 76 |
+
#ifdef _MSC_VER
|
| 77 |
+
static inline __host__ __device__ int64_t lowest() { return _I64_MIN; }
|
| 78 |
+
static inline __host__ __device__ int64_t max() { return _I64_MAX; }
|
| 79 |
+
static inline __host__ __device__ int64_t lower_bound() { return _I64_MIN; }
|
| 80 |
+
static inline __host__ __device__ int64_t upper_bound() { return _I64_MAX; }
|
| 81 |
+
#else
|
| 82 |
+
static inline __host__ __device__ int64_t lowest() { return INT64_MIN; }
|
| 83 |
+
static inline __host__ __device__ int64_t max() { return INT64_MAX; }
|
| 84 |
+
static inline __host__ __device__ int64_t lower_bound() { return INT64_MIN; }
|
| 85 |
+
static inline __host__ __device__ int64_t upper_bound() { return INT64_MAX; }
|
| 86 |
+
#endif
|
| 87 |
+
};
|
| 88 |
+
|
| 89 |
+
template <>
|
| 90 |
+
struct numeric_limits<at::Half> {
|
| 91 |
+
static inline __host__ __device__ at::Half lowest() { return at::Half(0xFBFF, at::Half::from_bits()); }
|
| 92 |
+
static inline __host__ __device__ at::Half max() { return at::Half(0x7BFF, at::Half::from_bits()); }
|
| 93 |
+
static inline __host__ __device__ at::Half lower_bound() { return at::Half(0xFC00, at::Half::from_bits()); }
|
| 94 |
+
static inline __host__ __device__ at::Half upper_bound() { return at::Half(0x7C00, at::Half::from_bits()); }
|
| 95 |
+
};
|
| 96 |
+
|
| 97 |
+
template <>
|
| 98 |
+
struct numeric_limits<at::BFloat16> {
|
| 99 |
+
static inline __host__ __device__ at::BFloat16 lowest() { return at::BFloat16(0xFF7F, at::BFloat16::from_bits()); }
|
| 100 |
+
static inline __host__ __device__ at::BFloat16 max() { return at::BFloat16(0x7F7F, at::BFloat16::from_bits()); }
|
| 101 |
+
static inline __host__ __device__ at::BFloat16 lower_bound() { return at::BFloat16(0xFF80, at::BFloat16::from_bits()); }
|
| 102 |
+
static inline __host__ __device__ at::BFloat16 upper_bound() { return at::BFloat16(0x7F80, at::BFloat16::from_bits()); }
|
| 103 |
+
};
|
| 104 |
+
|
| 105 |
+
template <>
|
| 106 |
+
struct numeric_limits<float> {
|
| 107 |
+
static inline __host__ __device__ float lowest() { return -FLT_MAX; }
|
| 108 |
+
static inline __host__ __device__ float max() { return FLT_MAX; }
|
| 109 |
+
static inline __host__ __device__ float lower_bound() { return -static_cast<float>(inf); }
|
| 110 |
+
static inline __host__ __device__ float upper_bound() { return static_cast<float>(inf); }
|
| 111 |
+
};
|
| 112 |
+
|
| 113 |
+
template <>
|
| 114 |
+
struct numeric_limits<double> {
|
| 115 |
+
static inline __host__ __device__ double lowest() { return -DBL_MAX; }
|
| 116 |
+
static inline __host__ __device__ double max() { return DBL_MAX; }
|
| 117 |
+
static inline __host__ __device__ double lower_bound() { return -inf; }
|
| 118 |
+
static inline __host__ __device__ double upper_bound() { return inf; }
|
| 119 |
+
};
|
| 120 |
+
|
| 121 |
+
} // namespace at
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/PeerToPeerAccess.h
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#include <c10/macros/Macros.h>
|
| 2 |
+
#include <cstdint>
|
| 3 |
+
|
| 4 |
+
namespace at::cuda {
|
| 5 |
+
namespace detail {
|
| 6 |
+
void init_p2p_access_cache(int64_t num_devices);
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
TORCH_CUDA_CPP_API bool get_p2p_access(int source_dev, int dest_dev);
|
| 10 |
+
|
| 11 |
+
} // namespace at::cuda
|
pllava/lib/python3.10/site-packages/torch/include/ATen/cuda/PhiloxUtils.cuh
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <ATen/cuda/PhiloxCudaState.h>
|
| 4 |
+
#include <ATen/cuda/detail/UnpackRaw.cuh>
|