summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspiros <andyspiros@gmail.com>2011-07-01 01:44:58 +0200
committerspiros <andyspiros@gmail.com>2011-07-01 01:44:58 +0200
commitde13fa33730ce07913211fcf889a8cca9482a219 (patch)
tree9113af38993df7acfa27a54d3adcf0be820a3fc1 /blas.py
parentCorrect bug at main.py:207. (diff)
downloadauto-numerical-bench-de13fa33730ce07913211fcf889a8cca9482a219.tar.gz
auto-numerical-bench-de13fa33730ce07913211fcf889a8cca9482a219.tar.bz2
auto-numerical-bench-de13fa33730ce07913211fcf889a8cca9482a219.zip
Introduced portage tree.
Diffstat (limited to 'blas.py')
-rw-r--r--blas.py69
1 files changed, 0 insertions, 69 deletions
diff --git a/blas.py b/blas.py
deleted file mode 100644
index 52bb221..0000000
--- a/blas.py
+++ /dev/null
@@ -1,69 +0,0 @@
-import os, btlbase
-import subprocess as sp
-import shlex
-
-class Module(btlbase.BTLBase):
- def _initialize(self):
- self.libname = "blas"
- self.avail1 = ['axpy', 'axpby', 'rot']
- self.avail2 = ['matrix_vector','atv','symv','syr2','ger',
- 'trisolve_vector']
- self.avail3 = ['matrix_matrix', 'aat', 'trisolve_matrix', 'trmm']
- self.avail = self.avail1 + self.avail2 + self.avail3
-
- def _parse_args(self, args):
- # Parse arguments
- tests = []
- for i in args:
- if i == '1':
- tests += avail1
- continue
- if i == '2':
- tests += avail2
- continue
- if i == '3':
- tests += avail3
- continue
- if i in self.avail:
- tests.append(i)
- continue
- raise Exception("Argument not recognized: " + i)
-
- # Sort tests
- self.tests = [i for i in self.avail if i in tests]
-
- # If no test is specified, then choose four standard tests
- if len(self.tests) == 0:
- self.tests = ['axpy', 'matrix_vector', \
- 'trisolve_vector', 'matrix_matrix']
-
- @staticmethod
- def _btl_source():
- return "/libs/BLAS/main.cpp"
-
- @staticmethod
- def _btl_includes():
- return ["/libs/BLAS"]
-
- def _btl_defines(self):
- return ["CBLASNAME=" + self.libname, "BLAS_INTERFACE"]
-
- def _get_flags(self, root, impl, libdir):
- # Retrieve pkgconfig settings and map the directories to the new root
- path = "%s/etc/env.d/alternatives/%s/%s/%s/pkgconfig" % \
- (root, self.libname, impl, libdir)
- pkgconf = sp.Popen('pkg-config --libs --cflags blas', shell=True, \
- stdout=sp.PIPE, env={'PKG_CONFIG_PATH':path}).communicate()[0]
- pkgconf = pkgconf.replace('-L/', '-L'+root+'/')
- pkgconf = pkgconf.replace('-I/', '-I'+root+'/')
- return shlex.split(pkgconf)
-
-
- def get_impls(self, root):
- output = sp.Popen(
- ['eselect', '--no-color', '--brief', self.libname, 'list'],
- env={'ROOT' : root}, stdout=sp.PIPE
- ).communicate()[0]
- return output.strip().split('\n')
-
-del btlbase