Skip to content

Commit

Permalink
changed #! to python in all top-level scripts, other cleanup and impo…
Browse files Browse the repository at this point in the history
…rt fixes
  • Loading branch information
brnorris03 committed Dec 30, 2020
1 parent bbefc49 commit a8eb37a
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 25 deletions.
3 changes: 1 addition & 2 deletions orio/module/loop/astvisitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
@author: norris
'''
from orio.module.loop import ast
from orio.main.util.globals import *

import orio.module.loop.codegen
from orio.module.loop import ast

class ASTVisitor:
''' Standard visitor pattern abstract class'''
Expand Down
7 changes: 4 additions & 3 deletions scripts/orcc
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#!/usr/bin/env python2.7
#!/usr/bin/env python
#
# orcc - Compile shell for Orio (C/C++ source code)
#

import os, sys, distutils.sysconfig
import os, sys

# include Orio's source directory in the Python's search path
exe_dir = os.path.dirname(os.path.realpath(__file__))
if not exe_dir.endswith('bin'):
# orcc and other top-level scripts are in scripts/ subdir of top-level dir
sys.path.insert(0, os.path.dirname(exe_dir))

if True or 'ORIO_DEBUG' in os.environ.keys():
if 'ORIO_DEBUG' in os.environ.keys():
print("DEBUG: system search path:", sys.path)


# dispatch to Orio's main
import orio.main.orio_main
orio.main.orio_main.start(sys.argv, orio.main.orio_main.C_CPP)
Expand Down
4 changes: 2 additions & 2 deletions scripts/orcl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python2.7
#!/usr/bin/env python
#
# orf - Compile shell for Orio (generate OpenCL source code)
#

import os, sys, distutils.sysconfig
import os, sys

# include Orio's source directory in the Python's search path
exe_dir = os.path.dirname(os.path.realpath(__file__))
Expand Down
4 changes: 2 additions & 2 deletions scripts/orcuda
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python2.7
#!/usr/bin/env python
#
# orf - Compile shell for Orio (generate CUDA source code)
#

import os, sys, distutils.sysconfig
import os, sys

# include Orio's source directory in the Python's search path
exe_dir = os.path.dirname(os.path.realpath(__file__))
Expand Down
4 changes: 2 additions & 2 deletions scripts/orf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python2.7
#!/usr/bin/env python
#
# orf - Compile shell for Orio (Fortran source code)
#

import os, sys, distutils.sysconfig
import os, sys

# include Orio's source directory in the Python's search path
exe_dir = os.path.dirname(os.path.realpath(__file__))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


setuptools.setup(name='orio',
version='0.6.0',
version='0.6.1',
description='ORIO -- An Annotation-Based Performance Tuning Tool',
author='Boyana Norris and Albert Hartono',
author_email='[email protected]',
Expand Down
53 changes: 40 additions & 13 deletions testsuite/sandbox/axpy/axpy4.c
Original file line number Diff line number Diff line change
@@ -1,21 +1,48 @@
/*@ begin PerfTuning (
def build {
arg build_command = 'gcc';
}
def performance_counter {
arg method = 'basic timer';
arg repetitions = 10;
}
def performance_params {
param CFLAGS[] = ['-O0', '-O1', '-O2', '-O3'];
param UF[] = range(2,17,2);
}
void axpy4(int n, double *y, double a1, double *x1, double a2, double *x2, double a3, double *x3,
double a4, double *x4) {
def input_params {
param N[] = [10000,1000000];
}
register int i;
def input_vars {
decl static double y[N] = 0;
decl double a1 = random;
decl double a2 = random;
decl double a3 = random;
decl double a4 = random;
decl static double x1[N] = random;
decl static double x2[N] = random;
decl static double x3[N] = random;
decl static double x4[N] = random;
}
/*@ begin Align (x1[],x2[],x3[],x4[],y[]) @*/
/*@ begin Loop (
transform Unroll(ufactor=20, parallelize=True)
for (i=0; i<=n-1; i++)
y[i]=y[i]+a1*x1[i]+a2*x2[i]+a3*x3[i]+a4*x4[i];
) @*/
def search {
arg algorithm = 'Mlsearch';
arg total_runs = 10;
}
) @*/

for (i=0; i<=n-1; i++)
y[i]=y[i]+a1*x1[i]+a2*x2[i]+a3*x3[i]+a4*x4[i];
int i;

/*@ end @*/
/*@ begin Loop (
transform Unroll(ufactor=UF)
for (i=0; i<=N-1; i++)
y[i] = y[i] + a1*x1[i] + a2*x2[i] + a3*x3[i] + a4*x4[i];
) @*/
for (i=0; i<=N-1; i++)
y[i] = y[i] + a1*x1[i] + a2*x2[i] + a3*x3[i] + a4*x4[i];
/*@ end @*/

}
/*@ end @*/

0 comments on commit a8eb37a

Please sign in to comment.