From 1c3e0f37b58b0326b9adf0894a018bf8b12c737f Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Tue, 18 Jan 2011 20:11:28 -0500 Subject: [PATCH] Fix missing bitlog table. --- setup.py | 5 +++-- src/wrapper/bitlog.cpp | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 src/wrapper/bitlog.cpp diff --git a/setup.py b/setup.py index 633e439c..152c599c 100644 --- a/setup.py +++ b/setup.py @@ -59,7 +59,7 @@ def main(): EXTRA_LIBRARY_DIRS = [] EXTRA_LIBRARIES = [] - EXTRA_DEFINES["PYGPU_PACKAGE"] = "pyopencl"; + EXTRA_DEFINES["PYGPU_PACKAGE"] = "pyopencl" if conf["CL_TRACE"]: EXTRA_DEFINES["PYOPENCL_TRACE"] = 1 @@ -81,7 +81,7 @@ def main(): from distutils.command.build_py import build_py try: - import murko + import mako except ImportError: print("-------------------------------------------------------------------------") print("Mako is not installed.") @@ -180,6 +180,7 @@ def main(): "src/wrapper/wrap_cl_part_2.cpp", "src/wrapper/wrap_constants.cpp", "src/wrapper/wrap_mempool.cpp", + "src/wrapper/bitlog.cpp", ]+EXTRA_OBJECTS, include_dirs=INCLUDE_DIRS + EXTRA_INCLUDE_DIRS, library_dirs=LIBRARY_DIRS + conf["CL_LIB_DIR"], diff --git a/src/wrapper/bitlog.cpp b/src/wrapper/bitlog.cpp new file mode 100644 index 00000000..88b820fa --- /dev/null +++ b/src/wrapper/bitlog.cpp @@ -0,0 +1,27 @@ +#include "bitlog.hpp" + + + + +/* from http://graphics.stanford.edu/~seander/bithacks.html */ +const char pyopencl::log_table_8[] = +{ + 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 +}; + + -- GitLab