added preinstall script
This commit is contained in:
@@ -51,7 +51,7 @@ static const std::vector<int> BLAS2_M = make_vector<int>() << 256;
|
||||
static const std::vector<int> BLAS2_N = create_full_range(128, 5000, 64);
|
||||
|
||||
// BLAS3 Sizes
|
||||
static const std::vector<int> BLAS3_M = make_vector<int>() << 128;
|
||||
static const std::vector<int> BLAS3_M = make_vector<int>() << 1024;
|
||||
static const std::vector<int> BLAS3_N = make_vector<int>() << 128;
|
||||
static const std::vector<int> BLAS3_K = create_full_range(128, 5000, 64);
|
||||
|
||||
|
@@ -2,7 +2,18 @@ file( GLOB_RECURSE LIBATIDLAS_SRC *.cpp)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_library(atidlas SHARED ${LIBATIDLAS_SRC})
|
||||
set_target_properties(atidlas PROPERTIES COMPILE_FLAGS "-Wno-sign-compare -D__CL_ENABLE_EXCEPTIONS -Wall -Wextra -pedantic")
|
||||
set_target_properties(atidlas PROPERTIES
|
||||
COMPILE_FLAGS "-Wno-sign-compare -D__CL_ENABLE_EXCEPTIONS -Wall -Wextra -pedantic")
|
||||
|
||||
#add_library(atidlas_static STATIC ${LIBATIDLAS_SRC})
|
||||
#set_target_properties(atidlas_static PROPERTIES OUTPUT_NAME atidlas)
|
||||
set(PREINSTALL_PY "${CMAKE_CURRENT_BINARY_DIR}/preinstall.py")
|
||||
set(POSTINSTALL_PY "${CMAKE_CURRENT_BINARY_DIR}/postinstall.py")
|
||||
|
||||
configure_file("${PROJECT_SOURCE_DIR}/python/preinstall.py" ${PREINSTALL_PY})
|
||||
configure_file("${PROJECT_SOURCE_DIR}/python/postinstall.py" ${POSTINSTALL_PY})
|
||||
|
||||
install(CODE "execute_process(COMMAND ${PYTHON} ${PREINSTALL_PY})")
|
||||
install(TARGETS atidlas LIBRARY DESTINATION lib)
|
||||
set(INSTALL_INCLUDE_DIR /usr/local/include)
|
||||
install(DIRECTORY atidlas "${PROJECT_SOURCE_DIR}/include/atidlas"
|
||||
DESTINATION "${INSTALL_INCLUDE_DIR}" FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp")
|
||||
install(CODE "execute_process(COMMAND ${PYTHON} ${POST_INSTALL_SCRIPT_PY})")
|
||||
|
@@ -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()
|
||||
|
@@ -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)
|
||||
|
@@ -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')
|
||||
@@ -201,6 +199,7 @@ class ArgumentsHandler:
|
||||
args = parser.parse_args()
|
||||
self.__dict__ = args.__dict__.copy()
|
||||
|
||||
if self.action == 'tune':
|
||||
#Retypes
|
||||
self.device = devices[int(self.device)]
|
||||
if not self.json_file:
|
||||
@@ -217,6 +216,9 @@ 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("----------------")
|
||||
@@ -224,10 +226,8 @@ if __name__ == "__main__":
|
||||
print 'Device', i, '|', atd.device_type_to_string(d.type), '|', d.name, 'on', d.platform.name
|
||||
print("----------------")
|
||||
|
||||
args = ArgumentsHandler()
|
||||
|
||||
if args.action=='tune':
|
||||
print("------")
|
||||
print("Auto-tuning")
|
||||
print("------")
|
||||
|
||||
do_tuning(args)
|
||||
|
@@ -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)")
|
||||
|
Reference in New Issue
Block a user