added preinstall script

This commit is contained in:
Philippe Tillet
2015-01-26 00:56:02 -05:00
parent 6d7f103ab1
commit 909e4b16a0
6 changed files with 42 additions and 30 deletions

View File

@@ -3,7 +3,7 @@ find_program(PYTHON "python")
get_property(LIBATIDLAS_PATH TARGET atidlas PROPERTY LOCATION)
get_filename_component(LIBATIDLAS_DIR ${LIBATIDLAS_PATH} DIRECTORY)
if (PYTHON)
if(PYTHON)
add_subdirectory(pyatidlas)
add_subdirectory(autotune)
endif()

View File

@@ -14,7 +14,8 @@ a = Analysis([os.path.join(prefix, 'pysrc','autotune.py')],
'scipy.integrate.lsoda',
'sklearn.utils.sparsetools._graph_validation',
'sklearn.utils.sparsetools._graph_tools',
'sklearn.utils.lgamma'],
'sklearn.utils.lgamma',
'sklearn.tree._utils'],
hookspath=None,
excludes=['scipy.io.matlab','matplotlib','PyQt4'],
runtime_hooks=None)

View File

@@ -172,9 +172,7 @@ def do_tuning(args):
class ArgumentsHandler:
def __init__(self):
def __init__(self, devices):
#Command line arguments
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest='action')
@@ -200,34 +198,36 @@ class ArgumentsHandler:
args = parser.parse_args()
self.__dict__ = args.__dict__.copy()
#Retypes
self.device = devices[int(self.device)]
if not self.json_file:
self.json_file = misc_tools.sanitize_string(self.device.name) + '.json'
self.operations = self.operations.split(',')
self.gemm_layouts = self.gemm_layouts.split(',')
self.gemv_layouts = self.gemv_layouts.split(',')
if self.method == 'simple':
self.blas1_size = [int(float(self.blas1_size))]
self.blas2_size = map(int, self.blas2_size)
self.blas3_size = map(int, self.blas3_size)
if self.action == 'tune':
#Retypes
self.device = devices[int(self.device)]
if not self.json_file:
self.json_file = misc_tools.sanitize_string(self.device.name) + '.json'
self.operations = self.operations.split(',')
self.gemm_layouts = self.gemm_layouts.split(',')
self.gemv_layouts = self.gemv_layouts.split(',')
if self.method == 'simple':
self.blas1_size = [int(float(self.blas1_size))]
self.blas2_size = map(int, self.blas2_size)
self.blas3_size = map(int, self.blas3_size)
if __name__ == "__main__":
platforms = atd.get_platforms()
devices = [d for platform in platforms for d in platform.get_devices()]
args = ArgumentsHandler(devices)
print("----------------")
print("Devices available:")
print("----------------")
for (i, d) in enumerate(devices):
print 'Device', i, '|', atd.device_type_to_string(d.type), '|', d.name, 'on', d.platform.name
print("----------------")
args = ArgumentsHandler()
print("------")
print("Auto-tuning")
print("------")
do_tuning(args)
if args.action=='tune':
print("------")
print("Auto-tuning")
print("------")
do_tuning(args)

View File

@@ -11,4 +11,4 @@ add_custom_command(OUTPUT ${OUTPUT}
COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT}
DEPENDS atidlas ${PYATIDLAS_SRC} ${PYATIDLAS_PYSRC} ${SETUP_PY})
add_custom_target(pyatidlas ALL DEPENDS ${OUTPUT})
install(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install)")
#install(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install)")