Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Divide tiling blocksize by itemsize

  • Loading branch information...
commit 5c8409cf6645b06860da6b1060497afe54b07315 1 parent cbe47f8
@markflorisson authored
View
3  Cython/Compiler/Vector.py
@@ -736,7 +736,8 @@ def put_specialized_call(self, code, specializer, specialized_function,
args.extend(scalar_arg.result() for scalar_arg in self.scalar_operands)
if specializer.is_tiled_specializer:
- args.append("__pyx_vector_get_tile_size()")
+ dtype_decl = self.type.dtype.declaration_code("")
+ args.append("__pyx_vector_get_tile_size() / sizeof(%s)" % dtype_decl)
call = "%s(%s)" % (specialized_function.mangled_name, ", ".join(args))
if self.may_error:
View
18 Cython/Utility/Vector.pyx
@@ -2,7 +2,7 @@
DEF _DEBUG = False
-DEF MIN_BLOCKSIZE = 64
+DEF MIN_BLOCKSIZE = 256
DEF SIZE = 1600
DEF MAX_TRIES = 4
DEF N_SAMPLES = 10
@@ -48,18 +48,8 @@ cdef Py_ssize_t compute_tile_size() except 0:
raise MemoryError
cdef Py_ssize_t blocksize = MIN_BLOCKSIZE
- cdef Py_ssize_t best_blocksize
-
- best_time = try_blocksize(a, b, blocksize)
- t = try_blocksize(a, b, blocksize * 8)
-
- if t < best_time:
- best_time = t
- blocksize *= 8
- best_blocksize = blocksize
- else:
- best_blocksize = blocksize
- blocksize *= 2
+ cdef Py_ssize_t best_blocksize = blocksize
+ best_time = float('inf')
cdef int i
cdef int seen_worse_blocksizes = 0
@@ -77,8 +67,6 @@ cdef Py_ssize_t compute_tile_size() except 0:
best_time = t
blocksize *= 2
- if blocksize == MIN_BLOCKSIZE * 8:
- blocksize *= 2
finally:
free(a)
free(b)
2  Cython/minivect
@@ -1 +1 @@
-Subproject commit 026de9b87aadbbaf5b69f3da7b1f471be0d9b0b6
+Subproject commit 05fa4208d0213c7455bd0e9c053f4a51ef475e3f
Please sign in to comment.
Something went wrong with that request. Please try again.