Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@@ -0,0 +1,29 @@
version: 0.07
date: Tue Feb 7 17:23:22 CET 2017
changes:
- support hybrid tiling
---
version: 0.06
date: Fri May 6 12:08:50 CEST 2016
changes:
- use PPCG specific macro names in generated code
- complete transition to schedule trees
- maximize coincidence by default
- map arrays with constant index expressions to private memory
- optionally group chains of statements
---
version: 0.05
date: Fri Jan 15 09:30:23 CET 2016
changes:
- fix live-out computation
- optionally compute schedule for C target
- optionally perform tiling for C target
- create single kernel for non-permutable subtree
---
version: 0.04
date: Wed Jun 17 10:52:58 CEST 2015
changes:
- use schedule trees
- fix live-range reordering
- improve generation of synchronization
- exploit independences during dependence analysis

View File

@@ -0,0 +1 @@
ppcg-0.07

View File

@@ -0,0 +1,77 @@
if BUNDLED_ISL
MAYBE_ISL = isl
ISL_LA = $(top_builddir)/isl/libisl.la
LOCAL_ISL_LA = isl/libisl.la
endif
if BUNDLED_PET
MAYBE_PET = pet
PET_LA = $(top_builddir)/pet/libpet.la
endif
SUBDIRS = $(MAYBE_ISL) $(MAYBE_PET) .
FORCE:
isl/libisl.la: FORCE
cd isl; $(MAKE) $(AM_MAKEFLAGS) libisl.la
pet/libpet.la: FORCE
cd pet; $(MAKE) $(AM_MAKEFLAGS) libpet.la
ACLOCAL_AMFLAGS = -I m4
LIB_ISL = $(ISL_LA) @ISL_LIBS@
LIB_PET = $(PET_LA) @PET_LIBS@
AM_CPPFLAGS = @ISL_CFLAGS@ @PET_CFLAGS@
LDADD = $(LIB_PET) $(LIB_ISL)
bin_PROGRAMS = ppcg
ppcg_SOURCES = \
cpu.c \
cpu.h \
cuda.c \
cuda.h \
opencl.c \
opencl.h \
cuda_common.h \
cuda_common.c \
gpu.c \
gpu.h \
gpu_array_tile.c \
gpu_array_tile.h \
gpu_group.c \
gpu_group.h \
gpu_hybrid.c \
gpu_hybrid.h \
gpu_print.c \
gpu_print.h \
gpu_tree.c \
gpu_tree.h \
grouping.c \
hybrid.c \
hybrid.h \
schedule.c \
schedule.h \
ppcg_options.c \
ppcg_options.h \
ppcg.c \
ppcg.h \
print.c \
print.h \
util.c \
util.h \
version.c
TESTS = @extra_tests@
EXTRA_TESTS = opencl_test.sh polybench_test.sh
TEST_EXTENSIONS = .sh
EXTRA_DIST = \
ocl_utilities.c \
ocl_utilities.h \
tests
dist-hook:
echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID
gitversion.h: @GIT_HEAD@
$(AM_V_GEN)echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,246 @@
Requirements:
- automake, autoconf, libtool
(not needed when compiling a release)
- pkg-config (http://www.freedesktop.org/wiki/Software/pkg-config)
(not needed when compiling a release using the included isl and pet)
- gmp (http://gmplib.org/)
- libyaml (http://pyyaml.org/wiki/LibYAML)
(only needed if you want to compile the pet executable)
- LLVM/clang libraries, 2.9 or higher (http://clang.llvm.org/get_started.html)
Unless you have some other reasons for wanting to use the svn version,
it is best to install the latest release (3.9).
For more details, see pet/README.
If you are installing on Ubuntu, then you can install the following packages:
automake autoconf libtool pkg-config libgmp3-dev libyaml-dev libclang-dev llvm
Note that you need at least version 3.2 of libclang-dev (ubuntu raring).
Older versions of this package did not include the required libraries.
If you are using an older version of ubuntu, then you need to compile and
install LLVM/clang from source.
Preparing:
Grab the latest release and extract it or get the source from
the git repository as follows. This process requires autoconf,
automake, libtool and pkg-config.
git clone git://repo.or.cz/ppcg.git
cd ppcg
./get_submodules.sh
./autogen.sh
Compilation:
./configure
make
make check
If you have installed any of the required libraries in a non-standard
location, then you may need to use the --with-gmp-prefix,
--with-libyaml-prefix and/or --with-clang-prefix options
when calling "./configure".
Using PPCG to generate CUDA or OpenCL code
To convert a fragment of a C program to CUDA, insert a line containing
#pragma scop
before the fragment and add a line containing
#pragma endscop
after the fragment. To generate CUDA code run
ppcg --target=cuda file.c
where file.c is the file containing the fragment. The generated
code is stored in file_host.cu and file_kernel.cu.
To generate OpenCL code run
ppcg --target=opencl file.c
where file.c is the file containing the fragment. The generated code
is stored in file_host.c and file_kernel.cl.
Specifying tile, grid and block sizes
The iterations space tile size, grid size and block size can
be specified using the --sizes option. The argument is a union map
in isl notation mapping kernels identified by their sequence number
in a "kernel" space to singleton sets in the "tile", "grid" and "block"
spaces. The sizes are specified outermost to innermost.
The dimension of the "tile" space indicates the (maximal) number of loop
dimensions to tile. The elements of the single integer tuple
specify the tile sizes in each dimension.
In case of hybrid tiling, the first element is half the size of
the tile in the time (sequential) dimension. The second element
specifies the number of elements in the base of the hexagon.
The remaining elements specify the tile sizes in the remaining space
dimensions.
The dimension of the "grid" space indicates the (maximal) number of block
dimensions in the grid. The elements of the single integer tuple
specify the number of blocks in each dimension.
The dimension of the "block" space indicates the (maximal) number of thread
dimensions in the grid. The elements of the single integer tuple
specify the number of threads in each dimension.
For example,
{ kernel[0] -> tile[64,64]; kernel[i] -> block[16] : i != 4 }
specifies that in kernel 0, two loops should be tiled with a tile
size of 64 in both dimensions and that all kernels except kernel 4
should be run using a block of 16 threads.
Since PPCG performs some scheduling, it can be difficult to predict
what exactly will end up in a kernel. If you want to specify
tile, grid or block sizes, you may want to run PPCG first with the defaults,
examine the kernels and then run PPCG again with the desired sizes.
Instead of examining the kernels, you can also specify the option
--dump-sizes on the first run to obtain the effectively used default sizes.
Compiling the generated CUDA code with nvcc
To get optimal performance from nvcc, it is important to choose --arch
according to your target GPU. Specifically, use the flag "--arch sm_20"
for fermi, "--arch sm_30" for GK10x Kepler and "--arch sm_35" for
GK110 Kepler. We discourage the use of older cards as we have seen
correctness issues with compilation for older architectures.
Note that in the absence of any --arch flag, nvcc defaults to
"--arch sm_13". This will not only be slower, but can also cause
correctness issues.
If you want to obtain results that are identical to those obtained
by the original code, then you may need to disable some optimizations
by passing the "--fmad=false" option.
Compiling the generated OpenCL code with gcc
To compile the host code you need to link against the file
ocl_utilities.c which contains utility functions used by the generated
OpenCL host code. To compile the host code with gcc, run
gcc -std=c99 file_host.c ocl_utilities.c -lOpenCL
Note that we have experienced the generated OpenCL code freezing
on some inputs (e.g., the PolyBench symm benchmark) when using
at least some version of the Nvidia OpenCL library, while the
corresponding CUDA code runs fine.
We have experienced no such freezes when using AMD, ARM or Intel
OpenCL libraries.
By default, the compiled executable will need the _kernel.cl file at
run time. Alternatively, the option --opencl-embed-kernel-code may be
given to place the kernel code in a string literal. The kernel code is
then compiled into the host binary, such that the _kernel.cl file is no
longer needed at run time. Any kernel include files, in particular
those supplied using --opencl-include-file, will still be required at
run time.
Function calls
Function calls inside the analyzed fragment are reproduced
in the CUDA or OpenCL code, but for now it is left to the user
to make sure that the functions that are being called are
available from the generated kernels.
In the case of OpenCL code, the --opencl-include-file option
may be used to specify one or more files to be #include'd
from the generated code. These files may then contain
the definitions of the functions being called from the
program fragment. If the pathnames of the included files
are relative to the current directory, then you may need
to additionally specify the --opencl-compiler-options=-I.
to make sure that the files can be found by the OpenCL compiler.
The included files may contain definitions of types used by the
generated kernels. By default, PPCG generates definitions for
types as needed, but these definitions may collide with those in
the included files, as PPCG does not consider the contents of the
included files. The --no-opencl-print-kernel-types will prevent
PPCG from generating type definitions.
GNU extensions
By default, PPCG may print out macro definitions that involve
GNU extensions such as __typeof__ and statement expressions.
Some compilers may not support these extensions.
In particular, OpenCL 1.2 beignet 1.1.1 (git-6de6918)
has been reported not to support __typeof__.
The use of these extensions can be turned off with the
--no-allow-gnu-extensions option.
Processing PolyBench
When processing a PolyBench/C 3.2 benchmark, you should always specify
-DPOLYBENCH_USE_C99_PROTO on the ppcg command line. Otherwise, the source
files are inconsistent, having fixed size arrays but parametrically
bounded loops iterating over them.
However, you should not specify this define when compiling
the PPCG generated code using nvcc since CUDA does not support VLAs.
CUDA and function overloading
While CUDA supports function overloading based on the arguments types,
no such function overloading exists in the input language C. Since PPCG
simply prints out the same function name as in the original code, this
may result in a different function being called based on the types
of the arguments. For example, if the original code contains a call
to the function sqrt() with a float argument, then the argument will
be promoted to a double and the sqrt() function will be called.
In the transformed (CUDA) code, however, overloading will cause the
function sqrtf() to be called. Until this issue has been resolved in PPCG,
we recommend that users either explicitly call the function sqrtf() or
explicitly cast the argument to double in the input code.
Contact
For bug reports, feature requests and questions,
contact http://groups.google.com/group/isl-development
Whenever you report a bug, please mention the exact version of PPCG
that you are using (output of "./ppcg --version"). If you are unable
to compile PPCG, then report the git version (output of "git describe")
or the version number included in the name of the tarball.
Citing PPCG
If you use PPCG for your research, you are invited to cite
the following paper.
@article{Verdoolaege2013PPCG,
author = {Verdoolaege, Sven and Juega, Juan Carlos and Cohen, Albert and
G\'{o}mez, Jos{\'e} Ignacio and Tenllado, Christian and
Catthoor, Francky},
title = {Polyhedral parallel code generation for CUDA},
journal = {ACM Trans. Archit. Code Optim.},
issue_date = {January 2013},
volume = {9},
number = {4},
month = jan,
year = {2013},
issn = {1544-3566},
pages = {54:1--54:23},
doi = {10.1145/2400682.2400713},
acmid = {2400713},
publisher = {ACM},
address = {New York, NY, USA},
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,347 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
bedcabfe34df1e786a625ee3b905054c82f28546

View File

@@ -0,0 +1,83 @@
AC_INIT([ppcg], [0.07], [isl-development@googlegroups.com])
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_PROG_CC
AC_PROG_LIBTOOL
PKG_PROG_PKG_CONFIG
AX_CHECK_OPENMP
AX_CHECK_OPENCL
if test $HAVE_OPENCL = yes; then
extra_tests="$extra_tests opencl_test.sh"
fi
AX_SUBMODULE(isl,build|bundled|system,bundled)
AM_CONDITIONAL(BUNDLED_ISL, test $with_isl = bundled)
AC_SUBST(ISL_CFLAGS)
AC_SUBST(ISL_LIBS)
case "$with_isl" in
bundled)
ISL_CFLAGS="-I\$(top_srcdir)/isl/include -I\$(top_builddir)/isl/include"
ISL_CFLAGS="$ISL_CFLAGS"
ppcg_configure_args="$ppcg_configure_args --with-isl-builddir=../isl"
ppcg_configure_args="$ppcg_configure_args --with-isl=build"
ppcg_configure_args="$ppcg_configure_args --with-clang=system"
;;
build)
ISL_BUILDDIR=`echo @abs_builddir@ | $with_isl_builddir/config.status --file=-`
ppcg_configure_args="$ppcg_configure_args --with-isl-builddir=$ISL_BUILDDIR"
ISL_CFLAGS="-I$isl_srcdir/include -I$ISL_BUILDDIR/include"
ISL_CFLAGS="$ISL_CFLAGS"
ISL_LIBS="$with_isl_builddir/libisl.la"
;;
system)
PKG_CHECK_MODULES([ISL], [isl])
esac
AX_SUBMODULE(pet,bundled|system,bundled)
AM_CONDITIONAL(BUNDLED_PET, test $with_pet = bundled)
AC_SUBST(PET_CFLAGS)
AC_SUBST(PET_LIBS)
case "$with_pet" in
bundled)
PET_CFLAGS="$PET_CFLAGS -I\$(top_srcdir)/pet/include"
;;
system)
PKG_CHECK_MODULES([PET], [pet])
;;
esac
AC_SUBST(POLYBENCH_DIR)
AC_SUBST(extra_tests)
AC_ARG_WITH([polybench],
[AS_HELP_STRING([--with-polybench=DIR], [PolyBench location])],
[
if test -f "$with_polybench/utilities/benchmark_list"; then
POLYBENCH_DIR=$with_polybench
extra_tests="$extra_tests polybench_test.sh"
fi
])
AX_DETECT_GIT_HEAD
echo '#define GIT_HEAD_ID "'$GIT_HEAD_ID'"' > gitversion.h
AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES([polybench_test.sh], [chmod +x polybench_test.sh])
AC_CONFIG_FILES([opencl_test.sh], [chmod +x opencl_test.sh])
if test $with_isl = bundled; then
AC_CONFIG_SUBDIRS(isl)
fi
if test $with_pet = bundled; then
AC_CONFIG_SUBDIRS(pet)
fi
AC_CONFIG_COMMANDS_POST([
dnl pass on arguments to subdir configures, but don't
dnl add them to config.status
ac_configure_args="$ac_configure_args $ppcg_configure_args"
])
AC_OUTPUT

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
#ifndef _CPU_H
#define _CPU_H
#include <isl/ctx.h>
#include "ppcg.h"
struct ppcg_options;
__isl_give isl_printer *print_cpu(__isl_take isl_printer *p,
struct ppcg_scop *ps, struct ppcg_options *options);
int generate_cpu(isl_ctx *ctx, struct ppcg_options *options,
const char *input, const char *output);
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
#ifndef _CUDA_H
#define _CUDA_H
#include "ppcg_options.h"
#include "ppcg.h"
int generate_cuda(isl_ctx *ctx, struct ppcg_options *options,
const char *input);
__isl_give isl_printer *print_host_user(__isl_take isl_printer *p,
__isl_take isl_ast_print_options *print_options,
__isl_keep isl_ast_node *node, void *user);
#endif

