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);
|
static const std::vector<int> BLAS2_N = create_full_range(128, 5000, 64);
|
||||||
|
|
||||||
// BLAS3 Sizes
|
// 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_N = make_vector<int>() << 128;
|
||||||
static const std::vector<int> BLAS3_K = create_full_range(128, 5000, 64);
|
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})
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
add_library(atidlas SHARED ${LIBATIDLAS_SRC})
|
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(PREINSTALL_PY "${CMAKE_CURRENT_BINARY_DIR}/preinstall.py")
|
||||||
#set_target_properties(atidlas_static PROPERTIES OUTPUT_NAME atidlas)
|
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_property(LIBATIDLAS_PATH TARGET atidlas PROPERTY LOCATION)
|
||||||
get_filename_component(LIBATIDLAS_DIR ${LIBATIDLAS_PATH} DIRECTORY)
|
get_filename_component(LIBATIDLAS_DIR ${LIBATIDLAS_PATH} DIRECTORY)
|
||||||
|
|
||||||
if (PYTHON)
|
if(PYTHON)
|
||||||
add_subdirectory(pyatidlas)
|
add_subdirectory(pyatidlas)
|
||||||
add_subdirectory(autotune)
|
add_subdirectory(autotune)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -14,7 +14,8 @@ a = Analysis([os.path.join(prefix, 'pysrc','autotune.py')],
|
|||||||
'scipy.integrate.lsoda',
|
'scipy.integrate.lsoda',
|
||||||
'sklearn.utils.sparsetools._graph_validation',
|
'sklearn.utils.sparsetools._graph_validation',
|
||||||
'sklearn.utils.sparsetools._graph_tools',
|
'sklearn.utils.sparsetools._graph_tools',
|
||||||
'sklearn.utils.lgamma'],
|
'sklearn.utils.lgamma',
|
||||||
|
'sklearn.tree._utils'],
|
||||||
hookspath=None,
|
hookspath=None,
|
||||||
excludes=['scipy.io.matlab','matplotlib','PyQt4'],
|
excludes=['scipy.io.matlab','matplotlib','PyQt4'],
|
||||||
runtime_hooks=None)
|
runtime_hooks=None)
|
||||||
|
@@ -172,9 +172,7 @@ def do_tuning(args):
|
|||||||
|
|
||||||
|
|
||||||
class ArgumentsHandler:
|
class ArgumentsHandler:
|
||||||
|
def __init__(self, devices):
|
||||||
def __init__(self):
|
|
||||||
|
|
||||||
#Command line arguments
|
#Command line arguments
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
subparsers = parser.add_subparsers(dest='action')
|
subparsers = parser.add_subparsers(dest='action')
|
||||||
@@ -200,34 +198,36 @@ class ArgumentsHandler:
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
self.__dict__ = args.__dict__.copy()
|
self.__dict__ = args.__dict__.copy()
|
||||||
|
|
||||||
#Retypes
|
if self.action == 'tune':
|
||||||
self.device = devices[int(self.device)]
|
#Retypes
|
||||||
if not self.json_file:
|
self.device = devices[int(self.device)]
|
||||||
self.json_file = misc_tools.sanitize_string(self.device.name) + '.json'
|
if not self.json_file:
|
||||||
self.operations = self.operations.split(',')
|
self.json_file = misc_tools.sanitize_string(self.device.name) + '.json'
|
||||||
self.gemm_layouts = self.gemm_layouts.split(',')
|
self.operations = self.operations.split(',')
|
||||||
self.gemv_layouts = self.gemv_layouts.split(',')
|
self.gemm_layouts = self.gemm_layouts.split(',')
|
||||||
if self.method == 'simple':
|
self.gemv_layouts = self.gemv_layouts.split(',')
|
||||||
self.blas1_size = [int(float(self.blas1_size))]
|
if self.method == 'simple':
|
||||||
self.blas2_size = map(int, self.blas2_size)
|
self.blas1_size = [int(float(self.blas1_size))]
|
||||||
self.blas3_size = map(int, self.blas3_size)
|
self.blas2_size = map(int, self.blas2_size)
|
||||||
|
self.blas3_size = map(int, self.blas3_size)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
platforms = atd.get_platforms()
|
platforms = atd.get_platforms()
|
||||||
devices = [d for platform in platforms for d in platform.get_devices()]
|
devices = [d for platform in platforms for d in platform.get_devices()]
|
||||||
|
|
||||||
|
args = ArgumentsHandler(devices)
|
||||||
|
|
||||||
print("----------------")
|
print("----------------")
|
||||||
print("Devices available:")
|
print("Devices available:")
|
||||||
print("----------------")
|
print("----------------")
|
||||||
for (i, d) in enumerate(devices):
|
for (i, d) in enumerate(devices):
|
||||||
print 'Device', i, '|', atd.device_type_to_string(d.type), '|', d.name, 'on', d.platform.name
|
print 'Device', i, '|', atd.device_type_to_string(d.type), '|', d.name, 'on', d.platform.name
|
||||||
print("----------------")
|
print("----------------")
|
||||||
|
|
||||||
args = ArgumentsHandler()
|
if args.action=='tune':
|
||||||
|
print("------")
|
||||||
print("------")
|
print("Auto-tuning")
|
||||||
print("Auto-tuning")
|
print("------")
|
||||||
print("------")
|
do_tuning(args)
|
||||||
|
|
||||||
do_tuning(args)
|
|
||||||
|
@@ -11,4 +11,4 @@ add_custom_command(OUTPUT ${OUTPUT}
|
|||||||
COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT}
|
COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT}
|
||||||
DEPENDS atidlas ${PYATIDLAS_SRC} ${PYATIDLAS_PYSRC} ${SETUP_PY})
|
DEPENDS atidlas ${PYATIDLAS_SRC} ${PYATIDLAS_PYSRC} ${SETUP_PY})
|
||||||
add_custom_target(pyatidlas ALL DEPENDS ${OUTPUT})
|
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