-
Notifications
You must be signed in to change notification settings - Fork 751
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upgrade and further improve presets for PyTorch 2.1.0 (pull #1426)
- Loading branch information
1 parent
7d56a2c
commit 5507552
Showing
319 changed files
with
11,587 additions
and
7,488 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/perl | ||
|
||
# Must be run at from javacpp-presets/pytorch after cppbuild.sh has been run | ||
# for linux-x86_64-gpu | ||
|
||
# Generate the lists of includes to parse, in order, from the output | ||
# of g++ -H | ||
# Used to update src/main/resources/org/bytedeco/pytorch/presets/* | ||
|
||
use strict; | ||
use warnings; | ||
|
||
my %incs; | ||
my @inc_per_depth; | ||
|
||
sub flush($) { | ||
my $min_depth = shift; | ||
for (my $d = @inc_per_depth - 1; $d >= $min_depth; $d--) { | ||
if ($inc_per_depth[$d]) { | ||
foreach my $i (@{$inc_per_depth[$d]}) { | ||
print "#include \"$i\"\n"; | ||
$incs{$i} = 1; | ||
} | ||
undef $inc_per_depth[$d]; | ||
} | ||
} | ||
} | ||
|
||
sub go { | ||
my $path = join ' ', @_; | ||
|
||
my @inc = `g++ -I. -I torch/csrc/api/include/ -H $path -E 2>&1 > /dev/null`; | ||
foreach my $i (@inc) { | ||
chomp $i; | ||
my ($depth, $f) = $i =~ /^(\.+)\s(.*\.h)$/; | ||
next unless $depth; | ||
$depth = length($depth); | ||
$f =~ s#^\./##; | ||
next if $f =~ m#^/ | ||
|^ATen/ops/\w+_native\.h$ | ||
|^ATen/ops/\w+_meta\.h$ | ||
|^ATen/ops/\w+_ops\.h$ | ||
|^ATen/ops/_\w+\.h$#x | ||
or $incs{$f}; | ||
flush($depth); | ||
my $incs = $inc_per_depth[$depth]; | ||
$incs = $inc_per_depth[$depth] = [] unless $incs; | ||
push @$incs, $f; | ||
} | ||
flush(0); | ||
} | ||
|
||
chdir "cppbuild/linux-x86_64-gpu/pytorch/torch/include"; | ||
|
||
go('torch/csrc/api/include/torch/torch.h', 'torch/script.h'); | ||
|
||
print <<EOF; | ||
// Included by | ||
// ATen/cudnn/Descriptors.h | ||
// ATen/cudnn/Types.h | ||
// c10/cuda/CUDAGuard.h | ||
EOF | ||
|
||
go('ATen/cudnn/Descriptors.h', 'ATen/cudnn/Types.h', 'c10/cuda/CUDAGuard.h', '-I/opt/cuda/targets/x86_64-linux/include/'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
pytorch/src/gen/java/org/bytedeco/pytorch/ActivityTraceWrapper.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
pytorch/src/gen/java/org/bytedeco/pytorch/BackendMeta.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Targeted by JavaCPP version 1.5.10-SNAPSHOT: DO NOT EDIT THIS FILE | ||
|
||
package org.bytedeco.pytorch; | ||
|
||
import org.bytedeco.pytorch.Allocator; | ||
import org.bytedeco.pytorch.Function; | ||
import org.bytedeco.pytorch.functions.*; | ||
import org.bytedeco.pytorch.Module; | ||
import org.bytedeco.javacpp.annotation.Cast; | ||
import java.nio.*; | ||
import org.bytedeco.javacpp.*; | ||
import org.bytedeco.javacpp.annotation.*; | ||
|
||
import static org.bytedeco.javacpp.presets.javacpp.*; | ||
import static org.bytedeco.openblas.global.openblas_nolapack.*; | ||
import static org.bytedeco.openblas.global.openblas.*; | ||
|
||
import static org.bytedeco.pytorch.global.torch.*; | ||
|
||
|
||
// For ease of copy pasting | ||
// #if 0 | ||
// #endif | ||
|
||
/** | ||
* This structure is intended to hold additional metadata of the specific device | ||
* backend. | ||
**/ | ||
@Namespace("c10") @Properties(inherit = org.bytedeco.pytorch.presets.torch.class) | ||
public class BackendMeta extends Pointer { | ||
static { Loader.load(); } | ||
/** Default native constructor. */ | ||
public BackendMeta() { super((Pointer)null); allocate(); } | ||
/** Native array allocator. Access with {@link Pointer#position(long)}. */ | ||
public BackendMeta(long size) { super((Pointer)null); allocateArray(size); } | ||
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ | ||
public BackendMeta(Pointer p) { super(p); } | ||
private native void allocate(); | ||
private native void allocateArray(long size); | ||
@Override public BackendMeta position(long position) { | ||
return (BackendMeta)super.position(position); | ||
} | ||
@Override public BackendMeta getPointer(long i) { | ||
return new BackendMeta((Pointer)this).offsetAddress(i); | ||
} | ||
|
||
public native @ByVal BackendMetaRef clone( | ||
@Const @ByRef BackendMetaRef ptr); | ||
} |
Oops, something went wrong.