View File

@@ -0,0 +1,50 @@
/*
* Copyright 2010 INRIA Saclay
*
* Use of this software is governed by the MIT license
*
* Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France,
* Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod,
* 91893 Orsay, France
*/
#include <ctype.h>
#include <limits.h>
#include <string.h>
#include "cuda_common.h"
#include "ppcg.h"
/* Open the host .cu file and the kernel .hu and .cu files for writing.
* Add the necessary includes.
*/
void cuda_open_files(struct cuda_info *info, const char *input)
{
char name[PATH_MAX];
int len;
len = ppcg_extract_base_name(name, input);
strcpy(name + len, "_host.cu");
info->host_c = fopen(name, "w");
strcpy(name + len, "_kernel.cu");
info->kernel_c = fopen(name, "w");
strcpy(name + len, "_kernel.hu");
info->kernel_h = fopen(name, "w");
fprintf(info->host_c, "#include <assert.h>\n");
fprintf(info->host_c, "#include <stdio.h>\n");
fprintf(info->host_c, "#include \"%s\"\n", name);
fprintf(info->kernel_c, "#include \"%s\"\n", name);
fprintf(info->kernel_h, "#include \"cuda.h\"\n\n");
}
/* Close all output files.
*/
void cuda_close_files(struct cuda_info *info)
{
fclose(info->kernel_c);
fclose(info->kernel_h);
fclose(info->host_c);
}

