Code quality: renamed model/ to database/
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
#include "isaac/driver/device.h"
|
#include "isaac/driver/device.h"
|
||||||
#include "isaac/common/expression_type.h"
|
#include "isaac/common/expression_type.h"
|
||||||
#include "isaac/common/numeric_type.h"
|
#include "isaac/common/numeric_type.h"
|
||||||
#include "isaac/model/model.h"
|
#include "isaac/database/model.h"
|
||||||
|
|
||||||
namespace isaac
|
namespace isaac
|
||||||
{
|
{
|
@@ -6,7 +6,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include "isaac/kernels/templates/base.h"
|
#include "isaac/kernels/templates/base.h"
|
||||||
#include "isaac/model/predictors/random_forest.h"
|
#include "isaac/database/predictors/random_forest.h"
|
||||||
#include "isaac/symbolic/expression.h"
|
#include "isaac/symbolic/expression.h"
|
||||||
|
|
||||||
namespace isaac
|
namespace isaac
|
@@ -1,7 +1,7 @@
|
|||||||
#ifndef _ISAAC_SCHEDULER_EXECUTE_H
|
#ifndef _ISAAC_SCHEDULER_EXECUTE_H
|
||||||
#define _ISAAC_SCHEDULER_EXECUTE_H
|
#define _ISAAC_SCHEDULER_EXECUTE_H
|
||||||
|
|
||||||
#include "isaac/model/database.h"
|
#include "isaac/database/database.h"
|
||||||
#include "isaac/symbolic/expression.h"
|
#include "isaac/symbolic/expression.h"
|
||||||
|
|
||||||
namespace isaac
|
namespace isaac
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include "isaac/array.h"
|
#include "isaac/array.h"
|
||||||
#include "isaac/exception/unknown_datatype.h"
|
#include "isaac/exception/unknown_datatype.h"
|
||||||
#include "isaac/model/database.h"
|
#include "isaac/database/database.h"
|
||||||
#include "isaac/symbolic/execute.h"
|
#include "isaac/symbolic/execute.h"
|
||||||
|
|
||||||
|
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
#include "rapidjson/document.h"
|
#include "rapidjson/document.h"
|
||||||
#include "rapidjson/to_array.hpp"
|
#include "rapidjson/to_array.hpp"
|
||||||
|
|
||||||
#include "isaac/model/database.h"
|
#include "isaac/database/database.h"
|
||||||
#include "isaac/kernels/parse.h"
|
#include "isaac/kernels/parse.h"
|
||||||
#include "isaac/kernels/templates/axpy.h"
|
#include "isaac/kernels/templates/axpy.h"
|
||||||
#include "isaac/kernels/templates/dot.h"
|
#include "isaac/kernels/templates/dot.h"
|
@@ -15,7 +15,7 @@
|
|||||||
#include "isaac/driver/program_cache.h"
|
#include "isaac/driver/program_cache.h"
|
||||||
#include "isaac/exception/unknown_datatype.h"
|
#include "isaac/exception/unknown_datatype.h"
|
||||||
#include "isaac/exception/operation_not_supported.h"
|
#include "isaac/exception/operation_not_supported.h"
|
||||||
#include "isaac/model/model.h"
|
#include "isaac/database/model.h"
|
||||||
|
|
||||||
#include "getenv.hpp"
|
#include "getenv.hpp"
|
||||||
#include "to_string.hpp"
|
#include "to_string.hpp"
|
@@ -1,4 +1,4 @@
|
|||||||
#include "isaac/model/predictors/random_forest.h"
|
#include "isaac/database/predictors/random_forest.h"
|
||||||
#include "rapidjson/to_array.hpp"
|
#include "rapidjson/to_array.hpp"
|
||||||
|
|
||||||
namespace isaac
|
namespace isaac
|
@@ -1,5 +1,5 @@
|
|||||||
#include "isaac/driver/device.h"
|
#include "isaac/driver/device.h"
|
||||||
#include "isaac/model/database.h"
|
#include "isaac/database/database.h"
|
||||||
|
|
||||||
#include "presets/broadwell.hpp"
|
#include "presets/broadwell.hpp"
|
||||||
|
|
@@ -1,7 +1,7 @@
|
|||||||
#include "isaac/array.h"
|
#include "isaac/array.h"
|
||||||
#include "isaac/kernels/templates/gemm.h"
|
#include "isaac/kernels/templates/gemm.h"
|
||||||
#include "isaac/kernels/keywords.h"
|
#include "isaac/kernels/keywords.h"
|
||||||
#include "isaac/model/model.h"
|
#include "isaac/database/model.h"
|
||||||
#include "isaac/symbolic/preset.h"
|
#include "isaac/symbolic/preset.h"
|
||||||
#include "isaac/exception/operation_not_supported.h"
|
#include "isaac/exception/operation_not_supported.h"
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include "isaac/types.h"
|
#include "isaac/types.h"
|
||||||
#include "isaac/array.h"
|
#include "isaac/array.h"
|
||||||
#include "isaac/model/database.h"
|
#include "isaac/database/database.h"
|
||||||
#include "isaac/symbolic/expression.h"
|
#include "isaac/symbolic/expression.h"
|
||||||
#include "isaac/symbolic/preset.h"
|
#include "isaac/symbolic/preset.h"
|
||||||
|
|
||||||
|
340
python/setup.py
Executable file → Normal file
340
python/setup.py
Executable file → Normal file
@@ -1,170 +1,170 @@
|
|||||||
#Thanks to Andreas Knoeckler for providing stand-alone boost.python
|
#Thanks to Andreas Knoeckler for providing stand-alone boost.python
|
||||||
#through PyOpenCL and PyCUDA
|
#through PyOpenCL and PyCUDA
|
||||||
|
|
||||||
import os, sys
|
import os, sys
|
||||||
from distutils.ccompiler import show_compilers,new_compiler
|
from distutils.ccompiler import show_compilers,new_compiler
|
||||||
from distutils.command.build_ext import build_ext
|
from distutils.command.build_ext import build_ext
|
||||||
from distutils.command.build_py import build_py
|
from distutils.command.build_py import build_py
|
||||||
from distutils.core import setup, Extension
|
from distutils.core import setup, Extension
|
||||||
from distutils.sysconfig import get_python_inc
|
from distutils.sysconfig import get_python_inc
|
||||||
from distutils import sysconfig
|
from distutils import sysconfig
|
||||||
from imp import find_module
|
from imp import find_module
|
||||||
from glob import glob
|
from glob import glob
|
||||||
from os.path import dirname
|
from os.path import dirname
|
||||||
|
|
||||||
platform_cflags = {}
|
platform_cflags = {}
|
||||||
platform_ldflags = {}
|
platform_ldflags = {}
|
||||||
platform_libs = {}
|
platform_libs = {}
|
||||||
|
|
||||||
class build_ext_subclass(build_ext):
|
class build_ext_subclass(build_ext):
|
||||||
def build_extensions(self):
|
def build_extensions(self):
|
||||||
c = self.compiler.compiler_type
|
c = self.compiler.compiler_type
|
||||||
if c in platform_cflags.keys():
|
if c in platform_cflags.keys():
|
||||||
for e in self.extensions:
|
for e in self.extensions:
|
||||||
e.extra_compile_args = platform_cflags[c]
|
e.extra_compile_args = platform_cflags[c]
|
||||||
if c in platform_ldflags.keys():
|
if c in platform_ldflags.keys():
|
||||||
for e in self.extensions:
|
for e in self.extensions:
|
||||||
e.extra_link_args = platform_ldflags[c]
|
e.extra_link_args = platform_ldflags[c]
|
||||||
if c in platform_libs.keys():
|
if c in platform_libs.keys():
|
||||||
for e in self.extensions:
|
for e in self.extensions:
|
||||||
try:
|
try:
|
||||||
e.libraries += platform_libs[c]
|
e.libraries += platform_libs[c]
|
||||||
except:
|
except:
|
||||||
e.libraries = platform_libs[c]
|
e.libraries = platform_libs[c]
|
||||||
build_ext.build_extensions(self)
|
build_ext.build_extensions(self)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
def recursive_glob(rootdir='.', suffix=''):
|
def recursive_glob(rootdir='.', suffix=''):
|
||||||
return [os.path.join(looproot, filename)
|
return [os.path.join(looproot, filename)
|
||||||
for looproot, _, filenames in os.walk(rootdir)
|
for looproot, _, filenames in os.walk(rootdir)
|
||||||
for filename in filenames if filename.endswith(suffix)]
|
for filename in filenames if filename.endswith(suffix)]
|
||||||
|
|
||||||
def remove_prefixes(optlist, bad_prefixes):
|
def remove_prefixes(optlist, bad_prefixes):
|
||||||
for bad_prefix in bad_prefixes:
|
for bad_prefix in bad_prefixes:
|
||||||
for i, flag in enumerate(optlist):
|
for i, flag in enumerate(optlist):
|
||||||
if flag.startswith(bad_prefix):
|
if flag.startswith(bad_prefix):
|
||||||
optlist.pop(i)
|
optlist.pop(i)
|
||||||
break
|
break
|
||||||
return optlist
|
return optlist
|
||||||
|
|
||||||
def find_library(name, cmake_glob_list):
|
def find_library(name, cmake_glob_list):
|
||||||
cvars = sysconfig.get_config_vars()
|
cvars = sysconfig.get_config_vars()
|
||||||
compiler = new_compiler()
|
compiler = new_compiler()
|
||||||
dirs = []
|
dirs = []
|
||||||
for gpath in cmake_glob_list.split(';'):
|
for gpath in cmake_glob_list.split(';'):
|
||||||
path = glob(gpath)
|
path = glob(gpath)
|
||||||
if path:
|
if path:
|
||||||
dirs += [path[0]]
|
dirs += [path[0]]
|
||||||
return compiler.find_library_file(cvars['LIBDIR'].split(';') + dirs, name)
|
return compiler.find_library_file(cvars['LIBDIR'].split(';') + dirs, name)
|
||||||
|
|
||||||
def find_opencl():
|
def find_opencl():
|
||||||
cvars = sysconfig.get_config_vars()
|
cvars = sysconfig.get_config_vars()
|
||||||
is_on_android = '-mandroid' in cvars['PY_CFLAGS']
|
is_on_android = '-mandroid' in cvars['PY_CFLAGS']
|
||||||
lib = find_library('OpenCL', '' if is_on_android else '/opt/AMDAPPSDK*/lib/x86_64')
|
lib = find_library('OpenCL', '' if is_on_android else '/opt/AMDAPPSDK*/lib/x86_64')
|
||||||
return {'include': '', 'lib': dirname(lib)} if lib else None
|
return {'include': '', 'lib': dirname(lib)} if lib else None
|
||||||
|
|
||||||
def find_in_path(name, path):
|
def find_in_path(name, path):
|
||||||
"Find a file in a search path"
|
"Find a file in a search path"
|
||||||
#adapted fom http://code.activestate.com/recipes/52224-find-a-file-given-a-search-path/
|
#adapted fom http://code.activestate.com/recipes/52224-find-a-file-given-a-search-path/
|
||||||
for dir in path.split(os.pathsep):
|
for dir in path.split(os.pathsep):
|
||||||
binpath = os.path.join(dir, name)
|
binpath = os.path.join(dir, name)
|
||||||
if os.path.exists(binpath):
|
if os.path.exists(binpath):
|
||||||
return os.path.abspath(binpath)
|
return os.path.abspath(binpath)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def find_cuda():
|
def find_cuda():
|
||||||
if 'CUDAHOME' in os.environ:
|
if 'CUDAHOME' in os.environ:
|
||||||
home = os.environ['CUDAHOME']
|
home = os.environ['CUDAHOME']
|
||||||
nvcc = os.path.join(home, 'bin', 'nvcc')
|
nvcc = os.path.join(home, 'bin', 'nvcc')
|
||||||
else:
|
else:
|
||||||
nvcc = find_in_path('nvcc', os.environ['PATH'])
|
nvcc = find_in_path('nvcc', os.environ['PATH'])
|
||||||
|
|
||||||
if nvcc:
|
if nvcc:
|
||||||
home = dirname(os.path.dirname(nvcc))
|
home = dirname(os.path.dirname(nvcc))
|
||||||
return {'include': os.path.join(home, 'include'),
|
return {'include': os.path.join(home, 'include'),
|
||||||
'lib': os.path.join(home, 'lib64')}
|
'lib': os.path.join(home, 'lib64')}
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
#Tweaks warning, because boost-numpy and boost-python won't compile cleanly without these changes
|
#Tweaks warning, because boost-numpy and boost-python won't compile cleanly without these changes
|
||||||
cvars = sysconfig.get_config_vars()
|
cvars = sysconfig.get_config_vars()
|
||||||
cvars['OPT'] = str.join(' ', remove_prefixes(cvars['OPT'].split(), ['-g', '-Wstrict-prototypes']))
|
cvars['OPT'] = str.join(' ', remove_prefixes(cvars['OPT'].split(), ['-g', '-Wstrict-prototypes']))
|
||||||
cvars["CFLAGS"] = cvars["BASECFLAGS"] + ' ' + cvars['OPT']
|
cvars["CFLAGS"] = cvars["BASECFLAGS"] + ' ' + cvars['OPT']
|
||||||
cvars["LDFLAGS"] = '-Wl,--no-as-needed ' + cvars["LDFLAGS"]
|
cvars["LDFLAGS"] = '-Wl,--no-as-needed ' + cvars["LDFLAGS"]
|
||||||
|
|
||||||
#OpenCL
|
#OpenCL
|
||||||
opencl_config = find_opencl()
|
opencl_config = find_opencl()
|
||||||
|
|
||||||
#CUDA
|
#CUDA
|
||||||
cuda_config = find_cuda()
|
cuda_config = find_cuda()
|
||||||
|
|
||||||
#Libraries
|
#Libraries
|
||||||
libraries = ['OpenCL']
|
libraries = ['OpenCL']
|
||||||
if cuda_config: libraries += ['cuda', 'nvrtc']
|
if cuda_config: libraries += ['cuda', 'nvrtc']
|
||||||
|
|
||||||
#Backends:
|
#Backends:
|
||||||
backend_defines = ['-DISAAC_WITH_OPENCL']
|
backend_defines = ['-DISAAC_WITH_OPENCL']
|
||||||
if cuda_config: backend_defines += ['-DISAAC_WITH_CUDA']
|
if cuda_config: backend_defines += ['-DISAAC_WITH_CUDA']
|
||||||
|
|
||||||
#Library directories
|
#Library directories
|
||||||
library_dirs = [config['lib'] for config in [opencl_config, cuda_config] if config is not None]
|
library_dirs = [config['lib'] for config in [opencl_config, cuda_config] if config is not None]
|
||||||
|
|
||||||
#Include directories
|
#Include directories
|
||||||
include =' src/include src/lib/external'.split() + ['external/boost/', 'external/boost/boost/', os.path.join(find_module("numpy")[1], "core", "include")]
|
include =' src/include src/lib/external'.split() + ['external/boost/', 'external/boost/boost/', os.path.join(find_module("numpy")[1], "core", "include")]
|
||||||
|
|
||||||
#Source files
|
#Source files
|
||||||
src = 'src/lib/wrap/clBLAS.cpp src/lib/value_scalar.cpp src/lib/symbolic/preset.cpp src/lib/symbolic/io.cpp src/lib/symbolic/expression.cpp src/lib/symbolic/execute.cpp src/lib/model/presets.cpp src/lib/model/predictors/random_forest.cpp src/lib/model/model.cpp src/lib/model/database.cpp src/lib/kernels/templates/ger.cpp src/lib/kernels/templates/gemv.cpp src/lib/kernels/templates/gemm.cpp src/lib/kernels/templates/dot.cpp src/lib/kernels/templates/base.cpp src/lib/kernels/templates/axpy.cpp src/lib/kernels/stream.cpp src/lib/kernels/parse.cpp src/lib/kernels/mapped_object.cpp src/lib/kernels/keywords.cpp src/lib/kernels/binder.cpp src/lib/exception/unknown_datatype.cpp src/lib/exception/operation_not_supported.cpp src/lib/driver/program_cache.cpp src/lib/driver/program.cpp src/lib/driver/platform.cpp src/lib/driver/ndrange.cpp src/lib/driver/kernel.cpp src/lib/driver/handle.cpp src/lib/driver/event.cpp src/lib/driver/device.cpp src/lib/driver/context.cpp src/lib/driver/command_queue.cpp src/lib/driver/check.cpp src/lib/driver/buffer.cpp src/lib/driver/backend.cpp src/lib/array.cpp '.split() + [os.path.join('src', 'bind', sf) for sf in ['_isaac.cpp', 'core.cpp', 'driver.cpp', 'model.cpp', 'exceptions.cpp']]
|
src = 'src/lib/symbolic/preset.cpp src/lib/symbolic/execute.cpp src/lib/symbolic/io.cpp src/lib/symbolic/expression.cpp src/lib/database/model.cpp src/lib/database/presets.cpp src/lib/database/database.cpp src/lib/database/predictors/random_forest.cpp src/lib/array.cpp src/lib/value_scalar.cpp src/lib/driver/backend.cpp src/lib/driver/device.cpp src/lib/driver/kernel.cpp src/lib/driver/buffer.cpp src/lib/driver/platform.cpp src/lib/driver/check.cpp src/lib/driver/program.cpp src/lib/driver/command_queue.cpp src/lib/driver/program_cache.cpp src/lib/driver/context.cpp src/lib/driver/event.cpp src/lib/driver/ndrange.cpp src/lib/driver/handle.cpp src/lib/exception/unknown_datatype.cpp src/lib/exception/operation_not_supported.cpp src/lib/kernels/templates/gemv.cpp src/lib/kernels/templates/axpy.cpp src/lib/kernels/templates/gemm.cpp src/lib/kernels/templates/ger.cpp src/lib/kernels/templates/dot.cpp src/lib/kernels/templates/base.cpp src/lib/kernels/mapped_object.cpp src/lib/kernels/stream.cpp src/lib/kernels/parse.cpp src/lib/kernels/keywords.cpp src/lib/kernels/binder.cpp src/lib/wrap/clBLAS.cpp '.split() + [os.path.join('src', 'bind', sf) for sf in ['_isaac.cpp', 'core.cpp', 'driver.cpp', 'model.cpp', 'exceptions.cpp']]
|
||||||
boostsrc = 'external/boost/libs/'
|
boostsrc = 'external/boost/libs/'
|
||||||
for s in ['numpy','python','smart_ptr','system','thread']:
|
for s in ['numpy','python','smart_ptr','system','thread']:
|
||||||
src = src + [x for x in recursive_glob('external/boost/libs/' + s + '/src/','.cpp') if 'win32' not in x and 'pthread' not in x]
|
src = src + [x for x in recursive_glob('external/boost/libs/' + s + '/src/','.cpp') if 'win32' not in x and 'pthread' not in x]
|
||||||
# make sure next line succeeds even on Windows
|
# make sure next line succeeds even on Windows
|
||||||
src = [f.replace("\\", "/") for f in src]
|
src = [f.replace("\\", "/") for f in src]
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
src += glob(boostsrc + "/thread/src/win32/*.cpp")
|
src += glob(boostsrc + "/thread/src/win32/*.cpp")
|
||||||
src += glob(boostsrc + "/thread/src/tss_null.cpp")
|
src += glob(boostsrc + "/thread/src/tss_null.cpp")
|
||||||
else:
|
else:
|
||||||
src += glob(boostsrc + "/thread/src/pthread/*.cpp")
|
src += glob(boostsrc + "/thread/src/pthread/*.cpp")
|
||||||
src= [f for f in src if not f.endswith("once_atomic.cpp")]
|
src= [f for f in src if not f.endswith("once_atomic.cpp")]
|
||||||
|
|
||||||
#Setup
|
#Setup
|
||||||
setup(
|
setup(
|
||||||
name='isaac',
|
name='isaac',
|
||||||
version='1.0',
|
version='1.0',
|
||||||
description="Input-specific architecture-aware computations",
|
description="Input-specific architecture-aware computations",
|
||||||
author='Philippe Tillet',
|
author='Philippe Tillet',
|
||||||
author_email='ptillet@g.harvard.edu',
|
author_email='ptillet@g.harvard.edu',
|
||||||
license='MPL 2.0',
|
license='MPL 2.0',
|
||||||
packages=["isaac"],
|
packages=["isaac"],
|
||||||
ext_package="isaac",
|
ext_package="isaac",
|
||||||
ext_modules=[Extension(
|
ext_modules=[Extension(
|
||||||
'_isaac',src,
|
'_isaac',src,
|
||||||
extra_compile_args= backend_defines + ['-std=c++11', '-Wno-unused-function', '-Wno-unused-local-typedefs', '-Wno-sign-compare', '-Wno-attributes', '-DBOOST_PYTHON_SOURCE '],
|
extra_compile_args= backend_defines + ['-std=c++11', '-Wno-unused-function', '-Wno-unused-local-typedefs', '-Wno-sign-compare', '-Wno-attributes', '-DBOOST_PYTHON_SOURCE '],
|
||||||
extra_link_args=['-Wl,-soname=_isaac.so'],
|
extra_link_args=['-Wl,-soname=_isaac.so'],
|
||||||
undef_macros=[],
|
undef_macros=[],
|
||||||
include_dirs=include,
|
include_dirs=include,
|
||||||
library_dirs=library_dirs,
|
library_dirs=library_dirs,
|
||||||
libraries=libraries
|
libraries=libraries
|
||||||
)],
|
)],
|
||||||
cmdclass={'build_py': build_py, 'build_ext': build_ext_subclass},
|
cmdclass={'build_py': build_py, 'build_ext': build_ext_subclass},
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Environment :: Console',
|
'Environment :: Console',
|
||||||
'Development Status :: 1 - Experimental',
|
'Development Status :: 1 - Experimental',
|
||||||
'Intended Audience :: Developers',
|
'Intended Audience :: Developers',
|
||||||
'Intended Audience :: Other Audience',
|
'Intended Audience :: Other Audience',
|
||||||
'Intended Audience :: Science/Research',
|
'Intended Audience :: Science/Research',
|
||||||
'License :: OSI Approved :: MIT License',
|
'License :: OSI Approved :: MIT License',
|
||||||
'Natural Language :: English',
|
'Natural Language :: English',
|
||||||
'Programming Language :: C++',
|
'Programming Language :: C++',
|
||||||
'Programming Language :: Python',
|
'Programming Language :: Python',
|
||||||
'Programming Language :: Python :: 3',
|
'Programming Language :: Python :: 3',
|
||||||
'Topic :: Scientific/Engineering',
|
'Topic :: Scientific/Engineering',
|
||||||
'Topic :: Scientific/Engineering :: Mathematics',
|
'Topic :: Scientific/Engineering :: Mathematics',
|
||||||
'Topic :: Scientific/Engineering :: Physics',
|
'Topic :: Scientific/Engineering :: Physics',
|
||||||
'Topic :: Scientific/Engineering :: Machine Learning',
|
'Topic :: Scientific/Engineering :: Machine Learning',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#include "core.h"
|
#include "core.h"
|
||||||
#include "driver.h"
|
#include "driver.h"
|
||||||
#include "exceptions.h"
|
#include "exceptions.h"
|
||||||
#include "model.h"
|
#include "database.h"
|
||||||
|
|
||||||
#include <boost/python.hpp>
|
#include <boost/python.hpp>
|
||||||
#include <boost/numpy.hpp>
|
#include <boost/numpy.hpp>
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#include "isaac/model/model.h"
|
#include "isaac/database/model.h"
|
||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ namespace detail
|
|||||||
void export_core()
|
void export_core()
|
||||||
{
|
{
|
||||||
|
|
||||||
bp::class_<isaac::model>("model", bp::no_init)
|
bp::class_<isaac::model>("database", bp::no_init)
|
||||||
.def("__init__", bp::make_constructor(detail::construct_model))
|
.def("__init__", bp::make_constructor(detail::construct_model))
|
||||||
.def("execute", &isc::model::execute);
|
.def("execute", &isc::model::execute);
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
|
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
|
||||||
|
|
||||||
#include "isaac/model/model.h"
|
#include "isaac/database/model.h"
|
||||||
#include "isaac/symbolic/execute.h"
|
#include "isaac/symbolic/execute.h"
|
||||||
|
|
||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
@@ -118,7 +118,7 @@ void export_driver()
|
|||||||
.def("append", &bp::vector_indexing_suite<queues_t>::append)
|
.def("append", &bp::vector_indexing_suite<queues_t>::append)
|
||||||
;
|
;
|
||||||
|
|
||||||
bp::class_<isc::database::map_type>("models")
|
bp::class_<isc::database::map_type>("databases")
|
||||||
.def("__getitem__", &detail::model_map_indexing::get_item, bp::return_internal_reference<>())
|
.def("__getitem__", &detail::model_map_indexing::get_item, bp::return_internal_reference<>())
|
||||||
.def("__setitem__", &detail::model_map_indexing::set_item, bp::with_custodian_and_ward<1,2>())
|
.def("__setitem__", &detail::model_map_indexing::set_item, bp::with_custodian_and_ward<1,2>())
|
||||||
;
|
;
|
||||||
@@ -168,7 +168,7 @@ void export_driver()
|
|||||||
|
|
||||||
bp::class_<isc::driver::CommandQueue>("command_queue", bp::init<isc::driver::Context const &, isc::driver::Device const &>())
|
bp::class_<isc::driver::CommandQueue>("command_queue", bp::init<isc::driver::Context const &, isc::driver::Device const &>())
|
||||||
.def("synchronize", &isc::driver::CommandQueue::synchronize)
|
.def("synchronize", &isc::driver::CommandQueue::synchronize)
|
||||||
.add_property("models", bp::make_function(&isc::database::get, bp::return_internal_reference<>()))
|
.add_property("databases", bp::make_function(&isc::database::get, bp::return_internal_reference<>()))
|
||||||
.add_property("device", bp::make_function(&isc::driver::CommandQueue::device, bp::return_internal_reference<>()))
|
.add_property("device", bp::make_function(&isc::driver::CommandQueue::device, bp::return_internal_reference<>()))
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@@ -3,10 +3,10 @@
|
|||||||
#include "isaac/kernels/templates/dot.h"
|
#include "isaac/kernels/templates/dot.h"
|
||||||
#include "isaac/kernels/templates/gemv.h"
|
#include "isaac/kernels/templates/gemv.h"
|
||||||
#include "isaac/kernels/templates/gemm.h"
|
#include "isaac/kernels/templates/gemm.h"
|
||||||
#include "isaac/model/model.h"
|
#include "isaac/database/model.h"
|
||||||
|
|
||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
#include "model.h"
|
#include "database.h"
|
||||||
|
|
||||||
|
|
||||||
namespace tpt = isaac::templates;
|
namespace tpt = isaac::templates;
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
#include "isaac/array.h"
|
#include "isaac/array.h"
|
||||||
#include "isaac/model/model.h"
|
#include "isaac/database/model.h"
|
||||||
#include "isaac/wrap/clBLAS.h"
|
#include "isaac/wrap/clBLAS.h"
|
||||||
|
|
||||||
namespace isc = isaac;
|
namespace isc = isaac;
|
||||||
|
Reference in New Issue
Block a user