View File

@@ -0,0 +1,15 @@
#ifndef _CUDA_COMMON_H_
#define _CUDA_COMMON_H_
#include <stdio.h>
struct cuda_info {
FILE *host_c;
FILE *kernel_c;
FILE *kernel_h;
};
void cuda_open_files(struct cuda_info *info, const char *input);
void cuda_close_files(struct cuda_info *info);
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,181 @@
#include "assert.h"
#include "stdio.h"
#include "stdlib.h"
#define die() { \
fprintf(stderr, "Dummy function %s called\n", __FUNCTION__); \
abort(); \
}
void pet_scop_compute_outer_to_any(){
die();
}
void pet_scop_compute_outer_to_inner(){
die();
}
void pet_tree_get_type(){
die();
}
void pet_tree_foreach_access_expr(){
die();
}
void pet_expr_get_ctx(){
die();
}
void pet_expr_access_is_read(){
die();
}
void pet_expr_access_is_write(){
die();
}
void pet_expr_access_get_tagged_may_read(){
die();
}
void pet_expr_access_get_tagged_may_write(){
die();
}
void pet_expr_access_get_must_write(){
die();
}
void pet_expr_access_get_index(){
die();
}
void pet_expr_access_get_ref_id(){
die();
}
void print_cpu(){
die();
}
void pet_stmt_print_body(){
die();
}
void pet_loc_get_start(){
die();
}
void pet_loc_get_end(){
die();
}
void pet_scop_collect_tagged_may_reads(){
die();
}
void pet_scop_collect_may_reads(){
die();
}
void pet_scop_collect_tagged_may_writes(){
die();
}
void pet_scop_collect_may_writes(){
die();
}
void pet_scop_collect_tagged_must_writes(){
die();
}
void pet_scop_collect_must_writes(){
die();
}
void pet_scop_collect_tagged_must_kills(){
die();
}
void pet_transform_C_source(){
die();
}
void pet_scop_print_original(){
die();
}
void pet_scop_free(){
die();
}
void pet_scop_align_params(){
die();
}
void pet_scop_can_build_ast_exprs(){
die();
}
void pet_scop_has_data_dependent_conditions(){
die();
}
void pet_tree_foreach_expr(){
die();
}
void pet_expr_foreach_call_expr(){
die();
}
void pet_stmt_is_kill(){
die();
}
void pet_options_args() {
die();
}
void ppcg_print_guarded() {
die();
}
void ppcg_version() {
die();
}
void pet_options_set_encapsulate_dynamic_control() {
die();
}
void generate_opencl() {
die();
}
void generate_cpu() {
die();
}
void pet_stmt_build_ast_exprs() {
die();
}
void pet_scop_get_tagged_may_reads() {
die();
}
void pet_scop_get_may_reads() {
die();
}
void pet_scop_get_may_writes() {
die();
}
void pet_scop_get_must_writes() {
die();
}
void pet_scop_get_tagged_may_writes() {
die();
}
void pet_scop_get_tagged_must_writes() {
die();
}
void pet_scop_get_must_kills() {
die();
}
void pet_scop_get_tagged_must_kills() {
die();
}
void pet_expr_call_get_name() {
die();
}
void pet_expr_call_set_name() {
die();
}
void pet_expr_get_arg() {
die();
}
void pet_expr_new_cast() {
die();
}
void pet_expr_set_arg() {
die();
}
void pet_tree_copy() {
die();
}
void pet_tree_free() {
die();
}
void pet_tree_map_call_expr() {
die();
}
void pet_expr_access_get_may_read() {
die();
}
void pet_expr_access_get_may_write() {
die();
}

View File

@@ -0,0 +1 @@
cfd998f1c315b16a466e481bbf7ed4ede6df1b1c

Some files were not shown because too many files have changed in this diff Show More