From bf3fe7c08e129ac9a89e3a3e52613e63299779e1 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sat, 28 Dec 2019 11:48:43 -0500 Subject: [PATCH 01/48] Explicitly add nonzero methods for base latebind classes --- OpenGL/latebind.py | 4 +++- accelerate/src/latebind.pyx | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/OpenGL/latebind.py b/OpenGL/latebind.py index dc28dc28..3b01133f 100644 --- a/OpenGL/latebind.py +++ b/OpenGL/latebind.py @@ -29,7 +29,9 @@ def finalise( self ): return final callable """ - + def __nonzero__(self): + """Resolve our final call and check for empty/nonzero on it""" + return bool(self.getFinalCall()) def __call__( self, *args, **named ): """Call self._finalCall, calling finalise() first if not already called diff --git a/accelerate/src/latebind.pyx b/accelerate/src/latebind.pyx index f2748240..f009a76e 100644 --- a/accelerate/src/latebind.pyx +++ b/accelerate/src/latebind.pyx @@ -14,6 +14,11 @@ cdef class LateBind: def finalise( self ): """Finalise our target to our final callable object""" + def __nonzero__(self): + """Resolve our final call and check for empty/nonzero on it""" + return bool(self.getFinalCall()) + __bool__ = __nonzero__ + def getFinalCall( self ): """Retrieve and/or bind and retrieve final call""" if not self._finalCall: From 5f206dab356e378ff1e7f22fdb03d986b1974df8 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sat, 28 Dec 2019 11:49:07 -0500 Subject: [PATCH 02/48] DEMO provide a running version of code in bug report in #34 --- tests/gh_bug32.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/gh_bug32.py diff --git a/tests/gh_bug32.py b/tests/gh_bug32.py new file mode 100644 index 00000000..012d2b2f --- /dev/null +++ b/tests/gh_bug32.py @@ -0,0 +1,24 @@ +#! /usr/bin/env python +"""Tests bug report #32 from github""" +import os +if not os.environ.get( 'PYOPENGL_PLATFORM' ): + os.environ['PYOPENGL_PLATFORM'] = 'osmesa' +from math import pi, sin, cos +import OpenGL +OpenGL.USE_ACCELERATE = False +from OpenGL.GL import * +from OpenGL.GL.ARB.fragment_program import glGenProgramsARB +from OpenGL.GLU import * +from OpenGL.osmesa import * +width = height = 300 + +shared_win = None +# Current OSMesa does not seem to support RGB, only RGBA, +# note also the use of the OSMESA_* constants here, they +# seem to match the GL constants, but can't be too careful. +# Also see ./osdemo.py for a working sample of offscreen +# rendering using OSMesa. +ctx = OSMesaCreateContext(OSMESA_RGBA, shared_win) +buf = arrays.GLubyteArray.zeros((height, width, 4)) +mesap = arrays.ArrayDatatype.dataPointer(buf) +assert(OSMesaMakeCurrent(ctx, GLuint(mesap), GL_UNSIGNED_BYTE, width, height)) \ No newline at end of file From e81584a70a0e76fc9e0cb6a4a8fd4f5af6b20a94 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sat, 28 Dec 2019 13:32:36 -0500 Subject: [PATCH 03/48] Skip generation of .xhtml redirect stubs --- directdocs/generate.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/directdocs/generate.py b/directdocs/generate.py index 8e9b572f..a1392add 100755 --- a/directdocs/generate.py +++ b/directdocs/generate.py @@ -331,8 +331,6 @@ def main(): data = stream.render('html') open( os.path.join(OUTPUT_DIRECTORY,'index.html'), 'w').write( data ) base = 'index.html' - old_file = os.path.join(OUTPUT_DIRECTORY,'index.xhtml') - open( old_file, 'w' ).write(REDIRECT%locals()) for name,section in sorted(ref.sections.items()): output_file = os.path.join( OUTPUT_DIRECTORY,ref.url(section)) @@ -351,9 +349,6 @@ def main(): open( output_file, 'wb' ).write( data ) - old_file = os.path.splitext( output_file )[0] + '.xhtml' - base = ref.url( section ) - open( old_file, 'w' ).write(REDIRECT%locals()) # Now store out references for things which want to do Python: refsect From f85d8ce8a652fa48bb861da0afa7bb5473774da9 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sat, 28 Dec 2019 13:33:21 -0500 Subject: [PATCH 04/48] Update tartley projects to github urls, provide first-line links on gh and bb --- directdocs/references.py | 22 +++++++++++----------- directdocs/samples.py | 14 +++++++------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/directdocs/references.py b/directdocs/references.py index f814c243..b9cfa624 100755 --- a/directdocs/references.py +++ b/directdocs/references.py @@ -34,10 +34,10 @@ def glName( name ): return True return 0 -def glProcess( filename, tokenType,tokenString, xxx_todo_changeme4, xxx_todo_changeme5,lineText ): +def glProcess( filename, tokenType, tokenString, sourceStart, sourceEnd, lineText ): """Process the name in some way""" - (sourceRow,sourceCol) = xxx_todo_changeme4 - (endRow,endCol) = xxx_todo_changeme5 + (sourceRow,sourceCol) = sourceStart + (endRow,endCol) = sourceEnd print(filename, sourceRow, tokenString, lineText.strip()) @@ -77,8 +77,8 @@ def generate_tokens_dir( directory, filterFunction=glName, processFunction=glPro LOGGERHEAD = '%(baseURL)s/view/head:/%(deltaPath)s' GOOGLECODE = '%(baseURL)s/source/browse/trunk/%(deltaPath)s' GOOGLECODE_HG = '%(baseURL)s/source/browse/%(deltaPath)s' -GITHUB = '%(baseURL)s/blob/master/%(deltaPath)s' -BITBUCKET = '%(baseURL)s/src/tip/%(deltaPath)s' +GITHUB = '%(baseURL)s/blob/master/%(deltaPath)s#L%(sourceRow)s' +BITBUCKET = '%(baseURL)s/src/tip/%(deltaPath)s#lines-%(sourceRow)s' class SampleSource( object ): """A source from which samples may be generated""" @@ -220,21 +220,21 @@ def loadData(): ), SampleSource( os.path.join( SAMPLES, 'agog' ), - baseURL='https://bitbucket.org/tartley/algorithmic-generation-of-geometry/', + baseURL='https://github.com/tartley/algorithmic-generation-of-opengl-geometry', projectName = 'AGoG', - urlTemplate = BITBUCKET, + urlTemplate = GITHUB, ), SampleSource( os.path.join( SAMPLES, 'gloopy' ), - baseURL = 'https://bitbucket.org/tartley/gloopy/', + baseURL = 'https://github.com/tartley/gloopy', projectName = 'Gloopy', - urlTemplate = BITBUCKET, + urlTemplate = GITHUB, ), SampleSource( os.path.join( SAMPLES, 'gltutpy' ), - baseURL = 'https://bitbucket.org/tartley/gltutpy/', + baseURL = 'https://github.com/tartley/gltutpy', projectName = 'OpenGL Tutorial (Python Translation)', - urlTemplate = BITBUCKET, + urlTemplate = GITHUB, ), SampleSource( os.path.join( SAMPLES, 'visvis' ), diff --git a/directdocs/samples.py b/directdocs/samples.py index d327f159..6513825e 100755 --- a/directdocs/samples.py +++ b/directdocs/samples.py @@ -159,19 +159,19 @@ def update_command( self ): dirname = 'pygl2d', ), BZRSource( - 'lp:~bebraw/scocca/devel', + 'https://code.launchpad.net/~bebraw/scocca/devel', dirname = 'scocca', ), - HgSource( - 'https://bitbucket.org/tartley/gltutpy', + GITSource( + 'https://github.com/tartley/gltutpy.git', dirname = 'gltutpy', ), - HgSource( - 'https://bitbucket.org/tartley/algorithmic-generation-of-geometry', + GITSource( + 'https://github.com/tartley/algorithmic-generation-of-opengl-geometry.git', dirname = 'agog', ), - HgSource( - 'https://bitbucket.org/tartley/gloopy', + GITSource( + 'https://github.com/tartley/gloopy.git', dirname = 'gloopy', ), GITSource( From ce8c5d5e700d05f2de73beba9fc3b7bcedf02f39 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sat, 28 Dec 2019 13:45:48 -0500 Subject: [PATCH 05/48] Update comment to note that we're next to the main checkout now --- directdocs/upload.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/directdocs/upload.sh b/directdocs/upload.sh index aa565552..c53fa5b1 100755 --- a/directdocs/upload.sh +++ b/directdocs/upload.sh @@ -1,3 +1,5 @@ #! /bin/bash +# relies on having the gh-pages checkout as `website` +# sitting next to the `pyopengl` root checkout rsync -av manual-3.1/* ../../website/documentation/manual/ From ca2cbbed46fc771a95b0ef9551c2d21151819fc5 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sat, 28 Dec 2019 14:08:15 -0500 Subject: [PATCH 06/48] DEMO Attempt to recreate github #33 without success This is an osmesa demo using shaders and vertex attribute pointers --- tests/gh_bug33_osmesa_attribute_pointer.py | 151 +++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 tests/gh_bug33_osmesa_attribute_pointer.py diff --git a/tests/gh_bug33_osmesa_attribute_pointer.py b/tests/gh_bug33_osmesa_attribute_pointer.py new file mode 100644 index 00000000..ac688bde --- /dev/null +++ b/tests/gh_bug33_osmesa_attribute_pointer.py @@ -0,0 +1,151 @@ +from __future__ import print_function +import os +if not os.environ.get( 'PYOPENGL_PLATFORM' ): + os.environ['PYOPENGL_PLATFORM'] = 'osmesa' +import OpenGL +OpenGL.USE_ACCELERATE = False +from OpenGL.GL import * +from OpenGL.arrays import vbo +from OpenGL import extensions +from OpenGL.GL.ARB.fragment_program import glGenProgramsARB +from OpenGL.GLU import * +from OpenGL.osmesa import * +from OpenGL.GL import shaders +from numpy import arange, array +import contextlib + +def write_ppm(buf, filename): + """Write traditional ASCII PPM file from buffer""" + with open(filename, "w") as f: + h, w, c = buf.shape + print( "P3", file=f) + print( "# ascii ppm file created by osmesa",file=f) + print( "%i %i" % (w, h),file=f) + print("255",file=f) + for y in range(h - 1, -1, -1): + for x in range(w): + pixel = buf[y, x] + l = " %3d %3d %3d" % (pixel[0], pixel[1], pixel[2]) + f.write(l) + f.write("\n") + +@contextlib.contextmanager +def osmesa_context(width=400, height=400, output='output.ppm'): + """Do OSMesa rendering context setup and write to output if non-null""" + from OpenGL import arrays + ctx = OSMesaCreateContext(OSMESA_RGBA, None) + buf = arrays.GLubyteArray.zeros((height, width, 4)) + assert(OSMesaMakeCurrent(ctx, buf, GL_UNSIGNED_BYTE, width, height)) + assert(OSMesaGetCurrentContext()) + yield (ctx, buf) + if output: + write_ppm(buf,output) + OSMesaDestroyContext(ctx) + +def setup(): + """Setup the rendering passes + + Taken from `OpenGLContext/tests/shader_4.py` + """ + vertex = shaders.compileShader( + """ + uniform float tween; + attribute vec3 position; + attribute vec3 tweened; + attribute vec3 color; + varying vec4 baseColor; + void main() { + gl_Position = gl_ModelViewProjectionMatrix * mix( + vec4( position,1.0), + vec4( tweened,1.0), + tween + ); + baseColor = vec4(color,1.0); + }""", + GL_VERTEX_SHADER + ) + fragment = shaders.compileShader( + """ + varying vec4 baseColor; + void main() { + gl_FragColor = baseColor; + }""", + GL_FRAGMENT_SHADER + ) + shader = shaders.compileProgram(vertex,fragment) + vertices = vbo.VBO( + array( [ + [ 0, 1, 0, 1,3,0, 0,1,0 ], + [ -1,-1, 0, -1,-1,0, 1,1,0 ], + [ 1,-1, 0, 1,-1,0, 0,1,1 ], + + [ 2,-1, 0, 2,-1,0, 1,0,0 ], + [ 4,-1, 0, 4,-1,0, 0,1,0 ], + [ 4, 1, 0, 4,9,0, 0,0,1 ], + [ 2,-1, 0, 2,-1,0, 1,0,0 ], + [ 4, 1, 0, 1,3,0, 0,0,1 ], + [ 2, 1, 0, 1,-1,0, 0,1,1 ], + ],'f') + ) + position_location = glGetAttribLocation( + shader, 'position' + ) + tweened_location = glGetAttribLocation( + shader, 'tweened', + ) + color_location = glGetAttribLocation( + shader, 'color' + ) + tween_location = glGetUniformLocation( + shader, 'tween', + ) + return { + 'shader': shader, + 'position_location': position_location, + 'tweened_location': tweened_location, + 'color_location': color_location, + 'tween_location': tween_location, + 'vertices': vertices, + } +def render(names, fraction=.5): + glUseProgram(names['shader']) + glUniform1f(names['tween_location'], fraction) + with names['vertices']: + try: + glEnableVertexAttribArray( names['position_location'] ) + glEnableVertexAttribArray( names['tweened_location'] ) + glEnableVertexAttribArray( names['color_location'] ) + stride = 9*4 + glVertexAttribPointer( + names['position_location'], + 3, GL_FLOAT,False, stride, names['vertices'] + ) + glVertexAttribPointer( + names['tweened_location'], + 3, GL_FLOAT,False, stride, names['vertices']+12 + ) + glVertexAttribPointer( + names['color_location'], + 3, GL_FLOAT,False, stride, names['vertices']+24 + ) + glDrawArrays(GL_TRIANGLES, 0, 9) + finally: + glDisableVertexAttribArray( names['position_location'] ) + glDisableVertexAttribArray( names['tweened_location'] ) + glDisableVertexAttribArray( names['color_location'] ) + +def main(): + with osmesa_context(400,400) as context: + print('Queried extensions:', sorted(extensions.GLQuerier.pullExtensions())) + print('Queried version:', extensions.GLQuerier.pullVersion()) + names = setup() + for fraction in arange(0,.5,.1): + glClearColor(0.0,0.0,1.0,1.0) + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ) + print("Rendering: %s"%(fraction,)) + render(names,fraction) + glFinish() + + +if __name__ == '__main__': + main() \ No newline at end of file From d401885f6a1c61213058a96e050eb45ee6189b7c Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sat, 28 Dec 2019 14:52:46 -0500 Subject: [PATCH 07/48] FIX GH #12 Include pxd files in the source-code release The __init__.py file seems to already be included, so no changes there. --- accelerate/MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/accelerate/MANIFEST.in b/accelerate/MANIFEST.in index 13cce5ff..3093dce5 100644 --- a/accelerate/MANIFEST.in +++ b/accelerate/MANIFEST.in @@ -1,3 +1,4 @@ include src/*.pyx include src/*.c +include OpenGL_accelerate/*.pxd include license.txt From 4f9cb46e50c221f65b216d8066f833535e43e672 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sat, 28 Dec 2019 21:23:23 -0500 Subject: [PATCH 08/48] Add pyrender as a sample source --- directdocs/references.py | 6 ++++++ directdocs/samples.py | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/directdocs/references.py b/directdocs/references.py index b9cfa624..f4a8d640 100755 --- a/directdocs/references.py +++ b/directdocs/references.py @@ -248,6 +248,12 @@ def loadData(): projectName = '{GPL3} OpenGL-Programmable', urlTemplate = BITBUCKET, ), + SampleSource( + os.path.join(SAMPLES,'pyrender'), + baseURL='https://github.com/mmatl/pyrender', + projectName='Pyrender', + urlTemplate=GITHUB, + ) ]: generate_tokens_dir( s.localDir, processFunction = s.processEntry) result = SampleSource.nameMapping diff --git a/directdocs/samples.py b/directdocs/samples.py index 6513825e..b7bfa27e 100755 --- a/directdocs/samples.py +++ b/directdocs/samples.py @@ -181,7 +181,11 @@ def update_command( self ): HgSource( 'https://bitbucket.org/rndblnch/opengl-programmable/', dirname = 'programmable', - ) + ), + GITSource( + 'https://github.com/mmatl/pyrender.git', + dirname='pyrender', + ), # pymol # not pyopengl AFAICS # {LGPL} mirra # no online view of code AFAICS # soccerbots http://soccerbots.googlecode.com/svn/ From 8f8d3e8cffe38224e2fbe8deb3050412c2e16dba Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sat, 28 Dec 2019 21:24:15 -0500 Subject: [PATCH 09/48] FIX #27 Load libOpenGL instead of libGL for egl platform --- OpenGL/platform/egl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenGL/platform/egl.py b/OpenGL/platform/egl.py index 8a92d018..1e087eb0 100644 --- a/OpenGL/platform/egl.py +++ b/OpenGL/platform/egl.py @@ -33,7 +33,7 @@ def GL(self): try: return ctypesloader.loadLibrary( ctypes.cdll, - 'GL', + 'OpenGL', mode=ctypes.RTLD_GLOBAL ) except OSError: From 3c813868fec3becc537781b1a768945534bf939a Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sat, 28 Dec 2019 21:26:55 -0500 Subject: [PATCH 10/48] Attempt to get an offscreen (pbuffer) render wrapper working This does *not* work correctly unless you have an actual display, so it's somewhat useless/broken. What we want is a way to get a pbuffer context without needing a display, and EGL_DEFAULT_DISPLAY doesn't seem like the correct value. --- tests/egltest.py | 6 +-- tests/os_egl.py | 100 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 tests/os_egl.py diff --git a/tests/egltest.py b/tests/egltest.py index c1c5d550..65f112f2 100644 --- a/tests/egltest.py +++ b/tests/egltest.py @@ -1,15 +1,15 @@ """EGL Pygame test framework""" from __future__ import print_function +import os +if not os.environ.get( 'PYOPENGL_PLATFORM' ): + os.environ['PYOPENGL_PLATFORM'] = 'egl' import ctypes import pygame.display import pygame -import os import logging import OpenGL from functools import wraps -if not os.environ.get( 'PYOPENGL_PLATFORM' ): - os.environ['PYOPENGL_PLATFORM'] = 'egl' if os.environ.get( 'TEST_NO_ACCELERATE' ): OpenGL.USE_ACCELERATE = False diff --git a/tests/os_egl.py b/tests/os_egl.py new file mode 100644 index 00000000..65e5b23d --- /dev/null +++ b/tests/os_egl.py @@ -0,0 +1,100 @@ +from __future__ import print_function +import os +if not os.environ.get( 'PYOPENGL_PLATFORM' ): + os.environ['PYOPENGL_PLATFORM'] = 'egl' +import logging, contextlib +from functools import wraps +from OpenGL.GL import * +from OpenGL.EGL import * +from OpenGL import arrays +log = logging.getLogger( __name__ ) + +API_MAP = { + EGL_OPENGL_BIT:EGL_OPENGL_API, + EGL_OPENGL_ES2_BIT:EGL_OPENGL_ES_API, + EGL_OPENGL_ES_BIT:EGL_OPENGL_ES_API, +} + +def write_ppm(buf, filename): + f = open(filename, "w") + if f: + h, w, c = buf.shape + print( "P3", file=f) + print( "# ascii ppm file created by os_egl",file=f) + print( "%i %i" % (w, h),file=f) + print("255",file=f) + for y in range(h - 1, -1, -1): + for x in range(w): + pixel = buf[y, x] + l = " %3d %3d %3d" % (pixel[0], pixel[1], pixel[2]) + f.write(l) + f.write("\n") + + +@contextlib.contextmanager +def egl_context( + width=400, + height=400, + api=EGL_OPENGL_BIT, + attributes = ( + EGL_BLUE_SIZE, 8, + EGL_RED_SIZE,8, + EGL_GREEN_SIZE,8, + EGL_DEPTH_SIZE,24, + EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER, + EGL_CONFIG_CAVEAT, EGL_NONE, # Don't allow slow/non-conformant + EGL_SURFACE_TYPE, EGL_PBUFFER_BIT, + ), + output='output.ppm', +): + """Setup a context for rendering""" + major,minor = GLint(), GLint() + display = eglGetDisplay(EGL_DEFAULT_DISPLAY) + if display == EGL_NO_DISPLAY: + raise RuntimeError(EGL_NO_DISPLAY, ) + # print("Display: %s"%(display.address,)) + eglInitialize( display, major, minor) + num_configs = GLint() + configs = (EGLConfig*2)() + local_attributes = list(attributes[:]) + local_attributes.extend( [ + # EGL_CONFORMANT, api, + EGL_NONE, # end of list + ]) + log.info("Attributes: %s", local_attributes) + local_attributes= arrays.GLintArray.asArray( local_attributes ) + try: + eglChooseConfig(display, local_attributes, configs, 2, num_configs) + surface_attributes = [ + EGL_WIDTH,width, + EGL_HEIGHT,height, + EGL_NONE, + ] + surface = eglCreatePbufferSurface( + display, + configs[0], + surface_attributes, + ) + except GLError as err: + log.error("Error code: %s on %s", err.err, err.baseOperation) + raise + eglBindAPI(API_MAP[api]) + ctx = eglCreateContext(display, configs[0], EGL_NO_CONTEXT, None) + if ctx == EGL_NO_CONTEXT: + raise RuntimeError( 'Unable to create context' ) + eglMakeCurrent( display, surface, surface, ctx ) + yield ctx,surface + content = glReadPixelsub(0,0, width, height, GL_RGB, outputType=None) + if output: + write_ppm(content, output) + # eglSwapBuffers( display, surface ) + +def main(): + with egl_context() as setup: + ctx,surface = setup + glClearColor(1.0,1.0,1.0,1.0) + glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) + +if __name__ == '__main__': + logging.basicConfig(level=logging.INFO) + main() From 4a40d2b6662f88558efbbddaae9f3c850255aa2c Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sat, 28 Dec 2019 21:28:16 -0500 Subject: [PATCH 11/48] Ignore the output of osmesa and egl tests --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f3058e6e..2ea1c8b4 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ accelerate/dist *.so mmap-test-data.dat .tox +tests/output.ppm From 41e6f571924176d7420c03e52f7949a5bb494768 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sat, 28 Dec 2019 21:34:36 -0500 Subject: [PATCH 12/48] Explicitly delete the DISPLAY environment variable to force offline operation --- tests/os_egl.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/os_egl.py b/tests/os_egl.py index 65e5b23d..f5140675 100644 --- a/tests/os_egl.py +++ b/tests/os_egl.py @@ -1,13 +1,15 @@ from __future__ import print_function -import os +import os, logging +log = logging.getLogger( __name__ ) if not os.environ.get( 'PYOPENGL_PLATFORM' ): os.environ['PYOPENGL_PLATFORM'] = 'egl' +if 'DISPLAY' in os.environ: + del os.environ['DISPLAY'] import logging, contextlib from functools import wraps from OpenGL.GL import * from OpenGL.EGL import * from OpenGL import arrays -log = logging.getLogger( __name__ ) API_MAP = { EGL_OPENGL_BIT:EGL_OPENGL_API, From 2487c2104115b0d21bab35111ae7d19e275e25a4 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sat, 28 Dec 2019 23:03:47 -0500 Subject: [PATCH 13/48] Try to create script to query the egl device enumerations --- tests/egl_ext_enumerate.py | 27 +++++++++++++++++++++++++++ tests/os_egl.py | 5 +++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 tests/egl_ext_enumerate.py diff --git a/tests/egl_ext_enumerate.py b/tests/egl_ext_enumerate.py new file mode 100644 index 00000000..29042bbf --- /dev/null +++ b/tests/egl_ext_enumerate.py @@ -0,0 +1,27 @@ +from os_egl import egl_context +from OpenGL import EGL +from OpenGL.EGL.EXT import device_query, device_enumeration +from OpenGL.GL import GLint + +def main(): + with egl_context(output=None) as context: + display,context,surface = context + print("Vendor: %s"%(EGL.eglQueryString(display, EGL.EGL_VENDOR))) + print("Version: %s"%(EGL.eglQueryString(display, EGL.EGL_VERSION))) + print("Extensions: %s"%(EGL.eglQueryString(display, EGL.EGL_EXTENSIONS),)) + print("Client Extensions: %s"%(EGL.eglQueryString(display, EGL.EGL_CLIENT_APIS),)) + if device_enumeration.eglQueryDevicesEXT: + devices = (device_query.EGLDeviceEXT * 5)() + count = GLint() + device_enumeration.eglQueryDevicesEXT( + 5, + devices, + count, + ) + for device in devices[:int(count)]: + print(device) + else: + print('No device_query extension available') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/tests/os_egl.py b/tests/os_egl.py index f5140675..1f90f8a9 100644 --- a/tests/os_egl.py +++ b/tests/os_egl.py @@ -85,7 +85,7 @@ def egl_context( if ctx == EGL_NO_CONTEXT: raise RuntimeError( 'Unable to create context' ) eglMakeCurrent( display, surface, surface, ctx ) - yield ctx,surface + yield display,ctx,surface content = glReadPixelsub(0,0, width, height, GL_RGB, outputType=None) if output: write_ppm(content, output) @@ -93,10 +93,11 @@ def egl_context( def main(): with egl_context() as setup: - ctx,surface = setup + display,ctx,surface = setup glClearColor(1.0,1.0,1.0,1.0) glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) + if __name__ == '__main__': logging.basicConfig(level=logging.INFO) main() From e04bee447825cbaf7ba78bd14572255e6bc8e20d Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sun, 29 Dec 2019 13:39:21 -0500 Subject: [PATCH 14/48] FIX Add on for the fix to #6 to make force_extension functions bool() work --- OpenGL/platform/baseplatform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenGL/platform/baseplatform.py b/OpenGL/platform/baseplatform.py index 5bd69eca..645f371e 100644 --- a/OpenGL/platform/baseplatform.py +++ b/OpenGL/platform/baseplatform.py @@ -379,7 +379,7 @@ def __init__( resolved = False def __nonzero__( self ): """Make this object appear to be NULL""" - if self.extension and not self.resolved: + if (not self.resolved) and (self.extension or self.force_extension): self.load() return self.resolved __bool__ = __nonzero__ From 589d3ca5e08c89ac2885b22b5fa54b0d5b8283be Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sun, 29 Dec 2019 13:40:20 -0500 Subject: [PATCH 15/48] Make `eglGetPlatformDisplay` an alternate with `eglGetPlatformDisplayEXT` --- OpenGL/EGL/VERSION/EGL_1_5.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OpenGL/EGL/VERSION/EGL_1_5.py b/OpenGL/EGL/VERSION/EGL_1_5.py index 6cb6c6a7..1a0f757d 100644 --- a/OpenGL/EGL/VERSION/EGL_1_5.py +++ b/OpenGL/EGL/VERSION/EGL_1_5.py @@ -21,5 +21,13 @@ def glInitEgl15VERSION(): ### END AUTOGENERATED SECTION +from ..EXT.platform_base import eglGetPlatformDisplayEXT +from OpenGL.extensions import alternate as _alternate eglGetPlatformDisplay.extension = None eglGetPlatformDisplay.force_extension = True + +eglGetPlatformDisplay = _alternate( + 'eglGetPlatformDisplay', + eglGetPlatformDisplayEXT, + eglGetPlatformDisplay, +) \ No newline at end of file From 0dca32d246b3b67cb9ce6f02026bcf4dab727027 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sun, 29 Dec 2019 23:03:10 -0500 Subject: [PATCH 16/48] WIP Getting an egl-only offscreen renderer working Working bits: * nvidia driver pbuffer using egl enumeration and skipping non-egl-device devices (intel, likely amd), can run basic introspection code in the nvidia environment using opengl * gbmdevice to setup new gbm devices and surfaces, we can run the client rendering process inside the operation, but then we're seeing a segfault inside the dri swrast when we try to do a buffer swap flush or finish --- OpenGL/EGL/EXT/device_base.py | 12 +- OpenGL/EGL/debug.py | 107 ++++++++++++++++ OpenGL/EGL/gbmdevice.py | 114 +++++++++++++++++ OpenGL/raw/EGL/_errors.py | 2 +- tests/gh_bug6_check.py | 30 +++++ tests/os_egl.py | 233 +++++++++++++++++++++++++++------- 6 files changed, 448 insertions(+), 50 deletions(-) create mode 100644 OpenGL/EGL/debug.py create mode 100644 OpenGL/EGL/gbmdevice.py create mode 100644 tests/gh_bug6_check.py diff --git a/OpenGL/EGL/EXT/device_base.py b/OpenGL/EGL/EXT/device_base.py index 73047024..d72eeb39 100644 --- a/OpenGL/EGL/EXT/device_base.py +++ b/OpenGL/EGL/EXT/device_base.py @@ -20,4 +20,14 @@ def glInitDeviceBaseEXT(): return extensions.hasGLExtension( _EXTENSION_NAME ) -### END AUTOGENERATED SECTION \ No newline at end of file +### END AUTOGENERATED SECTION +eglQueryDevicesEXT.extension = None +eglQueryDevicesEXT.force_extension = True + +def egl_get_devices(max_count=10): + """Utility function that retrieves platform devices""" + devices = (_types.EGLDeviceEXT*max_count)() + count = _types.EGLint() + if eglQueryDevicesEXT(max_count,devices,count): + return devices[:count.value] + return [] diff --git a/OpenGL/EGL/debug.py b/OpenGL/EGL/debug.py new file mode 100644 index 00000000..c577e0ba --- /dev/null +++ b/OpenGL/EGL/debug.py @@ -0,0 +1,107 @@ +"""Debug utilities for EGL operations""" +from OpenGL.EGL import * +def eglErrorName(value): + """Returns error constant if known, otherwise returns value""" + return KNOWN_ERRORS.get(value,value) +KNOWN_ERRORS = { + EGL_SUCCESS:EGL_SUCCESS, + EGL_NOT_INITIALIZED:EGL_NOT_INITIALIZED, + EGL_BAD_ACCESS:EGL_BAD_ACCESS, + EGL_BAD_ALLOC:EGL_BAD_ALLOC, + EGL_BAD_ATTRIBUTE:EGL_BAD_ATTRIBUTE, + EGL_BAD_CONTEXT:EGL_BAD_CONTEXT, + EGL_BAD_CONFIG:EGL_BAD_CONFIG, + EGL_BAD_CURRENT_SURFACE:EGL_BAD_CURRENT_SURFACE, + EGL_BAD_DISPLAY:EGL_BAD_DISPLAY, + EGL_BAD_SURFACE:EGL_BAD_SURFACE, + EGL_BAD_MATCH:EGL_BAD_MATCH, + EGL_BAD_PARAMETER:EGL_BAD_PARAMETER, + EGL_BAD_NATIVE_PIXMAP:EGL_BAD_NATIVE_PIXMAP, + EGL_BAD_NATIVE_WINDOW:EGL_BAD_NATIVE_WINDOW, + EGL_CONTEXT_LOST:EGL_CONTEXT_LOST, +} + +def debug_config(display,config): + """Get debug display for the given configuration""" + result = {} + value = EGLint() + for attr in CONFIG_ATTRS: + eglGetConfigAttrib(display,config, attr, value) + if attr in BITMASK_FIELDS: + attr_value = { + } + for subattr in BITMASK_FIELDS[attr]: + if value.value & subattr: + attr_value[subattr.name] = True + else: + attr_value = value.value + result[attr.name] = attr_value + return result + +SURFACE_TYPE_BITS = [ + EGL_MULTISAMPLE_RESOLVE_BOX_BIT, + EGL_PBUFFER_BIT, + EGL_PIXMAP_BIT, + EGL_SWAP_BEHAVIOR_PRESERVED_BIT, + EGL_VG_ALPHA_FORMAT_PRE_BIT, + EGL_VG_COLORSPACE_LINEAR_BIT, + EGL_WINDOW_BIT, +] +RENDERABLE_TYPE_BITS = [ + EGL_OPENGL_BIT, + EGL_OPENGL_ES_BIT, + EGL_OPENGL_ES2_BIT, + EGL_OPENVG_BIT, +] +CAVEAT_BITS = [ + EGL_NONE, + EGL_SLOW_CONFIG, + EGL_NON_CONFORMANT_CONFIG, +] +TRANSPARENT_BITS = [ + EGL_NONE, + EGL_TRANSPARENT_RGB, +] + +CONFIG_ATTRS = [ + EGL_ALPHA_SIZE, + EGL_ALPHA_MASK_SIZE, + EGL_BIND_TO_TEXTURE_RGB, + EGL_BIND_TO_TEXTURE_RGBA, + EGL_BLUE_SIZE, + EGL_BUFFER_SIZE, + EGL_COLOR_BUFFER_TYPE, + EGL_CONFIG_CAVEAT, + EGL_CONFIG_ID, + EGL_CONFORMANT, + EGL_DEPTH_SIZE, + EGL_GREEN_SIZE, + EGL_LEVEL, + EGL_LUMINANCE_SIZE, + EGL_MAX_PBUFFER_WIDTH, + EGL_MAX_PBUFFER_HEIGHT, + EGL_MAX_PBUFFER_PIXELS, + EGL_MAX_SWAP_INTERVAL, + EGL_MIN_SWAP_INTERVAL, + EGL_NATIVE_RENDERABLE, + EGL_NATIVE_VISUAL_ID, + EGL_NATIVE_VISUAL_TYPE, + EGL_RED_SIZE, + EGL_RENDERABLE_TYPE, + EGL_SAMPLE_BUFFERS, + EGL_SAMPLES, + EGL_STENCIL_SIZE, + EGL_SURFACE_TYPE, + EGL_TRANSPARENT_TYPE, + EGL_TRANSPARENT_RED_VALUE, + EGL_TRANSPARENT_GREEN_VALUE, + EGL_TRANSPARENT_BLUE_VALUE, +] + +BITMASK_FIELDS = dict([ + (EGL_SURFACE_TYPE,SURFACE_TYPE_BITS), + (EGL_RENDERABLE_TYPE,RENDERABLE_TYPE_BITS), + (EGL_CONFORMANT,RENDERABLE_TYPE_BITS), + (EGL_CONFIG_CAVEAT,CAVEAT_BITS), + (EGL_TRANSPARENT_TYPE,TRANSPARENT_BITS), +]) diff --git a/OpenGL/EGL/gbmdevice.py b/OpenGL/EGL/gbmdevice.py new file mode 100644 index 00000000..66a55467 --- /dev/null +++ b/OpenGL/EGL/gbmdevice.py @@ -0,0 +1,114 @@ +"""Utility module for interacting with GBM to select rendering device + +The base code here comes from github bug report #6 in the pyopengl +project, thanks to @abandoned-cocoon for that. +""" +import weakref, ctypes, logging, os, glob +from OpenGL.platform import ctypesloader +from OpenGL import _opaque +log = logging.getLogger(__name__) +gbm = ctypesloader.loadLibrary(ctypes.CDLL,"gbm") +__all__ = ('enumerate_devices','open_device','close_device','gbm') +_DEVICE_HANDLES = {} +GBM_BO_USE_SCANOUT = (1 << 0) +GBM_BO_USE_CURSOR = (1 << 1) +GBM_BO_USE_CURSOR_64X64 = GBM_BO_USE_CURSOR +GBM_BO_USE_RENDERING = (1 << 2) +GBM_BO_USE_WRITE = (1 << 3) +GBM_BO_USE_LINEAR = (1 << 4) + +GBMDevice = _opaque.opaque_pointer_cls('GBMDevice') +GBMSurface = _opaque.opaque_pointer_cls('GBMSurface') +gbm.gbm_create_device.restype = GBMDevice +gbm.gbm_surface_create.restype = GBMSurface + +def filter_bad_drivers(cards, bad_drivers=('nvidia',)): + """Lookup the driver for each card to exclude loading nvidia devices""" + # this is pci specific, which I suppose means we're going to fail + # if the GPU isn't on the PCI bus, but we don't seem to have + # another way to match up the card to the driver :( + bad_cards = set() + for link in glob.glob('/dev/dri/by-path/pci-*-card'): + base = os.path.basename(link) + pci_id = base[4:-5] + driver = os.path.basename(os.readlink('/sys/bus/pci/devices/%s/driver'%(pci_id,))) + if driver in bad_drivers: + card = os.path.basename(os.readlink(link)) + log.debug("Skipping %s because it uses %s driver",card,driver) + bad_cards.add(card) + filtered = [ + card for card in cards + if os.path.basename(card) not in bad_cards + ] + # assert len(filtered) == 1, filtered + return filtered + +def enumerate_devices(): + """Enumerate the set of gbm renderD* devices on the system + + Attempts to filter out any nvidia drivers with filter_bad_drivers + along the way. + """ + import glob + # gbm says card* is the correct entry point... + return filter_bad_drivers(sorted(glob.glob('/dev/dri/card*'))) +def open_device(path): + """Open a particular gbm device + + * path -- integer index of devices in sorted enumeration, or + device basename (`renderD128`) or a full path-name + as returned from enumerate_devices + + Will raise (at least): + + * RuntimeError for invalid indices + * IOError/OSError for device access failures + * RuntimeError if we cannot create the gbm device + + Caller is responsible for calling close_device(display) on the + resulting opaque pointer in order to release the open file-handle + and deallocate the gbm_device record. + + returns GBMDevice, an opaque pointer + """ + if isinstance(path,int): + try: + devices = enumerate_devices() + path = devices[int] + except IndexError: + raise RuntimeError('Only %s devices available, cannot use 0-index %s'%(len(devices),path)) + else: + path = os.path.join('/dev/dri',path) # allow for specifying "renderD128" + log.debug("Final device path: %s", path) + fh = open(path,'w') + dev = gbm.gbm_create_device(fh.fileno()) + if dev == 0: + fh.close() + raise RuntimeError('Unable to create rendering device for: %s'%(path)) + _DEVICE_HANDLES[dev] = fh + return dev +def close_device(device): + """Close an opened gbm device""" + gbm.gbm_device_destroy(device) + try: + handle = _DEVICE_HANDLES.pop(device) + handle.close() + except KeyError: + pass + +def create_surface(device, width=512, height=512, format=None, flags=GBM_BO_USE_RENDERING): + """Create a GBM surface to use on the given device + + devices -- opaque GBMDevice pointer + width,height -- dimensions + format -- EGL_NATIVE_VISUAL_ID from an EGL configuration + flags -- surface flags regarding reading/writing pattern that + is expected for the buffer + + returns GBMSurface opaque pointer + """ + if not format: + raise ValueError( + 'Use eglGetConfigAttrib(display,config,EGL_NATIVE_VISUAL_ID) to get the native surface format', + ) + return gbm.gbm_surface_create(device, width, height, format, flags) \ No newline at end of file diff --git a/OpenGL/raw/EGL/_errors.py b/OpenGL/raw/EGL/_errors.py index 06de08b4..d44dd74e 100644 --- a/OpenGL/raw/EGL/_errors.py +++ b/OpenGL/raw/EGL/_errors.py @@ -1,4 +1,4 @@ -from OpenGL.error import _ErrorChecker +from OpenGL.error import _ErrorChecker, GLError from OpenGL import platform as _p if _ErrorChecker: diff --git a/tests/gh_bug6_check.py b/tests/gh_bug6_check.py new file mode 100644 index 00000000..3a1e6ae9 --- /dev/null +++ b/tests/gh_bug6_check.py @@ -0,0 +1,30 @@ +#! /usr/bin/env python3 +import os, logging, glob, ctypes +os.environ['PYOPENGL_PLATFORM'] = 'egl' +log = logging.getLogger(__name__) +import OpenGL +from OpenGL.EGL import gbmdevice +from OpenGL.EGL import * +from OpenGL.EGL.EXT.platform_base import * +from OpenGL.EGL.MESA.platform_gbm import * + +def main(): + for device in gbmdevice.enumerate_devices(): + log.info("Checking device: %s", device) + device = gbmdevice.open_device(device) + try: + display = eglGetPlatformDisplayEXT( + EGL_PLATFORM_GBM_MESA, + device, + ctypes.c_void_p(0) + ) + if display == EGL_NO_DISPLAY: + log.error("Failed to get platform display for %s", display) + else: + log.info("Got platform display %s", display) + finally: + gbmdevice.close_device(device) + +if __name__ == "__main__": + logging.basicConfig(level=logging.DEBUG) + main() diff --git a/tests/os_egl.py b/tests/os_egl.py index 1f90f8a9..a704311b 100644 --- a/tests/os_egl.py +++ b/tests/os_egl.py @@ -1,5 +1,5 @@ from __future__ import print_function -import os, logging +import os, logging, pprint, ipdb log = logging.getLogger( __name__ ) if not os.environ.get( 'PYOPENGL_PLATFORM' ): os.environ['PYOPENGL_PLATFORM'] = 'egl' @@ -9,7 +9,11 @@ from functools import wraps from OpenGL.GL import * from OpenGL.EGL import * +from OpenGL.EGL import debug from OpenGL import arrays +from OpenGL.EGL import gbmdevice +from OpenGL.EGL.MESA import platform_gbm +from OpenGL.EGL.EXT import platform_device, platform_base, device_base API_MAP = { EGL_OPENGL_BIT:EGL_OPENGL_API, @@ -32,11 +36,35 @@ def write_ppm(buf, filename): f.write(l) f.write("\n") +def platformDisplay(device): + """Get platform display from device specifier + + device -- EGLDeviceEXT, gbm card* path, or gbm card* ordinal (index) + + returns display, created_device (or None if passed in) + raises RuntimeError if we can't create the display + """ + created_device = display = None + if isinstance(device,(str,int)): + created_device = device = gbmdevice.open_device(device) + if eglGetPlatformDisplay: + display = eglGetPlatformDisplay( + platform_device.EGL_PLATFORM_DEVICE_EXT + if isinstance(device, EGLDeviceEXT) + else platform_gbm.EGL_PLATFORM_GBM_MESA, + device, + ctypes.c_void_p(0) + ) + if display == EGL_NO_DISPLAY: + raise RuntimeError('Unable to create EGL display on %s'%(display)) + else: + raise RuntimeError('eglGetPlatformDisplay has no implementation') + return display, created_device @contextlib.contextmanager def egl_context( - width=400, - height=400, + width=256, + height=256, api=EGL_OPENGL_BIT, attributes = ( EGL_BLUE_SIZE, 8, @@ -44,60 +72,169 @@ def egl_context( EGL_GREEN_SIZE,8, EGL_DEPTH_SIZE,24, EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER, - EGL_CONFIG_CAVEAT, EGL_NONE, # Don't allow slow/non-conformant - EGL_SURFACE_TYPE, EGL_PBUFFER_BIT, + # EGL_CONFIG_CAVEAT, EGL_NONE, # Don't allow slow/non-conformant ), + pbuffer=False, + device=None, output='output.ppm', ): """Setup a context for rendering""" major,minor = GLint(), GLint() - display = eglGetDisplay(EGL_DEFAULT_DISPLAY) - if display == EGL_NO_DISPLAY: - raise RuntimeError(EGL_NO_DISPLAY, ) - # print("Display: %s"%(display.address,)) - eglInitialize( display, major, minor) - num_configs = GLint() - configs = (EGLConfig*2)() - local_attributes = list(attributes[:]) - local_attributes.extend( [ - # EGL_CONFORMANT, api, - EGL_NONE, # end of list - ]) - log.info("Attributes: %s", local_attributes) - local_attributes= arrays.GLintArray.asArray( local_attributes ) + created_device = platform_surface = surface = None + if device is None: + display = eglGetDisplay(EGL_DEFAULT_DISPLAY) + if display == EGL_NO_DISPLAY: + raise RuntimeError(EGL_NO_DISPLAY, "Could not create default display") + else: + display,created_device = platformDisplay(device) try: - eglChooseConfig(display, local_attributes, configs, 2, num_configs) - surface_attributes = [ - EGL_WIDTH,width, - EGL_HEIGHT,height, - EGL_NONE, - ] - surface = eglCreatePbufferSurface( - display, - configs[0], - surface_attributes, - ) - except GLError as err: - log.error("Error code: %s on %s", err.err, err.baseOperation) - raise - eglBindAPI(API_MAP[api]) - ctx = eglCreateContext(display, configs[0], EGL_NO_CONTEXT, None) - if ctx == EGL_NO_CONTEXT: - raise RuntimeError( 'Unable to create context' ) - eglMakeCurrent( display, surface, surface, ctx ) - yield display,ctx,surface - content = glReadPixelsub(0,0, width, height, GL_RGB, outputType=None) - if output: - write_ppm(content, output) - # eglSwapBuffers( display, surface ) + # print("Display: %s"%(display.address,)) + try: + eglInitialize( display, major, minor) + except GLError as err: + err.err = debug.eglErrorName(err.err) + log.warning("eglInitilise failure on %s: %s", display, err.err) + raise NoEGLSupport(display) + num_configs = GLint() + configs = (EGLConfig*1)() + local_attributes = list(attributes[:]) + if pbuffer: + local_attributes.extend([ + EGL_SURFACE_TYPE, EGL_PBUFFER_BIT, + ]) + else: + local_attributes.extend([ + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + ]) + local_attributes.extend( [ + EGL_CONFORMANT, api, + EGL_NONE, # end of list + ]) + log.debug("Attributes: %s", local_attributes) + local_attributes= arrays.GLintArray.asArray( local_attributes ) + try: + success = eglChooseConfig(display, local_attributes, configs, 1, num_configs) + if not success: + raise RuntimeError("Unable to complete config filtering") + if not num_configs: + configs = (EGLConfig*10)() + eglGetConfigs(display, configs, 10, num_configs) + if num_configs.value: + for config in configs[:num_configs.value]: + log.warning("Unused config: %s", pprint.pformat(debug.debug_config(display,config))) + raise RuntimeError("No compatible configs found on %s"%(device or 'default')) + # for config in configs[:num_configs.value]: + # log.debug("Config: %s",pprint.pformat(debug.debug_config(display,config))) + config = configs[0] + log.debug("Selecting config: %s", pprint.pformat(debug.debug_config(display,config))) + surface_attributes = [ + EGL_WIDTH,width, + EGL_HEIGHT,height, + EGL_NONE, + ] + if pbuffer: + surface = eglCreatePbufferSurface( + display, + configs[0], + surface_attributes, + ) + else: + visual = EGLint() + eglGetConfigAttrib(display,configs[0],EGL_NATIVE_VISUAL_ID,visual) + log.debug("Native visual id %s", visual.value) + platform_surface = gbmdevice.create_surface( + created_device, width, height, format=visual.value, + flags=gbmdevice.GBM_BO_USE_RENDERING + ) + log.debug("Native surface created on %s", device) + if not platform_surface: + raise RuntimeError("Unable to allocate a gbm surface") + log.debug("Creating GBM platform window surface") + surface = eglCreatePlatformWindowSurface( + display, configs[0], platform_surface, None + ) + if surface == EGL_NO_SURFACE: + raise RuntimeError("Platform window surface creation failure") + except GLError as err: + err.err = debug.eglErrorName(err.err) + raise + log.debug("Binding api %s", api) + eglBindAPI(API_MAP[api]) + ctx = eglCreateContext(display, configs[0], EGL_NO_CONTEXT, None) + if ctx == EGL_NO_CONTEXT: + raise RuntimeError( 'Unable to create context' ) + eglMakeCurrent( display, surface, surface, ctx ) + log.debug("Yielding to caller") + yield display,ctx,surface + log.debug("Doing context cleanup") + if not pbuffer: + # This crashes on my intel i915 device, as do glFlush and glFinish + eglSwapBuffers(display, surface) + else: + glFinish() + if output: + log.debug("Doing readpixels for writing buffer") + content = glReadPixelsub( + 0,0, + width, height, + GL_RGB, + outputType=None, + ) + write_ppm(content, output) + # glFinish() + finally: + if display: + log.debug("Unsetting current") + eglMakeCurrent( display, None, None, None ) + if surface: + eglDestroySurface(display, surface) + log.debug("Terminating display") + eglTerminate(display) + if platform_surface: + log.debug("Cleaning up gbm surface") + gbmdevice.gbm.gbm_surface_destroy(platform_surface) + if created_device: + log.debug("Closing gbm device") + gbmdevice.close_device(created_device) + +class NoEGLSupport(Exception): + """Raised if we could not initialise an egl context""" + +def debug_info(setup): + display,ctx,surface = setup + glClearColor(1.0,1.0,1.0,1.0) + glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) + log.info('Vendor: %s', glGetString(GL_VENDOR)) + log.info('Extensions: %s', glGetString(GL_EXTENSIONS)) + glFinish() + def main(): - with egl_context() as setup: - display,ctx,surface = setup - glClearColor(1.0,1.0,1.0,1.0) - glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) + # NOTE: having two different implementations here is + # likely somewhat broken due to the + # OpenGL functions having retrieved their + # function pointers during the first pass and then + # trying to run them against the second + for device in sorted(device_base.egl_get_devices(), key=lambda x: x.address): + log.info("Starting tests with: %s", device) + try: + with egl_context(device=device, pbuffer=True) as setup: + debug_info(setup) + except (NoEGLSupport): + pass + except (GLError,RuntimeError): + log.exception('Failed during: %s', device) + for device in gbmdevice.enumerate_devices(): + log.info("Starting tests with: %s", device) + try: + with egl_context(device=device, pbuffer=False) as setup: + debug_info(setup) + except (NoEGLSupport): + pass + except (GLError,RuntimeError): + log.exception('Failed during: %s', device) if __name__ == '__main__': - logging.basicConfig(level=logging.INFO) + logging.basicConfig(level=logging.DEBUG) main() From 0ed754bf6007fd6e496d70b6fd545b0cf936c950 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Mon, 30 Dec 2019 10:29:12 -0500 Subject: [PATCH 17/48] FIX for #27 to work on machines where libOpenGL is not present Apparently the advice that we should use libOpenGL really isn't universally applicable. Ubuntu 18.04 *does* seem to have it, though that might be because of an installed package. Ubuntu 19.10 does *not* have libOpenGL by default. --- OpenGL/platform/egl.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/OpenGL/platform/egl.py b/OpenGL/platform/egl.py index 1e087eb0..ff9a68e0 100644 --- a/OpenGL/platform/egl.py +++ b/OpenGL/platform/egl.py @@ -31,11 +31,15 @@ def GLES3(self): @baseplatform.lazy_property def GL(self): try: - return ctypesloader.loadLibrary( - ctypes.cdll, - 'OpenGL', - mode=ctypes.RTLD_GLOBAL - ) + for name in ('OpenGL','GL'): + lib = ctypesloader.loadLibrary( + ctypes.cdll, + 'GL', + mode=ctypes.RTLD_GLOBAL + ) + if lib: + return lib + raise OSError("No GL/OpenGL library available") except OSError: return self.GLES2 or self.GLES1 @baseplatform.lazy_property From 1f1cda472cf16a7019d43266348d4bf2a6060234 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Mon, 30 Dec 2019 10:32:28 -0500 Subject: [PATCH 18/48] Black formatting for os_egl demo/test script --- tests/os_egl.py | 176 ++++++++++++++++++++++++++---------------------- 1 file changed, 97 insertions(+), 79 deletions(-) diff --git a/tests/os_egl.py b/tests/os_egl.py index a704311b..176f6192 100644 --- a/tests/os_egl.py +++ b/tests/os_egl.py @@ -1,10 +1,11 @@ from __future__ import print_function import os, logging, pprint, ipdb -log = logging.getLogger( __name__ ) -if not os.environ.get( 'PYOPENGL_PLATFORM' ): - os.environ['PYOPENGL_PLATFORM'] = 'egl' -if 'DISPLAY' in os.environ: - del os.environ['DISPLAY'] + +log = logging.getLogger(__name__) +if not os.environ.get("PYOPENGL_PLATFORM"): + os.environ["PYOPENGL_PLATFORM"] = "egl" +if "DISPLAY" in os.environ: + del os.environ["DISPLAY"] import logging, contextlib from functools import wraps from OpenGL.GL import * @@ -16,19 +17,20 @@ from OpenGL.EGL.EXT import platform_device, platform_base, device_base API_MAP = { - EGL_OPENGL_BIT:EGL_OPENGL_API, - EGL_OPENGL_ES2_BIT:EGL_OPENGL_ES_API, - EGL_OPENGL_ES_BIT:EGL_OPENGL_ES_API, + EGL_OPENGL_BIT: EGL_OPENGL_API, + EGL_OPENGL_ES2_BIT: EGL_OPENGL_ES_API, + EGL_OPENGL_ES_BIT: EGL_OPENGL_ES_API, } + def write_ppm(buf, filename): f = open(filename, "w") if f: h, w, c = buf.shape - print( "P3", file=f) - print( "# ascii ppm file created by os_egl",file=f) - print( "%i %i" % (w, h),file=f) - print("255",file=f) + print("P3", file=f) + print("# ascii ppm file created by os_egl", file=f) + print("%i %i" % (w, h), file=f) + print("255", file=f) for y in range(h - 1, -1, -1): for x in range(w): pixel = buf[y, x] @@ -36,6 +38,7 @@ def write_ppm(buf, filename): f.write(l) f.write("\n") + def platformDisplay(device): """Get platform display from device specifier @@ -45,106 +48,124 @@ def platformDisplay(device): raises RuntimeError if we can't create the display """ created_device = display = None - if isinstance(device,(str,int)): + if isinstance(device, (str, int)): created_device = device = gbmdevice.open_device(device) if eglGetPlatformDisplay: display = eglGetPlatformDisplay( - platform_device.EGL_PLATFORM_DEVICE_EXT - if isinstance(device, EGLDeviceEXT) - else platform_gbm.EGL_PLATFORM_GBM_MESA, - device, - ctypes.c_void_p(0) + platform_device.EGL_PLATFORM_DEVICE_EXT + if isinstance(device, EGLDeviceEXT) + else platform_gbm.EGL_PLATFORM_GBM_MESA, + device, + ctypes.c_void_p(0), ) if display == EGL_NO_DISPLAY: - raise RuntimeError('Unable to create EGL display on %s'%(display)) + raise RuntimeError("Unable to create EGL display on %s" % (display)) else: - raise RuntimeError('eglGetPlatformDisplay has no implementation') + raise RuntimeError("eglGetPlatformDisplay has no implementation") return display, created_device + @contextlib.contextmanager def egl_context( width=256, - height=256, + height=256, api=EGL_OPENGL_BIT, - attributes = ( - EGL_BLUE_SIZE, 8, - EGL_RED_SIZE,8, - EGL_GREEN_SIZE,8, - EGL_DEPTH_SIZE,24, - EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER, + attributes=( + EGL_BLUE_SIZE, + 8, + EGL_RED_SIZE, + 8, + EGL_GREEN_SIZE, + 8, + EGL_DEPTH_SIZE, + 24, + EGL_COLOR_BUFFER_TYPE, + EGL_RGB_BUFFER, # EGL_CONFIG_CAVEAT, EGL_NONE, # Don't allow slow/non-conformant ), pbuffer=False, device=None, - output='output.ppm', + output="output.ppm", ): """Setup a context for rendering""" - major,minor = GLint(), GLint() + major, minor = GLint(), GLint() created_device = platform_surface = surface = None if device is None: display = eglGetDisplay(EGL_DEFAULT_DISPLAY) if display == EGL_NO_DISPLAY: raise RuntimeError(EGL_NO_DISPLAY, "Could not create default display") else: - display,created_device = platformDisplay(device) + display, created_device = platformDisplay(device) try: # print("Display: %s"%(display.address,)) try: - eglInitialize( display, major, minor) + eglInitialize(display, major, minor) except GLError as err: err.err = debug.eglErrorName(err.err) log.warning("eglInitilise failure on %s: %s", display, err.err) raise NoEGLSupport(display) num_configs = GLint() - configs = (EGLConfig*1)() + configs = (EGLConfig * 1)() local_attributes = list(attributes[:]) if pbuffer: - local_attributes.extend([ - EGL_SURFACE_TYPE, EGL_PBUFFER_BIT, - ]) + local_attributes.extend( + [EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,] + ) else: - local_attributes.extend([ - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - ]) - local_attributes.extend( [ - EGL_CONFORMANT, api, - EGL_NONE, # end of list - ]) + local_attributes.extend( + [EGL_SURFACE_TYPE, EGL_WINDOW_BIT,] + ) + local_attributes.extend( + [EGL_CONFORMANT, api, EGL_NONE,] # end of list + ) log.debug("Attributes: %s", local_attributes) - local_attributes= arrays.GLintArray.asArray( local_attributes ) + local_attributes = arrays.GLintArray.asArray(local_attributes) try: - success = eglChooseConfig(display, local_attributes, configs, 1, num_configs) + success = eglChooseConfig( + display, local_attributes, configs, 1, num_configs + ) if not success: raise RuntimeError("Unable to complete config filtering") if not num_configs: - configs = (EGLConfig*10)() + configs = (EGLConfig * 10)() eglGetConfigs(display, configs, 10, num_configs) if num_configs.value: - for config in configs[:num_configs.value]: - log.warning("Unused config: %s", pprint.pformat(debug.debug_config(display,config))) - raise RuntimeError("No compatible configs found on %s"%(device or 'default')) + for config in configs[: num_configs.value]: + log.warning( + "Unused config: %s", + pprint.pformat(debug.debug_config(display, config)), + ) + raise RuntimeError( + "No compatible configs found on %s" % (device or "default") + ) # for config in configs[:num_configs.value]: # log.debug("Config: %s",pprint.pformat(debug.debug_config(display,config))) config = configs[0] - log.debug("Selecting config: %s", pprint.pformat(debug.debug_config(display,config))) + log.debug( + "Selecting config: %s", + pprint.pformat(debug.debug_config(display, config)), + ) surface_attributes = [ - EGL_WIDTH,width, - EGL_HEIGHT,height, + EGL_WIDTH, + width, + EGL_HEIGHT, + height, EGL_NONE, ] if pbuffer: surface = eglCreatePbufferSurface( - display, - configs[0], - surface_attributes, + display, configs[0], surface_attributes, ) else: visual = EGLint() - eglGetConfigAttrib(display,configs[0],EGL_NATIVE_VISUAL_ID,visual) + eglGetConfigAttrib(display, configs[0], EGL_NATIVE_VISUAL_ID, visual) log.debug("Native visual id %s", visual.value) platform_surface = gbmdevice.create_surface( - created_device, width, height, format=visual.value, - flags=gbmdevice.GBM_BO_USE_RENDERING + created_device, + width, + height, + format=visual.value, + flags=gbmdevice.GBM_BO_USE_RENDERING, ) log.debug("Native surface created on %s", device) if not platform_surface: @@ -162,10 +183,10 @@ def egl_context( eglBindAPI(API_MAP[api]) ctx = eglCreateContext(display, configs[0], EGL_NO_CONTEXT, None) if ctx == EGL_NO_CONTEXT: - raise RuntimeError( 'Unable to create context' ) - eglMakeCurrent( display, surface, surface, ctx ) + raise RuntimeError("Unable to create context") + eglMakeCurrent(display, surface, surface, ctx) log.debug("Yielding to caller") - yield display,ctx,surface + yield display, ctx, surface log.debug("Doing context cleanup") if not pbuffer: # This crashes on my intel i915 device, as do glFlush and glFinish @@ -174,18 +195,13 @@ def egl_context( glFinish() if output: log.debug("Doing readpixels for writing buffer") - content = glReadPixelsub( - 0,0, - width, height, - GL_RGB, - outputType=None, - ) + content = glReadPixelsub(0, 0, width, height, GL_RGB, outputType=None,) write_ppm(content, output) # glFinish() finally: if display: log.debug("Unsetting current") - eglMakeCurrent( display, None, None, None ) + eglMakeCurrent(display, None, None, None) if surface: eglDestroySurface(display, surface) log.debug("Terminating display") @@ -197,21 +213,23 @@ def egl_context( log.debug("Closing gbm device") gbmdevice.close_device(created_device) + class NoEGLSupport(Exception): """Raised if we could not initialise an egl context""" + def debug_info(setup): - display,ctx,surface = setup - glClearColor(1.0,1.0,1.0,1.0) - glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) - log.info('Vendor: %s', glGetString(GL_VENDOR)) - log.info('Extensions: %s', glGetString(GL_EXTENSIONS)) + display, ctx, surface = setup + glClearColor(1.0, 1.0, 1.0, 1.0) + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) + log.info("Vendor: %s", glGetString(GL_VENDOR)) + log.info("Extensions: %s", glGetString(GL_EXTENSIONS)) glFinish() def main(): - # NOTE: having two different implementations here is - # likely somewhat broken due to the + # NOTE: having two different implementations here is + # likely somewhat broken due to the # OpenGL functions having retrieved their # function pointers during the first pass and then # trying to run them against the second @@ -222,8 +240,8 @@ def main(): debug_info(setup) except (NoEGLSupport): pass - except (GLError,RuntimeError): - log.exception('Failed during: %s', device) + except (GLError, RuntimeError): + log.exception("Failed during: %s", device) for device in gbmdevice.enumerate_devices(): log.info("Starting tests with: %s", device) try: @@ -231,10 +249,10 @@ def main(): debug_info(setup) except (NoEGLSupport): pass - except (GLError,RuntimeError): - log.exception('Failed during: %s', device) + except (GLError, RuntimeError): + log.exception("Failed during: %s", device) -if __name__ == '__main__': +if __name__ == "__main__": logging.basicConfig(level=logging.DEBUG) main() From 8628ce1131e91d430854100ac7402601a73735c6 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Mon, 30 Dec 2019 12:08:08 -0500 Subject: [PATCH 19/48] Allow ErrorCheckers to specify GLError sub-classes, use for EGLError --- OpenGL/error.py | 8 +- OpenGL/raw/EGL/_errors.py | 14 +- accelerate/src/errorchecker.c | 690 ++++++++++++++++++++++---------- accelerate/src/errorchecker.pyx | 11 +- 4 files changed, 493 insertions(+), 230 deletions(-) diff --git a/OpenGL/error.py b/OpenGL/error.py index 89ee996d..dbeb804a 100644 --- a/OpenGL/error.py +++ b/OpenGL/error.py @@ -157,7 +157,8 @@ class GLUError( Error ): class GLUTError( Error ): """GLUT error implementation class""" - +class EGLError( GLError ): + """EGL error implementation class""" if _configflags.ERROR_CHECKING: from OpenGL import acceleratesupport @@ -177,11 +178,12 @@ class _ErrorChecker( object ): _currentChecker -- currently active checking function """ _getErrors = None - def __init__( self, platform, baseOperation=None, noErrorResult=0 ): + def __init__( self, platform, baseOperation=None, noErrorResult=0, errorClass=GLError ): """Initialize from a platform module/reference""" self._isValid = platform.CurrentContextIsValid self._getErrors = baseOperation self._noErrorResult = noErrorResult + self._errorClass = errorClass if self._getErrors: if _configflags.CONTEXT_CHECKING: self._registeredChecker = self.safeGetError @@ -225,7 +227,7 @@ def glCheckError( """ err = self._currentChecker() if err != self._noErrorResult: - raise GLError( + raise self._errorClass( err, result, cArguments = cArguments, diff --git a/OpenGL/raw/EGL/_errors.py b/OpenGL/raw/EGL/_errors.py index d44dd74e..4ad7f776 100644 --- a/OpenGL/raw/EGL/_errors.py +++ b/OpenGL/raw/EGL/_errors.py @@ -1,11 +1,21 @@ -from OpenGL.error import _ErrorChecker, GLError +from OpenGL.error import _ErrorChecker, EGLError from OpenGL import platform as _p +class EGLError( EGLError ): + @property + def err(self): + from OpenGL.EGL import debug + return debug.eglErrorName(self.__dict__.get('err')) + @err.setter + def err(self, value): + self.__dict__['err'] = value + if _ErrorChecker: _error_checker = _ErrorChecker( _p.PLATFORM, _p.PLATFORM.EGL.eglGetError, - 0x3000 # EGL_SUCCESS + 0x3000, # EGL_SUCCESS, + errorClass = EGLError, ) else: _ErrorChecker = None diff --git a/accelerate/src/errorchecker.c b/accelerate/src/errorchecker.c index af3cb3b5..6d2576e1 100644 --- a/accelerate/src/errorchecker.c +++ b/accelerate/src/errorchecker.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.4 */ +/* Generated by Cython 0.29.10 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_4" -#define CYTHON_HEX_VERSION 0x001D04F0 +#define CYTHON_ABI "0_29_10" +#define CYTHON_HEX_VERSION 0x001D0AF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -310,8 +310,13 @@ #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" +#if PY_VERSION_HEX < 0x030800A4 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES @@ -346,26 +351,6 @@ #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif -#if CYTHON_USE_DICT_VERSIONS -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ - }\ - } -#else -#define __PYX_GET_DICT_VERSION(dict) (0) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); -#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) @@ -620,7 +605,8 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -835,6 +821,7 @@ struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker { int checkContext; PyObject *_isValid; PyObject *_getErrors; + PyObject *_errorClass; int _noErrorResult; }; @@ -925,6 +912,32 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) {\ @@ -1188,6 +1201,7 @@ static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_cArguments[] = "cArguments"; +static const char __pyx_k_errorClass[] = "errorClass"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_configflags[] = "_configflags"; @@ -1208,13 +1222,13 @@ static const char __pyx_k_CurrentContextIsValid[] = "CurrentContextIsValid"; static const char __pyx_k_pyx_unpickle__ErrorChecker[] = "__pyx_unpickle__ErrorChecker"; static const char __pyx_k_OpenGL_accelerate_errorchecker[] = "OpenGL_accelerate.errorchecker"; static const char __pyx_k_Cython_coded_GL_error_check_modu[] = "Cython-coded GL-error-check module"; -static const char __pyx_k_Incompatible_checksums_s_vs_0xdb[] = "Incompatible checksums (%s vs 0xdb9ff5f = (_getErrors, _isValid, _noErrorResult, checkContext, doChecks))"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xc5[] = "Incompatible checksums (%s vs 0xc56610f = (_errorClass, _getErrors, _isValid, _noErrorResult, checkContext, doChecks))"; static PyObject *__pyx_n_s_CONTEXT_CHECKING; static PyObject *__pyx_n_s_CurrentContextIsValid; static PyObject *__pyx_n_s_ERROR_CHECKING; static PyObject *__pyx_n_s_ErrorChecker; static PyObject *__pyx_n_s_GLError; -static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xdb; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xc5; static PyObject *__pyx_n_s_OpenGL; static PyObject *__pyx_n_s_OpenGL_accelerate_errorchecker; static PyObject *__pyx_n_s_OpenGL_error; @@ -1224,6 +1238,7 @@ static PyObject *__pyx_n_s_cArguments; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_configflags; static PyObject *__pyx_n_s_dict; +static PyObject *__pyx_n_s_errorClass; static PyObject *__pyx_n_s_getstate; static PyObject *__pyx_n_s_glCheckError; static PyObject *__pyx_n_s_import; @@ -1249,7 +1264,7 @@ static PyObject *__pyx_kp_s_stringsource; static PyObject *__pyx_n_s_target; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_update; -static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker___init__(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self, PyObject *__pyx_v_platform, PyObject *__pyx_v_baseOperation, PyObject *__pyx_v_noErrorResult); /* proto */ +static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker___init__(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self, PyObject *__pyx_v_platform, PyObject *__pyx_v_baseOperation, PyObject *__pyx_v_noErrorResult, PyObject *__pyx_v_errorClass); /* proto */ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_2glCheckError(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self, PyObject *__pyx_v_result, PyObject *__pyx_v_baseOperation, PyObject *__pyx_v_cArguments); /* proto */ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_4onBegin(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_target); /* proto */ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_6onEnd(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_target); /* proto */ @@ -1264,6 +1279,9 @@ static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_8_isValid static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_10_getErrors___get__(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self); /* proto */ static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_10_getErrors_2__set__(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_10_getErrors_4__del__(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass___get__(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self); /* proto */ +static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass_2__set__(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass_4__del__(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_14_noErrorResult___get__(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self); /* proto */ static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_14_noErrorResult_2__set__(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_10__reduce_cython__(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self); /* proto */ @@ -1271,15 +1289,15 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_12_ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker___pyx_unpickle__ErrorChecker(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_17OpenGL_accelerate_12errorchecker__ErrorChecker(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; -static PyObject *__pyx_int_230293343; +static PyObject *__pyx_int_206987535; static PyObject *__pyx_tuple_; static PyObject *__pyx_codeobj__2; /* Late includes */ -/* "src/errorchecker.pyx":17 +/* "src/errorchecker.pyx":18 * cdef public int _noErrorResult * - * def __init__( self, platform, baseOperation, noErrorResult=0 ): # <<<<<<<<<<<<<< + * def __init__( self, platform, baseOperation, noErrorResult=0, errorClass=None ): # <<<<<<<<<<<<<< * """Initialize from a platform module/reference""" * self._isValid = platform.CurrentContextIsValid */ @@ -1294,17 +1312,21 @@ static int __pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_1__init__ PyObject *__pyx_v_platform = 0; PyObject *__pyx_v_baseOperation = 0; PyObject *__pyx_v_noErrorResult = 0; + PyObject *__pyx_v_errorClass = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_platform,&__pyx_n_s_baseOperation,&__pyx_n_s_noErrorResult,0}; - PyObject* values[3] = {0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_platform,&__pyx_n_s_baseOperation,&__pyx_n_s_noErrorResult,&__pyx_n_s_errorClass,0}; + PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)__pyx_int_0); + values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -1323,7 +1345,7 @@ static int __pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_1__init__ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_baseOperation)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 17, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 18, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -1331,12 +1353,20 @@ static int __pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_1__init__ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_noErrorResult); if (value) { values[2] = value; kw_args--; } } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_errorClass); + if (value) { values[3] = value; kw_args--; } + } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 17, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 18, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -1348,23 +1378,24 @@ static int __pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_1__init__ __pyx_v_platform = values[0]; __pyx_v_baseOperation = values[1]; __pyx_v_noErrorResult = values[2]; + __pyx_v_errorClass = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 17, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 18, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("OpenGL_accelerate.errorchecker._ErrorChecker.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker___init__(((struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *)__pyx_v_self), __pyx_v_platform, __pyx_v_baseOperation, __pyx_v_noErrorResult); + __pyx_r = __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker___init__(((struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *)__pyx_v_self), __pyx_v_platform, __pyx_v_baseOperation, __pyx_v_noErrorResult, __pyx_v_errorClass); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker___init__(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self, PyObject *__pyx_v_platform, PyObject *__pyx_v_baseOperation, PyObject *__pyx_v_noErrorResult) { +static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker___init__(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self, PyObject *__pyx_v_platform, PyObject *__pyx_v_baseOperation, PyObject *__pyx_v_noErrorResult, PyObject *__pyx_v_errorClass) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -1374,14 +1405,14 @@ static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker___init__( int __pyx_t_5; __Pyx_RefNannySetupContext("__init__", 0); - /* "src/errorchecker.pyx":19 - * def __init__( self, platform, baseOperation, noErrorResult=0 ): + /* "src/errorchecker.pyx":20 + * def __init__( self, platform, baseOperation, noErrorResult=0, errorClass=None ): * """Initialize from a platform module/reference""" * self._isValid = platform.CurrentContextIsValid # <<<<<<<<<<<<<< * self._getErrors = baseOperation * self._noErrorResult = noErrorResult */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_platform, __pyx_n_s_CurrentContextIsValid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_platform, __pyx_n_s_CurrentContextIsValid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_isValid); @@ -1389,12 +1420,12 @@ static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker___init__( __pyx_v_self->_isValid = __pyx_t_1; __pyx_t_1 = 0; - /* "src/errorchecker.pyx":20 + /* "src/errorchecker.pyx":21 * """Initialize from a platform module/reference""" * self._isValid = platform.CurrentContextIsValid * self._getErrors = baseOperation # <<<<<<<<<<<<<< * self._noErrorResult = noErrorResult - * + * self._errorClass = errorClass */ __Pyx_INCREF(__pyx_v_baseOperation); __Pyx_GIVEREF(__pyx_v_baseOperation); @@ -1402,60 +1433,73 @@ static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker___init__( __Pyx_DECREF(__pyx_v_self->_getErrors); __pyx_v_self->_getErrors = __pyx_v_baseOperation; - /* "src/errorchecker.pyx":21 + /* "src/errorchecker.pyx":22 * self._isValid = platform.CurrentContextIsValid * self._getErrors = baseOperation * self._noErrorResult = noErrorResult # <<<<<<<<<<<<<< + * self._errorClass = errorClass * - * self.doChecks = bool( _configflags.ERROR_CHECKING and self._getErrors ) */ - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_noErrorResult); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_noErrorResult); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 22, __pyx_L1_error) __pyx_v_self->_noErrorResult = __pyx_t_2; /* "src/errorchecker.pyx":23 + * self._getErrors = baseOperation * self._noErrorResult = noErrorResult + * self._errorClass = errorClass # <<<<<<<<<<<<<< + * + * self.doChecks = bool( _configflags.ERROR_CHECKING and self._getErrors ) + */ + __Pyx_INCREF(__pyx_v_errorClass); + __Pyx_GIVEREF(__pyx_v_errorClass); + __Pyx_GOTREF(__pyx_v_self->_errorClass); + __Pyx_DECREF(__pyx_v_self->_errorClass); + __pyx_v_self->_errorClass = __pyx_v_errorClass; + + /* "src/errorchecker.pyx":25 + * self._errorClass = errorClass * * self.doChecks = bool( _configflags.ERROR_CHECKING and self._getErrors ) # <<<<<<<<<<<<<< * self.checkContext = _configflags.CONTEXT_CHECKING * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_configflags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_configflags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ERROR_CHECKING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ERROR_CHECKING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->_getErrors); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->_getErrors); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 25, __pyx_L1_error) __pyx_t_3 = __pyx_t_5; __pyx_L3_bool_binop_done:; __pyx_v_self->doChecks = (!(!__pyx_t_3)); - /* "src/errorchecker.pyx":24 + /* "src/errorchecker.pyx":26 * * self.doChecks = bool( _configflags.ERROR_CHECKING and self._getErrors ) * self.checkContext = _configflags.CONTEXT_CHECKING # <<<<<<<<<<<<<< * * def glCheckError( */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_configflags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_configflags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_CONTEXT_CHECKING); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_CONTEXT_CHECKING); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->checkContext = __pyx_t_2; - /* "src/errorchecker.pyx":17 + /* "src/errorchecker.pyx":18 * cdef public int _noErrorResult * - * def __init__( self, platform, baseOperation, noErrorResult=0 ): # <<<<<<<<<<<<<< + * def __init__( self, platform, baseOperation, noErrorResult=0, errorClass=None ): # <<<<<<<<<<<<<< * """Initialize from a platform module/reference""" * self._isValid = platform.CurrentContextIsValid */ @@ -1473,7 +1517,7 @@ static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker___init__( return __pyx_r; } -/* "src/errorchecker.pyx":26 +/* "src/errorchecker.pyx":28 * self.checkContext = _configflags.CONTEXT_CHECKING * * def glCheckError( # <<<<<<<<<<<<<< @@ -1495,7 +1539,7 @@ static PyObject *__pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_3gl static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_result,&__pyx_n_s_baseOperation,&__pyx_n_s_cArguments,0}; PyObject* values[3] = {0,0,0}; - /* "src/errorchecker.pyx":29 + /* "src/errorchecker.pyx":31 * self, * result, * baseOperation=None, # <<<<<<<<<<<<<< @@ -1504,7 +1548,7 @@ static PyObject *__pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_3gl */ values[1] = ((PyObject *)Py_None); - /* "src/errorchecker.pyx":30 + /* "src/errorchecker.pyx":32 * result, * baseOperation=None, * cArguments=None, # <<<<<<<<<<<<<< @@ -1544,7 +1588,7 @@ static PyObject *__pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_3gl } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "glCheckError") < 0)) __PYX_ERR(0, 26, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "glCheckError") < 0)) __PYX_ERR(0, 28, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -1563,7 +1607,7 @@ static PyObject *__pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_3gl } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("glCheckError", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 26, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("glCheckError", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 28, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("OpenGL_accelerate.errorchecker._ErrorChecker.glCheckError", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -1571,7 +1615,7 @@ static PyObject *__pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_3gl __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_2glCheckError(((struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *)__pyx_v_self), __pyx_v_result, __pyx_v_baseOperation, __pyx_v_cArguments); - /* "src/errorchecker.pyx":26 + /* "src/errorchecker.pyx":28 * self.checkContext = _configflags.CONTEXT_CHECKING * * def glCheckError( # <<<<<<<<<<<<<< @@ -1597,7 +1641,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_2gl int __pyx_t_6; __Pyx_RefNannySetupContext("glCheckError", 0); - /* "src/errorchecker.pyx":46 + /* "src/errorchecker.pyx":48 * """ * cdef int err * if self.doChecks: # <<<<<<<<<<<<<< @@ -1607,7 +1651,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_2gl __pyx_t_1 = (__pyx_v_self->doChecks != 0); if (__pyx_t_1) { - /* "src/errorchecker.pyx":47 + /* "src/errorchecker.pyx":49 * cdef int err * if self.doChecks: * if self.checkContext: # <<<<<<<<<<<<<< @@ -1617,7 +1661,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_2gl __pyx_t_1 = (__pyx_v_self->checkContext != 0); if (__pyx_t_1) { - /* "src/errorchecker.pyx":48 + /* "src/errorchecker.pyx":50 * if self.doChecks: * if self.checkContext: * if not self._isValid(): # <<<<<<<<<<<<<< @@ -1637,15 +1681,15 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_2gl } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = ((!__pyx_t_1) != 0); if (__pyx_t_5) { - /* "src/errorchecker.pyx":49 + /* "src/errorchecker.pyx":51 * if self.checkContext: * if not self._isValid(): * return # <<<<<<<<<<<<<< @@ -1656,7 +1700,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_2gl __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "src/errorchecker.pyx":48 + /* "src/errorchecker.pyx":50 * if self.doChecks: * if self.checkContext: * if not self._isValid(): # <<<<<<<<<<<<<< @@ -1665,7 +1709,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_2gl */ } - /* "src/errorchecker.pyx":47 + /* "src/errorchecker.pyx":49 * cdef int err * if self.doChecks: * if self.checkContext: # <<<<<<<<<<<<<< @@ -1674,12 +1718,12 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_2gl */ } - /* "src/errorchecker.pyx":50 + /* "src/errorchecker.pyx":52 * if not self._isValid(): * return * err = self._getErrors() # <<<<<<<<<<<<<< * if err != self._noErrorResult: - * from OpenGL.error import GLError + * if self._errorClass is None: */ __Pyx_INCREF(__pyx_v_self->_getErrors); __pyx_t_3 = __pyx_v_self->_getErrors; __pyx_t_4 = NULL; @@ -1694,63 +1738,96 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_2gl } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_err = __pyx_t_6; - /* "src/errorchecker.pyx":51 + /* "src/errorchecker.pyx":53 * return * err = self._getErrors() * if err != self._noErrorResult: # <<<<<<<<<<<<<< - * from OpenGL.error import GLError - * raise GLError( + * if self._errorClass is None: + * # circular import here otherwise */ __pyx_t_5 = ((__pyx_v_err != __pyx_v_self->_noErrorResult) != 0); if (__pyx_t_5) { - /* "src/errorchecker.pyx":52 + /* "src/errorchecker.pyx":54 * err = self._getErrors() * if err != self._noErrorResult: - * from OpenGL.error import GLError # <<<<<<<<<<<<<< - * raise GLError( + * if self._errorClass is None: # <<<<<<<<<<<<<< + * # circular import here otherwise + * from OpenGL.error import GLError + */ + __pyx_t_5 = (__pyx_v_self->_errorClass == Py_None); + __pyx_t_1 = (__pyx_t_5 != 0); + if (__pyx_t_1) { + + /* "src/errorchecker.pyx":56 + * if self._errorClass is None: + * # circular import here otherwise + * from OpenGL.error import GLError # <<<<<<<<<<<<<< + * self._errorClass = GLError + * raise self._errorClass( + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_GLError); + __Pyx_GIVEREF(__pyx_n_s_GLError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_GLError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_OpenGL_error, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_GLError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_GLError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/errorchecker.pyx":57 + * # circular import here otherwise + * from OpenGL.error import GLError + * self._errorClass = GLError # <<<<<<<<<<<<<< + * raise self._errorClass( * err, */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_GLError); - __Pyx_GIVEREF(__pyx_n_s_GLError); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_GLError); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_OpenGL_error, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_GLError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_2); - __pyx_v_GLError = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_GLError); + __Pyx_GIVEREF(__pyx_v_GLError); + __Pyx_GOTREF(__pyx_v_self->_errorClass); + __Pyx_DECREF(__pyx_v_self->_errorClass); + __pyx_v_self->_errorClass = __pyx_v_GLError; - /* "src/errorchecker.pyx":54 - * from OpenGL.error import GLError - * raise GLError( + /* "src/errorchecker.pyx":54 + * err = self._getErrors() + * if err != self._noErrorResult: + * if self._errorClass is None: # <<<<<<<<<<<<<< + * # circular import here otherwise + * from OpenGL.error import GLError + */ + } + + /* "src/errorchecker.pyx":59 + * self._errorClass = GLError + * raise self._errorClass( * err, # <<<<<<<<<<<<<< * result, * cArguments = cArguments, */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_err); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_err); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "src/errorchecker.pyx":53 - * if err != self._noErrorResult: - * from OpenGL.error import GLError - * raise GLError( # <<<<<<<<<<<<<< + /* "src/errorchecker.pyx":58 + * from OpenGL.error import GLError + * self._errorClass = GLError + * raise self._errorClass( # <<<<<<<<<<<<<< * err, * result, */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); @@ -1759,51 +1836,51 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_2gl PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_result); __pyx_t_3 = 0; - /* "src/errorchecker.pyx":56 + /* "src/errorchecker.pyx":61 * err, * result, * cArguments = cArguments, # <<<<<<<<<<<<<< * baseOperation = baseOperation, * ) */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_cArguments, __pyx_v_cArguments) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_cArguments, __pyx_v_cArguments) < 0) __PYX_ERR(0, 61, __pyx_L1_error) - /* "src/errorchecker.pyx":57 + /* "src/errorchecker.pyx":62 * result, * cArguments = cArguments, * baseOperation = baseOperation, # <<<<<<<<<<<<<< * ) * return result */ - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_baseOperation, __pyx_v_baseOperation) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_baseOperation, __pyx_v_baseOperation) < 0) __PYX_ERR(0, 61, __pyx_L1_error) - /* "src/errorchecker.pyx":53 - * if err != self._noErrorResult: - * from OpenGL.error import GLError - * raise GLError( # <<<<<<<<<<<<<< + /* "src/errorchecker.pyx":58 + * from OpenGL.error import GLError + * self._errorClass = GLError + * raise self._errorClass( # <<<<<<<<<<<<<< * err, * result, */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_GLError, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_self->_errorClass, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 53, __pyx_L1_error) + __PYX_ERR(0, 58, __pyx_L1_error) - /* "src/errorchecker.pyx":51 + /* "src/errorchecker.pyx":53 * return * err = self._getErrors() * if err != self._noErrorResult: # <<<<<<<<<<<<<< - * from OpenGL.error import GLError - * raise GLError( + * if self._errorClass is None: + * # circular import here otherwise */ } - /* "src/errorchecker.pyx":46 + /* "src/errorchecker.pyx":48 * """ * cdef int err * if self.doChecks: # <<<<<<<<<<<<<< @@ -1812,7 +1889,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_2gl */ } - /* "src/errorchecker.pyx":59 + /* "src/errorchecker.pyx":64 * baseOperation = baseOperation, * ) * return result # <<<<<<<<<<<<<< @@ -1824,7 +1901,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_2gl __pyx_r = __pyx_v_result; goto __pyx_L0; - /* "src/errorchecker.pyx":26 + /* "src/errorchecker.pyx":28 * self.checkContext = _configflags.CONTEXT_CHECKING * * def glCheckError( # <<<<<<<<<<<<<< @@ -1846,7 +1923,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_2gl return __pyx_r; } -/* "src/errorchecker.pyx":60 +/* "src/errorchecker.pyx":65 * ) * return result * def onBegin( self, target=None ): # <<<<<<<<<<<<<< @@ -1884,7 +1961,7 @@ static PyObject *__pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_5on } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "onBegin") < 0)) __PYX_ERR(0, 60, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "onBegin") < 0)) __PYX_ERR(0, 65, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -1898,7 +1975,7 @@ static PyObject *__pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_5on } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("onBegin", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 60, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("onBegin", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 65, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("OpenGL_accelerate.errorchecker._ErrorChecker.onBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -1916,7 +1993,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_4on __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("onBegin", 0); - /* "src/errorchecker.pyx":62 + /* "src/errorchecker.pyx":67 * def onBegin( self, target=None ): * """Called by glBegin to record the fact that glGetError won't work""" * self.doChecks = False # <<<<<<<<<<<<<< @@ -1925,7 +2002,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_4on */ __pyx_v_self->doChecks = 0; - /* "src/errorchecker.pyx":60 + /* "src/errorchecker.pyx":65 * ) * return result * def onBegin( self, target=None ): # <<<<<<<<<<<<<< @@ -1940,7 +2017,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_4on return __pyx_r; } -/* "src/errorchecker.pyx":63 +/* "src/errorchecker.pyx":68 * """Called by glBegin to record the fact that glGetError won't work""" * self.doChecks = False * def onEnd( self, target=None ): # <<<<<<<<<<<<<< @@ -1978,7 +2055,7 @@ static PyObject *__pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_7on } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "onEnd") < 0)) __PYX_ERR(0, 63, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "onEnd") < 0)) __PYX_ERR(0, 68, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -1992,7 +2069,7 @@ static PyObject *__pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_7on } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("onEnd", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 63, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("onEnd", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 68, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("OpenGL_accelerate.errorchecker._ErrorChecker.onEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2014,31 +2091,31 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_6on int __pyx_t_4; __Pyx_RefNannySetupContext("onEnd", 0); - /* "src/errorchecker.pyx":65 + /* "src/errorchecker.pyx":70 * def onEnd( self, target=None ): * """Called by glEnd to record the fact that glGetError will work""" * self.doChecks = bool( _configflags.ERROR_CHECKING and self._getErrors ) # <<<<<<<<<<<<<< * def check( self ): * return self.glCheckError( None, self._getErrors, [] ) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_configflags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_configflags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ERROR_CHECKING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ERROR_CHECKING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_getErrors); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_getErrors); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 70, __pyx_L1_error) __pyx_t_1 = __pyx_t_4; __pyx_L3_bool_binop_done:; __pyx_v_self->doChecks = (!(!__pyx_t_1)); - /* "src/errorchecker.pyx":63 + /* "src/errorchecker.pyx":68 * """Called by glBegin to record the fact that glGetError won't work""" * self.doChecks = False * def onEnd( self, target=None ): # <<<<<<<<<<<<<< @@ -2060,7 +2137,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_6on return __pyx_r; } -/* "src/errorchecker.pyx":66 +/* "src/errorchecker.pyx":71 * """Called by glEnd to record the fact that glGetError will work""" * self.doChecks = bool( _configflags.ERROR_CHECKING and self._getErrors ) * def check( self ): # <<<<<<<<<<<<<< @@ -2091,15 +2168,15 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_8ch PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("check", 0); - /* "src/errorchecker.pyx":67 + /* "src/errorchecker.pyx":72 * self.doChecks = bool( _configflags.ERROR_CHECKING and self._getErrors ) * def check( self ): * return self.glCheckError( None, self._getErrors, [] ) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_glCheckError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_glCheckError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -2116,7 +2193,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_8ch #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_4, Py_None, __pyx_v_self->_getErrors, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -2125,14 +2202,14 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_8ch #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_4, Py_None, __pyx_v_self->_getErrors, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -2146,7 +2223,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_8ch __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -2155,7 +2232,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_8ch __pyx_t_1 = 0; goto __pyx_L0; - /* "src/errorchecker.pyx":66 + /* "src/errorchecker.pyx":71 * """Called by glEnd to record the fact that glGetError will work""" * self.doChecks = bool( _configflags.ERROR_CHECKING and self._getErrors ) * def check( self ): # <<<<<<<<<<<<<< @@ -2334,7 +2411,7 @@ static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_12checkCo * cdef public int checkContext * cdef public object _isValid # <<<<<<<<<<<<<< * cdef public object _getErrors - * cdef public int _noErrorResult + * cdef public object _errorClass */ /* Python wrapper */ @@ -2428,8 +2505,8 @@ static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_8_isValid * cdef public int checkContext * cdef public object _isValid * cdef public object _getErrors # <<<<<<<<<<<<<< + * cdef public object _errorClass * cdef public int _noErrorResult - * */ /* Python wrapper */ @@ -2522,9 +2599,104 @@ static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_10_getErr /* "src/errorchecker.pyx":15 * cdef public object _isValid * cdef public object _getErrors + * cdef public object _errorClass # <<<<<<<<<<<<<< + * cdef public int _noErrorResult + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass___get__(((struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass___get__(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_errorClass); + __pyx_r = __pyx_v_self->_errorClass; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass_2__set__(((struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass_2__set__(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->_errorClass); + __Pyx_DECREF(__pyx_v_self->_errorClass); + __pyx_v_self->_errorClass = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass_4__del__(((struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass_4__del__(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_errorClass); + __Pyx_DECREF(__pyx_v_self->_errorClass); + __pyx_v_self->_errorClass = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/errorchecker.pyx":16 + * cdef public object _getErrors + * cdef public object _errorClass * cdef public int _noErrorResult # <<<<<<<<<<<<<< * - * def __init__( self, platform, baseOperation, noErrorResult=0 ): + * def __init__( self, platform, baseOperation, noErrorResult=0, errorClass=None ): */ /* Python wrapper */ @@ -2546,7 +2718,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_14_ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_noErrorResult); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_noErrorResult); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2581,7 +2753,7 @@ static int __pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_14_noErro __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 15, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L1_error) __pyx_v_self->_noErrorResult = __pyx_t_1; /* function exit code */ @@ -2632,7 +2804,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_10_ /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate - * state = (self._getErrors, self._isValid, self._noErrorResult, self.checkContext, self.doChecks) # <<<<<<<<<<<<<< + * state = (self._errorClass, self._getErrors, self._isValid, self._noErrorResult, self.checkContext, self.doChecks) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ @@ -2642,20 +2814,23 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_10_ __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->doChecks); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_self->_errorClass); + __Pyx_GIVEREF(__pyx_v_self->_errorClass); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->_errorClass); __Pyx_INCREF(__pyx_v_self->_getErrors); __Pyx_GIVEREF(__pyx_v_self->_getErrors); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->_getErrors); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->_getErrors); __Pyx_INCREF(__pyx_v_self->_isValid); __Pyx_GIVEREF(__pyx_v_self->_isValid); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->_isValid); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->_isValid); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; @@ -2664,7 +2839,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_10_ /* "(tree fragment)":6 * cdef bint use_setstate - * state = (self._getErrors, self._isValid, self._noErrorResult, self.checkContext, self.doChecks) + * state = (self._errorClass, self._getErrors, self._isValid, self._noErrorResult, self.checkContext, self.doChecks) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) @@ -2675,7 +2850,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_10_ __pyx_t_4 = 0; /* "(tree fragment)":7 - * state = (self._getErrors, self._isValid, self._noErrorResult, self.checkContext, self.doChecks) + * state = (self._errorClass, self._getErrors, self._isValid, self._noErrorResult, self.checkContext, self.doChecks) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) @@ -2708,12 +2883,12 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_10_ * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: - * use_setstate = self._getErrors is not None or self._isValid is not None + * use_setstate = self._errorClass is not None or self._getErrors is not None or self._isValid is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 - * state = (self._getErrors, self._isValid, self._noErrorResult, self.checkContext, self.doChecks) + * state = (self._errorClass, self._getErrors, self._isValid, self._noErrorResult, self.checkContext, self.doChecks) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) @@ -2725,21 +2900,28 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_10_ /* "(tree fragment)":11 * use_setstate = True * else: - * use_setstate = self._getErrors is not None or self._isValid is not None # <<<<<<<<<<<<<< + * use_setstate = self._errorClass is not None or self._getErrors is not None or self._isValid is not None # <<<<<<<<<<<<<< * if use_setstate: - * return __pyx_unpickle__ErrorChecker, (type(self), 0xdb9ff5f, None), state + * return __pyx_unpickle__ErrorChecker, (type(self), 0xc56610f, None), state */ /*else*/ { - __pyx_t_5 = (__pyx_v_self->_getErrors != Py_None); + __pyx_t_5 = (__pyx_v_self->_errorClass != Py_None); __pyx_t_7 = (__pyx_t_5 != 0); if (!__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } - __pyx_t_7 = (__pyx_v_self->_isValid != Py_None); + __pyx_t_7 = (__pyx_v_self->_getErrors != Py_None); __pyx_t_5 = (__pyx_t_7 != 0); - __pyx_t_6 = __pyx_t_5; + if (!__pyx_t_5) { + } else { + __pyx_t_6 = __pyx_t_5; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_5 = (__pyx_v_self->_isValid != Py_None); + __pyx_t_7 = (__pyx_t_5 != 0); + __pyx_t_6 = __pyx_t_7; __pyx_L4_bool_binop_done:; __pyx_v_use_setstate = __pyx_t_6; } @@ -2747,20 +2929,20 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_10_ /* "(tree fragment)":12 * else: - * use_setstate = self._getErrors is not None or self._isValid is not None + * use_setstate = self._errorClass is not None or self._getErrors is not None or self._isValid is not None * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle__ErrorChecker, (type(self), 0xdb9ff5f, None), state + * return __pyx_unpickle__ErrorChecker, (type(self), 0xc56610f, None), state * else: */ __pyx_t_6 = (__pyx_v_use_setstate != 0); if (__pyx_t_6) { /* "(tree fragment)":13 - * use_setstate = self._getErrors is not None or self._isValid is not None + * use_setstate = self._errorClass is not None or self._getErrors is not None or self._isValid is not None * if use_setstate: - * return __pyx_unpickle__ErrorChecker, (type(self), 0xdb9ff5f, None), state # <<<<<<<<<<<<<< + * return __pyx_unpickle__ErrorChecker, (type(self), 0xc56610f, None), state # <<<<<<<<<<<<<< * else: - * return __pyx_unpickle__ErrorChecker, (type(self), 0xdb9ff5f, state) + * return __pyx_unpickle__ErrorChecker, (type(self), 0xc56610f, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle__ErrorChecker); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) @@ -2770,9 +2952,9 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_10_ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_230293343); - __Pyx_GIVEREF(__pyx_int_230293343); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_230293343); + __Pyx_INCREF(__pyx_int_206987535); + __Pyx_GIVEREF(__pyx_int_206987535); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_206987535); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None); @@ -2793,17 +2975,17 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_10_ /* "(tree fragment)":12 * else: - * use_setstate = self._getErrors is not None or self._isValid is not None + * use_setstate = self._errorClass is not None or self._getErrors is not None or self._isValid is not None * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle__ErrorChecker, (type(self), 0xdb9ff5f, None), state + * return __pyx_unpickle__ErrorChecker, (type(self), 0xc56610f, None), state * else: */ } /* "(tree fragment)":15 - * return __pyx_unpickle__ErrorChecker, (type(self), 0xdb9ff5f, None), state + * return __pyx_unpickle__ErrorChecker, (type(self), 0xc56610f, None), state * else: - * return __pyx_unpickle__ErrorChecker, (type(self), 0xdb9ff5f, state) # <<<<<<<<<<<<<< + * return __pyx_unpickle__ErrorChecker, (type(self), 0xc56610f, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle__ErrorChecker__set_state(self, __pyx_state) */ @@ -2816,9 +2998,9 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_10_ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_230293343); - __Pyx_GIVEREF(__pyx_int_230293343); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_230293343); + __Pyx_INCREF(__pyx_int_206987535); + __Pyx_GIVEREF(__pyx_int_206987535); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_206987535); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state); @@ -2859,7 +3041,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_10_ /* "(tree fragment)":16 * else: - * return __pyx_unpickle__ErrorChecker, (type(self), 0xdb9ff5f, state) + * return __pyx_unpickle__ErrorChecker, (type(self), 0xc56610f, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle__ErrorChecker__set_state(self, __pyx_state) */ @@ -2884,7 +3066,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_12_ __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":17 - * return __pyx_unpickle__ErrorChecker, (type(self), 0xdb9ff5f, state) + * return __pyx_unpickle__ErrorChecker, (type(self), 0xc56610f, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle__ErrorChecker__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ @@ -2895,7 +3077,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_12_ /* "(tree fragment)":16 * else: - * return __pyx_unpickle__ErrorChecker, (type(self), 0xdb9ff5f, state) + * return __pyx_unpickle__ErrorChecker, (type(self), 0xc56610f, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle__ErrorChecker__set_state(self, __pyx_state) */ @@ -3008,18 +3190,18 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Err /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result - * if __pyx_checksum != 0xdb9ff5f: # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xc56610f: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xdb9ff5f = (_getErrors, _isValid, _noErrorResult, checkContext, doChecks))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xc56610f = (_errorClass, _getErrors, _isValid, _noErrorResult, checkContext, doChecks))" % __pyx_checksum) */ - __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xdb9ff5f) != 0); + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xc56610f) != 0); if (__pyx_t_1) { /* "(tree fragment)":5 * cdef object __pyx_result - * if __pyx_checksum != 0xdb9ff5f: + * if __pyx_checksum != 0xc56610f: * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xdb9ff5f = (_getErrors, _isValid, _noErrorResult, checkContext, doChecks))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xc56610f = (_errorClass, _getErrors, _isValid, _noErrorResult, checkContext, doChecks))" % __pyx_checksum) * __pyx_result = _ErrorChecker.__new__(__pyx_type) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) @@ -3038,15 +3220,15 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Err __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 - * if __pyx_checksum != 0xdb9ff5f: + * if __pyx_checksum != 0xc56610f: * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xdb9ff5f = (_getErrors, _isValid, _noErrorResult, checkContext, doChecks))" % __pyx_checksum) # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xc56610f = (_errorClass, _getErrors, _isValid, _noErrorResult, checkContext, doChecks))" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = _ErrorChecker.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xdb, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xc5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); @@ -3073,15 +3255,15 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Err /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result - * if __pyx_checksum != 0xdb9ff5f: # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xc56610f: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xdb9ff5f = (_getErrors, _isValid, _noErrorResult, checkContext, doChecks))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xc56610f = (_errorClass, _getErrors, _isValid, _noErrorResult, checkContext, doChecks))" % __pyx_checksum) */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xdb9ff5f = (_getErrors, _isValid, _noErrorResult, checkContext, doChecks))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xc56610f = (_errorClass, _getErrors, _isValid, _noErrorResult, checkContext, doChecks))" % __pyx_checksum) * __pyx_result = _ErrorChecker.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle__ErrorChecker__set_state(<_ErrorChecker> __pyx_result, __pyx_state) @@ -3107,7 +3289,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Err __pyx_t_3 = 0; /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xdb9ff5f = (_getErrors, _isValid, _noErrorResult, checkContext, doChecks))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xc56610f = (_errorClass, _getErrors, _isValid, _noErrorResult, checkContext, doChecks))" % __pyx_checksum) * __pyx_result = _ErrorChecker.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle__ErrorChecker__set_state(<_ErrorChecker> __pyx_result, __pyx_state) @@ -3130,7 +3312,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Err __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0xdb9ff5f = (_getErrors, _isValid, _noErrorResult, checkContext, doChecks))" % __pyx_checksum) + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xc56610f = (_errorClass, _getErrors, _isValid, _noErrorResult, checkContext, doChecks))" % __pyx_checksum) * __pyx_result = _ErrorChecker.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle__ErrorChecker__set_state(<_ErrorChecker> __pyx_result, __pyx_state) @@ -3143,7 +3325,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Err * __pyx_unpickle__ErrorChecker__set_state(<_ErrorChecker> __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle__ErrorChecker__set_state(_ErrorChecker __pyx_result, tuple __pyx_state): - * __pyx_result._getErrors = __pyx_state[0]; __pyx_result._isValid = __pyx_state[1]; __pyx_result._noErrorResult = __pyx_state[2]; __pyx_result.checkContext = __pyx_state[3]; __pyx_result.doChecks = __pyx_state[4] + * __pyx_result._errorClass = __pyx_state[0]; __pyx_result._getErrors = __pyx_state[1]; __pyx_result._isValid = __pyx_state[2]; __pyx_result._noErrorResult = __pyx_state[3]; __pyx_result.checkContext = __pyx_state[4]; __pyx_result.doChecks = __pyx_state[5] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); @@ -3176,8 +3358,8 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Err * __pyx_unpickle__ErrorChecker__set_state(<_ErrorChecker> __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle__ErrorChecker__set_state(_ErrorChecker __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._getErrors = __pyx_state[0]; __pyx_result._isValid = __pyx_state[1]; __pyx_result._noErrorResult = __pyx_state[2]; __pyx_result.checkContext = __pyx_state[3]; __pyx_result.doChecks = __pyx_state[4] - * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): + * __pyx_result._errorClass = __pyx_state[0]; __pyx_result._getErrors = __pyx_state[1]; __pyx_result._isValid = __pyx_state[2]; __pyx_result._noErrorResult = __pyx_state[3]; __pyx_result.checkContext = __pyx_state[4]; __pyx_result.doChecks = __pyx_state[5] + * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_17OpenGL_accelerate_12errorchecker___pyx_unpickle__ErrorChecker__set_state(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { @@ -3197,9 +3379,9 @@ static PyObject *__pyx_f_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Erro /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle__ErrorChecker__set_state(_ErrorChecker __pyx_result, tuple __pyx_state): - * __pyx_result._getErrors = __pyx_state[0]; __pyx_result._isValid = __pyx_state[1]; __pyx_result._noErrorResult = __pyx_state[2]; __pyx_result.checkContext = __pyx_state[3]; __pyx_result.doChecks = __pyx_state[4] # <<<<<<<<<<<<<< - * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[5]) + * __pyx_result._errorClass = __pyx_state[0]; __pyx_result._getErrors = __pyx_state[1]; __pyx_result._isValid = __pyx_state[2]; __pyx_result._noErrorResult = __pyx_state[3]; __pyx_result.checkContext = __pyx_state[4]; __pyx_result.doChecks = __pyx_state[5] # <<<<<<<<<<<<<< + * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[6]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); @@ -3208,6 +3390,17 @@ static PyObject *__pyx_f_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Erro __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v___pyx_result->_errorClass); + __Pyx_DECREF(__pyx_v___pyx_result->_errorClass); + __pyx_v___pyx_result->_errorClass = __pyx_t_1; + __pyx_t_1 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 12, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_getErrors); __Pyx_DECREF(__pyx_v___pyx_result->_getErrors); __pyx_v___pyx_result->_getErrors = __pyx_t_1; @@ -3216,7 +3409,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Erro PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->_isValid); @@ -3227,7 +3420,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Erro PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3236,7 +3429,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Erro PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3245,7 +3438,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Erro PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3253,16 +3446,16 @@ static PyObject *__pyx_f_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Erro /* "(tree fragment)":13 * cdef __pyx_unpickle__ErrorChecker__set_state(_ErrorChecker __pyx_result, tuple __pyx_state): - * __pyx_result._getErrors = __pyx_state[0]; __pyx_result._isValid = __pyx_state[1]; __pyx_result._noErrorResult = __pyx_state[2]; __pyx_result.checkContext = __pyx_state[3]; __pyx_result.doChecks = __pyx_state[4] - * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[5]) + * __pyx_result._errorClass = __pyx_state[0]; __pyx_result._getErrors = __pyx_state[1]; __pyx_result._isValid = __pyx_state[2]; __pyx_result._noErrorResult = __pyx_state[3]; __pyx_result.checkContext = __pyx_state[4]; __pyx_result.doChecks = __pyx_state[5] + * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[6]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 13, __pyx_L1_error) } __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_5 = ((__pyx_t_4 > 5) != 0); + __pyx_t_5 = ((__pyx_t_4 > 6) != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; @@ -3275,9 +3468,9 @@ static PyObject *__pyx_f_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Erro if (__pyx_t_3) { /* "(tree fragment)":14 - * __pyx_result._getErrors = __pyx_state[0]; __pyx_result._isValid = __pyx_state[1]; __pyx_result._noErrorResult = __pyx_state[2]; __pyx_result.checkContext = __pyx_state[3]; __pyx_result.doChecks = __pyx_state[4] - * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[5]) # <<<<<<<<<<<<<< + * __pyx_result._errorClass = __pyx_state[0]; __pyx_result._getErrors = __pyx_state[1]; __pyx_result._isValid = __pyx_state[2]; __pyx_result._noErrorResult = __pyx_state[3]; __pyx_result.checkContext = __pyx_state[4]; __pyx_result.doChecks = __pyx_state[5] + * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[6]) # <<<<<<<<<<<<<< */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); @@ -3288,7 +3481,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Erro PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 14, __pyx_L1_error) } - __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { @@ -3310,9 +3503,9 @@ static PyObject *__pyx_f_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Erro /* "(tree fragment)":13 * cdef __pyx_unpickle__ErrorChecker__set_state(_ErrorChecker __pyx_result, tuple __pyx_state): - * __pyx_result._getErrors = __pyx_state[0]; __pyx_result._isValid = __pyx_state[1]; __pyx_result._noErrorResult = __pyx_state[2]; __pyx_result.checkContext = __pyx_state[3]; __pyx_result.doChecks = __pyx_state[4] - * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[5]) + * __pyx_result._errorClass = __pyx_state[0]; __pyx_result._getErrors = __pyx_state[1]; __pyx_result._isValid = __pyx_state[2]; __pyx_result._noErrorResult = __pyx_state[3]; __pyx_result.checkContext = __pyx_state[4]; __pyx_result.doChecks = __pyx_state[5] + * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[6]) */ } @@ -3320,8 +3513,8 @@ static PyObject *__pyx_f_17OpenGL_accelerate_12errorchecker___pyx_unpickle__Erro * __pyx_unpickle__ErrorChecker__set_state(<_ErrorChecker> __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle__ErrorChecker__set_state(_ErrorChecker __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._getErrors = __pyx_state[0]; __pyx_result._isValid = __pyx_state[1]; __pyx_result._noErrorResult = __pyx_state[2]; __pyx_result.checkContext = __pyx_state[3]; __pyx_result.doChecks = __pyx_state[4] - * if len(__pyx_state) > 5 and hasattr(__pyx_result, '__dict__'): + * __pyx_result._errorClass = __pyx_state[0]; __pyx_result._getErrors = __pyx_state[1]; __pyx_result._isValid = __pyx_state[2]; __pyx_result._noErrorResult = __pyx_state[3]; __pyx_result.checkContext = __pyx_state[4]; __pyx_result.doChecks = __pyx_state[5] + * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ @@ -3352,6 +3545,7 @@ static PyObject *__pyx_tp_new_17OpenGL_accelerate_12errorchecker__ErrorChecker(P p = ((struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker *)o); p->_isValid = Py_None; Py_INCREF(Py_None); p->_getErrors = Py_None; Py_INCREF(Py_None); + p->_errorClass = Py_None; Py_INCREF(Py_None); return o; } @@ -3365,6 +3559,7 @@ static void __pyx_tp_dealloc_17OpenGL_accelerate_12errorchecker__ErrorChecker(Py PyObject_GC_UnTrack(o); Py_CLEAR(p->_isValid); Py_CLEAR(p->_getErrors); + Py_CLEAR(p->_errorClass); (*Py_TYPE(o)->tp_free)(o); } @@ -3377,6 +3572,9 @@ static int __pyx_tp_traverse_17OpenGL_accelerate_12errorchecker__ErrorChecker(Py if (p->_getErrors) { e = (*v)(p->_getErrors, a); if (e) return e; } + if (p->_errorClass) { + e = (*v)(p->_errorClass, a); if (e) return e; + } return 0; } @@ -3389,6 +3587,9 @@ static int __pyx_tp_clear_17OpenGL_accelerate_12errorchecker__ErrorChecker(PyObj tmp = ((PyObject*)p->_getErrors); p->_getErrors = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); + tmp = ((PyObject*)p->_errorClass); + p->_errorClass = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); return 0; } @@ -3446,6 +3647,19 @@ static int __pyx_setprop_17OpenGL_accelerate_12errorchecker_13_ErrorChecker__get } } +static PyObject *__pyx_getprop_17OpenGL_accelerate_12errorchecker_13_ErrorChecker__errorClass(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass_1__get__(o); +} + +static int __pyx_setprop_17OpenGL_accelerate_12errorchecker_13_ErrorChecker__errorClass(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass_3__set__(o, v); + } + else { + return __pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_11_errorClass_5__del__(o); + } +} + static PyObject *__pyx_getprop_17OpenGL_accelerate_12errorchecker_13_ErrorChecker__noErrorResult(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_14_noErrorResult_1__get__(o); } @@ -3475,6 +3689,7 @@ static struct PyGetSetDef __pyx_getsets_17OpenGL_accelerate_12errorchecker__Erro {(char *)"checkContext", __pyx_getprop_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_checkContext, __pyx_setprop_17OpenGL_accelerate_12errorchecker_13_ErrorChecker_checkContext, (char *)0, 0}, {(char *)"_isValid", __pyx_getprop_17OpenGL_accelerate_12errorchecker_13_ErrorChecker__isValid, __pyx_setprop_17OpenGL_accelerate_12errorchecker_13_ErrorChecker__isValid, (char *)0, 0}, {(char *)"_getErrors", __pyx_getprop_17OpenGL_accelerate_12errorchecker_13_ErrorChecker__getErrors, __pyx_setprop_17OpenGL_accelerate_12errorchecker_13_ErrorChecker__getErrors, (char *)0, 0}, + {(char *)"_errorClass", __pyx_getprop_17OpenGL_accelerate_12errorchecker_13_ErrorChecker__errorClass, __pyx_setprop_17OpenGL_accelerate_12errorchecker_13_ErrorChecker__errorClass, (char *)0, 0}, {(char *)"_noErrorResult", __pyx_getprop_17OpenGL_accelerate_12errorchecker_13_ErrorChecker__noErrorResult, __pyx_setprop_17OpenGL_accelerate_12errorchecker_13_ErrorChecker__noErrorResult, (char *)0, 0}, {0, 0, 0, 0, 0} }; @@ -3535,6 +3750,9 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_12errorchecker__ErrorChecker #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif }; static PyMethodDef __pyx_methods[] = { @@ -3588,7 +3806,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_ERROR_CHECKING, __pyx_k_ERROR_CHECKING, sizeof(__pyx_k_ERROR_CHECKING), 0, 0, 1, 1}, {&__pyx_n_s_ErrorChecker, __pyx_k_ErrorChecker, sizeof(__pyx_k_ErrorChecker), 0, 0, 1, 1}, {&__pyx_n_s_GLError, __pyx_k_GLError, sizeof(__pyx_k_GLError), 0, 0, 1, 1}, - {&__pyx_kp_s_Incompatible_checksums_s_vs_0xdb, __pyx_k_Incompatible_checksums_s_vs_0xdb, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xdb), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0xc5, __pyx_k_Incompatible_checksums_s_vs_0xc5, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xc5), 0, 0, 1, 0}, {&__pyx_n_s_OpenGL, __pyx_k_OpenGL, sizeof(__pyx_k_OpenGL), 0, 0, 1, 1}, {&__pyx_n_s_OpenGL_accelerate_errorchecker, __pyx_k_OpenGL_accelerate_errorchecker, sizeof(__pyx_k_OpenGL_accelerate_errorchecker), 0, 0, 1, 1}, {&__pyx_n_s_OpenGL_error, __pyx_k_OpenGL_error, sizeof(__pyx_k_OpenGL_error), 0, 0, 1, 1}, @@ -3598,6 +3816,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_configflags, __pyx_k_configflags, sizeof(__pyx_k_configflags), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_errorClass, __pyx_k_errorClass, sizeof(__pyx_k_errorClass), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_glCheckError, __pyx_k_glCheckError, sizeof(__pyx_k_glCheckError), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, @@ -3652,7 +3871,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_230293343 = PyInt_FromLong(230293343L); if (unlikely(!__pyx_int_230293343)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_206987535 = PyInt_FromLong(206987535L); if (unlikely(!__pyx_int_206987535)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -3695,7 +3914,9 @@ static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_12errorchecker__ErrorChecker) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_12errorchecker__ErrorChecker.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_12errorchecker__ErrorChecker.tp_dictoffset && __pyx_type_17OpenGL_accelerate_12errorchecker__ErrorChecker.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_12errorchecker__ErrorChecker.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -3904,10 +4125,9 @@ if (!__Pyx_RefNanny) { __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); - #endif + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -4195,6 +4415,32 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { return result; } +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) diff --git a/accelerate/src/errorchecker.pyx b/accelerate/src/errorchecker.pyx index 15b233fb..2ed72af3 100644 --- a/accelerate/src/errorchecker.pyx +++ b/accelerate/src/errorchecker.pyx @@ -12,13 +12,15 @@ cdef class _ErrorChecker: cdef public int checkContext cdef public object _isValid cdef public object _getErrors + cdef public object _errorClass cdef public int _noErrorResult - def __init__( self, platform, baseOperation, noErrorResult=0 ): + def __init__( self, platform, baseOperation, noErrorResult=0, errorClass=None ): """Initialize from a platform module/reference""" self._isValid = platform.CurrentContextIsValid self._getErrors = baseOperation self._noErrorResult = noErrorResult + self._errorClass = errorClass self.doChecks = bool( _configflags.ERROR_CHECKING and self._getErrors ) self.checkContext = _configflags.CONTEXT_CHECKING @@ -49,8 +51,11 @@ cdef class _ErrorChecker: return err = self._getErrors() if err != self._noErrorResult: - from OpenGL.error import GLError - raise GLError( + if self._errorClass is None: + # circular import here otherwise + from OpenGL.error import GLError + self._errorClass = GLError + raise self._errorClass( err, result, cArguments = cArguments, From 9640630b37f46a52d2e4318b7f903b832a7f32e6 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Mon, 30 Dec 2019 12:08:42 -0500 Subject: [PATCH 20/48] Fix latebind __bool__ definition as __nonzero__ isn't available --- accelerate/src/latebind.c | 464 ++++++++++++++++++++++++++++-------- accelerate/src/latebind.pyx | 4 +- 2 files changed, 371 insertions(+), 97 deletions(-) diff --git a/accelerate/src/latebind.c b/accelerate/src/latebind.c index 87d69078..e8edce4f 100644 --- a/accelerate/src/latebind.c +++ b/accelerate/src/latebind.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.4 */ +/* Generated by Cython 0.29.10 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_4" -#define CYTHON_HEX_VERSION 0x001D04F0 +#define CYTHON_ABI "0_29_10" +#define CYTHON_HEX_VERSION 0x001D0AF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -310,8 +310,13 @@ #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" +#if PY_VERSION_HEX < 0x030800A4 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES @@ -346,26 +351,6 @@ #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif -#if CYTHON_USE_DICT_VERSIONS -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ - }\ - } -#else -#define __PYX_GET_DICT_VERSION(dict) (0) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); -#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) @@ -620,7 +605,8 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -836,7 +822,7 @@ struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind { }; -/* "src/latebind.pyx":34 +/* "src/latebind.pyx":41 * return self._finalCall( *args, **named ) * * cdef class Curry(object): # <<<<<<<<<<<<<< @@ -1029,6 +1015,32 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject * /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) {\ @@ -1201,6 +1213,7 @@ static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_baseFunction[] = "baseFunction"; +static const char __pyx_k_getFinalCall[] = "getFinalCall"; static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_stringsource[] = "stringsource"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; @@ -1224,6 +1237,7 @@ static PyObject *__pyx_n_s_baseFunction; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_finalise; +static PyObject *__pyx_n_s_getFinalCall; static PyObject *__pyx_n_s_getstate; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_main; @@ -1248,10 +1262,12 @@ static PyObject *__pyx_n_s_update; static PyObject *__pyx_n_s_wrapperFunction; static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_setFinalCall(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self, PyObject *__pyx_v_finalCall); /* proto */ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_2finalise(CYTHON_UNUSED struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_4getFinalCall(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_6__call__(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_named); /* proto */ -static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_8__reduce_cython__(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_10__setstate_cython__(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_4__nonzero__(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self); /* proto */ +static int __pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_6__bool__(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_8getFinalCall(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_10__call__(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_named); /* proto */ +static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_12__reduce_cython__(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_14__setstate_cython__(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_17OpenGL_accelerate_8latebind_5Curry___init__(struct __pyx_obj_17OpenGL_accelerate_8latebind_Curry *__pyx_v_self, PyObject *__pyx_v_wrapperFunction, PyObject *__pyx_v_baseFunction); /* proto */ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_5Curry_2__call__(struct __pyx_obj_17OpenGL_accelerate_8latebind_Curry *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_named); /* proto */ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_5Curry_4__reduce_cython__(struct __pyx_obj_17OpenGL_accelerate_8latebind_Curry *__pyx_v_self); /* proto */ @@ -1360,26 +1376,184 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_2finalise(CYTH /* "src/latebind.pyx":17 * """Finalise our target to our final callable object""" * + * def __nonzero__(self): # <<<<<<<<<<<<<< + * """Resolve our final call and check for empty/nonzero on it""" + * return bool(self.getFinalCall()) + */ + +/* Python wrapper */ +static int __pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_5__nonzero__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_5__nonzero__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); + __pyx_r = __pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_4__nonzero__(((struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_4__nonzero__(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__nonzero__", 0); + + /* "src/latebind.pyx":19 + * def __nonzero__(self): + * """Resolve our final call and check for empty/nonzero on it""" + * return bool(self.getFinalCall()) # <<<<<<<<<<<<<< + * def __bool__(self): + * """Resolve our final call and check for empty/nonzero on it""" + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getFinalCall); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = (!(!__pyx_t_4)); + goto __pyx_L0; + + /* "src/latebind.pyx":17 + * """Finalise our target to our final callable object""" + * + * def __nonzero__(self): # <<<<<<<<<<<<<< + * """Resolve our final call and check for empty/nonzero on it""" + * return bool(self.getFinalCall()) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("OpenGL_accelerate.latebind.LateBind.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/latebind.pyx":20 + * """Resolve our final call and check for empty/nonzero on it""" + * return bool(self.getFinalCall()) + * def __bool__(self): # <<<<<<<<<<<<<< + * """Resolve our final call and check for empty/nonzero on it""" + * return bool(self.getFinalCall()) + */ + +/* Python wrapper */ +static int __pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_7__bool__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_7__bool__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__bool__ (wrapper)", 0); + __pyx_r = __pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_6__bool__(((struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_6__bool__(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__bool__", 0); + + /* "src/latebind.pyx":22 + * def __bool__(self): + * """Resolve our final call and check for empty/nonzero on it""" + * return bool(self.getFinalCall()) # <<<<<<<<<<<<<< + * + * def getFinalCall( self ): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getFinalCall); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = (!(!__pyx_t_4)); + goto __pyx_L0; + + /* "src/latebind.pyx":20 + * """Resolve our final call and check for empty/nonzero on it""" + * return bool(self.getFinalCall()) + * def __bool__(self): # <<<<<<<<<<<<<< + * """Resolve our final call and check for empty/nonzero on it""" + * return bool(self.getFinalCall()) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("OpenGL_accelerate.latebind.LateBind.__bool__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/latebind.pyx":24 + * return bool(self.getFinalCall()) + * * def getFinalCall( self ): # <<<<<<<<<<<<<< * """Retrieve and/or bind and retrieve final call""" * if not self._finalCall: */ /* Python wrapper */ -static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_5getFinalCall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_17OpenGL_accelerate_8latebind_8LateBind_4getFinalCall[] = "Retrieve and/or bind and retrieve final call"; -static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_5getFinalCall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_9getFinalCall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_17OpenGL_accelerate_8latebind_8LateBind_8getFinalCall[] = "Retrieve and/or bind and retrieve final call"; +static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_9getFinalCall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFinalCall (wrapper)", 0); - __pyx_r = __pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_4getFinalCall(((struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *)__pyx_v_self)); + __pyx_r = __pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_8getFinalCall(((struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_4getFinalCall(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self) { +static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_8getFinalCall(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -1389,25 +1563,25 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_4getFinalCall( PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("getFinalCall", 0); - /* "src/latebind.pyx":19 + /* "src/latebind.pyx":26 * def getFinalCall( self ): * """Retrieve and/or bind and retrieve final call""" * if not self._finalCall: # <<<<<<<<<<<<<< * self._finalCall = self.finalise() * return self._finalCall */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_finalCall); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 19, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_finalCall); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 26, __pyx_L1_error) __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { - /* "src/latebind.pyx":20 + /* "src/latebind.pyx":27 * """Retrieve and/or bind and retrieve final call""" * if not self._finalCall: * self._finalCall = self.finalise() # <<<<<<<<<<<<<< * return self._finalCall * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_finalise); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_finalise); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -1421,7 +1595,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_4getFinalCall( } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_3); @@ -1430,7 +1604,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_4getFinalCall( __pyx_v_self->_finalCall = __pyx_t_3; __pyx_t_3 = 0; - /* "src/latebind.pyx":19 + /* "src/latebind.pyx":26 * def getFinalCall( self ): * """Retrieve and/or bind and retrieve final call""" * if not self._finalCall: # <<<<<<<<<<<<<< @@ -1439,7 +1613,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_4getFinalCall( */ } - /* "src/latebind.pyx":21 + /* "src/latebind.pyx":28 * if not self._finalCall: * self._finalCall = self.finalise() * return self._finalCall # <<<<<<<<<<<<<< @@ -1451,8 +1625,8 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_4getFinalCall( __pyx_r = __pyx_v_self->_finalCall; goto __pyx_L0; - /* "src/latebind.pyx":17 - * """Finalise our target to our final callable object""" + /* "src/latebind.pyx":24 + * return bool(self.getFinalCall()) * * def getFinalCall( self ): # <<<<<<<<<<<<<< * """Retrieve and/or bind and retrieve final call""" @@ -1472,7 +1646,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_4getFinalCall( return __pyx_r; } -/* "src/latebind.pyx":23 +/* "src/latebind.pyx":30 * return self._finalCall * * def __call__( self, *args, **named ): # <<<<<<<<<<<<<< @@ -1481,12 +1655,12 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_4getFinalCall( */ /* Python wrapper */ -static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_17OpenGL_accelerate_8latebind_8LateBind_6__call__[] = "Call self._finalCall, calling finalise() first if not already called\n\n There's actually *no* reason to unpack and repack the arguments,\n but unfortunately I don't know of a Cython syntax to specify\n that.\n "; +static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_11__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_17OpenGL_accelerate_8latebind_8LateBind_10__call__[] = "Call self._finalCall, calling finalise() first if not already called\n\n There's actually *no* reason to unpack and repack the arguments,\n but unfortunately I don't know of a Cython syntax to specify\n that.\n "; #if CYTHON_COMPILING_IN_CPYTHON -struct wrapperbase __pyx_wrapperbase_17OpenGL_accelerate_8latebind_8LateBind_6__call__; +struct wrapperbase __pyx_wrapperbase_17OpenGL_accelerate_8latebind_8LateBind_10__call__; #endif -static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_11__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_named = 0; PyObject *__pyx_r = 0; @@ -1501,7 +1675,7 @@ static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_7__call__(PyOb } __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; - __pyx_r = __pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_6__call__(((struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *)__pyx_v_self), __pyx_v_args, __pyx_v_named); + __pyx_r = __pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_10__call__(((struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *)__pyx_v_self), __pyx_v_args, __pyx_v_named); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); @@ -1510,7 +1684,7 @@ static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_7__call__(PyOb return __pyx_r; } -static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_6__call__(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_named) { +static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_10__call__(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_named) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -1520,25 +1694,25 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_6__call__(stru PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__call__", 0); - /* "src/latebind.pyx":30 + /* "src/latebind.pyx":37 * that. * """ * if not self._finalCall: # <<<<<<<<<<<<<< * self._finalCall = self.finalise() * return self._finalCall( *args, **named ) */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_finalCall); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_finalCall); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 37, __pyx_L1_error) __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { - /* "src/latebind.pyx":31 + /* "src/latebind.pyx":38 * """ * if not self._finalCall: * self._finalCall = self.finalise() # <<<<<<<<<<<<<< * return self._finalCall( *args, **named ) * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_finalise); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_finalise); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -1552,7 +1726,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_6__call__(stru } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_3); @@ -1561,7 +1735,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_6__call__(stru __pyx_v_self->_finalCall = __pyx_t_3; __pyx_t_3 = 0; - /* "src/latebind.pyx":30 + /* "src/latebind.pyx":37 * that. * """ * if not self._finalCall: # <<<<<<<<<<<<<< @@ -1570,7 +1744,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_6__call__(stru */ } - /* "src/latebind.pyx":32 + /* "src/latebind.pyx":39 * if not self._finalCall: * self._finalCall = self.finalise() * return self._finalCall( *args, **named ) # <<<<<<<<<<<<<< @@ -1578,13 +1752,13 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_6__call__(stru * cdef class Curry(object): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_self->_finalCall, __pyx_v_args, __pyx_v_named); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_self->_finalCall, __pyx_v_args, __pyx_v_named); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "src/latebind.pyx":23 + /* "src/latebind.pyx":30 * return self._finalCall * * def __call__( self, *args, **named ): # <<<<<<<<<<<<<< @@ -1612,19 +1786,19 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_6__call__(stru */ /* Python wrapper */ -static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_8__reduce_cython__(((struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *)__pyx_v_self)); + __pyx_r = __pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_12__reduce_cython__(((struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_8__reduce_cython__(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self) { +static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_12__reduce_cython__(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; @@ -1844,19 +2018,19 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_8__reduce_cyth */ /* Python wrapper */ -static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ -static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_10__setstate_cython__(((struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + __pyx_r = __pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_14__setstate_cython__(((struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_10__setstate_cython__(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_14__setstate_cython__(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -1892,7 +2066,7 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_8LateBind_10__setstate_c return __pyx_r; } -/* "src/latebind.pyx":38 +/* "src/latebind.pyx":45 * cdef object wrapperFunction * cdef object baseFunction * def __init__( self, wrapperFunction, baseFunction ): # <<<<<<<<<<<<<< @@ -1935,11 +2109,11 @@ static int __pyx_pw_17OpenGL_accelerate_8latebind_5Curry_1__init__(PyObject *__p case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_baseFunction)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 38, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 45, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 38, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 45, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -1952,7 +2126,7 @@ static int __pyx_pw_17OpenGL_accelerate_8latebind_5Curry_1__init__(PyObject *__p } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 38, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 45, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("OpenGL_accelerate.latebind.Curry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -1970,7 +2144,7 @@ static int __pyx_pf_17OpenGL_accelerate_8latebind_5Curry___init__(struct __pyx_o __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); - /* "src/latebind.pyx":40 + /* "src/latebind.pyx":47 * def __init__( self, wrapperFunction, baseFunction ): * """Stores self.wrapperFunction and self.baseFunction""" * self.baseFunction = baseFunction # <<<<<<<<<<<<<< @@ -1983,7 +2157,7 @@ static int __pyx_pf_17OpenGL_accelerate_8latebind_5Curry___init__(struct __pyx_o __Pyx_DECREF(__pyx_v_self->baseFunction); __pyx_v_self->baseFunction = __pyx_v_baseFunction; - /* "src/latebind.pyx":41 + /* "src/latebind.pyx":48 * """Stores self.wrapperFunction and self.baseFunction""" * self.baseFunction = baseFunction * self.wrapperFunction = wrapperFunction # <<<<<<<<<<<<<< @@ -1996,7 +2170,7 @@ static int __pyx_pf_17OpenGL_accelerate_8latebind_5Curry___init__(struct __pyx_o __Pyx_DECREF(__pyx_v_self->wrapperFunction); __pyx_v_self->wrapperFunction = __pyx_v_wrapperFunction; - /* "src/latebind.pyx":38 + /* "src/latebind.pyx":45 * cdef object wrapperFunction * cdef object baseFunction * def __init__( self, wrapperFunction, baseFunction ): # <<<<<<<<<<<<<< @@ -2010,7 +2184,7 @@ static int __pyx_pf_17OpenGL_accelerate_8latebind_5Curry___init__(struct __pyx_o return __pyx_r; } -/* "src/latebind.pyx":42 +/* "src/latebind.pyx":49 * self.baseFunction = baseFunction * self.wrapperFunction = wrapperFunction * def __call__( self, *args, **named ): # <<<<<<<<<<<<<< @@ -2055,28 +2229,28 @@ static PyObject *__pyx_pf_17OpenGL_accelerate_8latebind_5Curry_2__call__(struct PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__call__", 0); - /* "src/latebind.pyx":44 + /* "src/latebind.pyx":51 * def __call__( self, *args, **named ): * """returns self.wrapperFunction( self.baseFunction, *args, **named )""" * return self.wrapperFunction( self.baseFunction, *args, **named ) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->baseFunction); __Pyx_GIVEREF(__pyx_v_self->baseFunction); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->baseFunction); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->wrapperFunction, __pyx_t_2, __pyx_v_named); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->wrapperFunction, __pyx_t_2, __pyx_v_named); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/latebind.pyx":42 + /* "src/latebind.pyx":49 * self.baseFunction = baseFunction * self.wrapperFunction = wrapperFunction * def __call__( self, *args, **named ): # <<<<<<<<<<<<<< @@ -3231,12 +3405,74 @@ static int __pyx_tp_clear_17OpenGL_accelerate_8latebind_LateBind(PyObject *o) { static PyMethodDef __pyx_methods_17OpenGL_accelerate_8latebind_LateBind[] = { {"setFinalCall", (PyCFunction)__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_1setFinalCall, METH_O, __pyx_doc_17OpenGL_accelerate_8latebind_8LateBind_setFinalCall}, {"finalise", (PyCFunction)__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_3finalise, METH_NOARGS, __pyx_doc_17OpenGL_accelerate_8latebind_8LateBind_2finalise}, - {"getFinalCall", (PyCFunction)__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_5getFinalCall, METH_NOARGS, __pyx_doc_17OpenGL_accelerate_8latebind_8LateBind_4getFinalCall}, - {"__reduce_cython__", (PyCFunction)__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_9__reduce_cython__, METH_NOARGS, 0}, - {"__setstate_cython__", (PyCFunction)__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_11__setstate_cython__, METH_O, 0}, + {"getFinalCall", (PyCFunction)__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_9getFinalCall, METH_NOARGS, __pyx_doc_17OpenGL_accelerate_8latebind_8LateBind_8getFinalCall}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_13__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_15__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; +static PyNumberMethods __pyx_tp_as_number_LateBind = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + __pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_5__nonzero__, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + 0, /*nb_index*/ + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_matrix_multiply*/ + #endif + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_inplace_matrix_multiply*/ + #endif +}; + static PyTypeObject __pyx_type_17OpenGL_accelerate_8latebind_LateBind = { PyVarObject_HEAD_INIT(0, 0) "OpenGL_accelerate.latebind.LateBind", /*tp_name*/ @@ -3253,11 +3489,11 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_8latebind_LateBind = { 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ - 0, /*tp_as_number*/ + &__pyx_tp_as_number_LateBind, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ - __pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_7__call__, /*tp_call*/ + __pyx_pw_17OpenGL_accelerate_8latebind_8LateBind_11__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ @@ -3293,6 +3529,9 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_8latebind_LateBind = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif }; static PyObject *__pyx_tp_new_17OpenGL_accelerate_8latebind_Curry(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { @@ -3409,6 +3648,9 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_8latebind_Curry = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif }; static PyMethodDef __pyx_methods[] = { @@ -3467,6 +3709,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_finalise, __pyx_k_finalise, sizeof(__pyx_k_finalise), 0, 0, 1, 1}, + {&__pyx_n_s_getFinalCall, __pyx_k_getFinalCall, sizeof(__pyx_k_getFinalCall), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, @@ -3565,7 +3808,9 @@ static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_8latebind_LateBind) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_8latebind_LateBind.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_8latebind_LateBind.tp_dictoffset && __pyx_type_17OpenGL_accelerate_8latebind_LateBind.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_8latebind_LateBind.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -3573,23 +3818,25 @@ static int __Pyx_modinit_type_init_code(void) { { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_17OpenGL_accelerate_8latebind_LateBind, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(0, 3, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { - __pyx_wrapperbase_17OpenGL_accelerate_8latebind_8LateBind_6__call__ = *((PyWrapperDescrObject *)wrapper)->d_base; - __pyx_wrapperbase_17OpenGL_accelerate_8latebind_8LateBind_6__call__.doc = __pyx_doc_17OpenGL_accelerate_8latebind_8LateBind_6__call__; - ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_17OpenGL_accelerate_8latebind_8LateBind_6__call__; + __pyx_wrapperbase_17OpenGL_accelerate_8latebind_8LateBind_10__call__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_17OpenGL_accelerate_8latebind_8LateBind_10__call__.doc = __pyx_doc_17OpenGL_accelerate_8latebind_8LateBind_10__call__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_17OpenGL_accelerate_8latebind_8LateBind_10__call__; } } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LateBind, (PyObject *)&__pyx_type_17OpenGL_accelerate_8latebind_LateBind) < 0) __PYX_ERR(0, 3, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_17OpenGL_accelerate_8latebind_LateBind) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __pyx_ptype_17OpenGL_accelerate_8latebind_LateBind = &__pyx_type_17OpenGL_accelerate_8latebind_LateBind; - if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_8latebind_Curry) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_8latebind_Curry) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_8latebind_Curry.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_8latebind_Curry.tp_dictoffset && __pyx_type_17OpenGL_accelerate_8latebind_Curry.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_8latebind_Curry.tp_getattro = __Pyx_PyObject_GenericGetAttr; } #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_17OpenGL_accelerate_8latebind_Curry, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 34, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_17OpenGL_accelerate_8latebind_Curry, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 41, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_17OpenGL_accelerate_8latebind_5Curry___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_17OpenGL_accelerate_8latebind_5Curry___init__.doc = __pyx_doc_17OpenGL_accelerate_8latebind_5Curry___init__; @@ -3599,7 +3846,7 @@ static int __Pyx_modinit_type_init_code(void) { #endif #if CYTHON_COMPILING_IN_CPYTHON { - PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_17OpenGL_accelerate_8latebind_Curry, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(0, 34, __pyx_L1_error) + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_17OpenGL_accelerate_8latebind_Curry, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(0, 41, __pyx_L1_error) if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_17OpenGL_accelerate_8latebind_5Curry_2__call__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_17OpenGL_accelerate_8latebind_5Curry_2__call__.doc = __pyx_doc_17OpenGL_accelerate_8latebind_5Curry_2__call__; @@ -3607,8 +3854,8 @@ static int __Pyx_modinit_type_init_code(void) { } } #endif - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Curry, (PyObject *)&__pyx_type_17OpenGL_accelerate_8latebind_Curry) < 0) __PYX_ERR(0, 34, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_17OpenGL_accelerate_8latebind_Curry) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Curry, (PyObject *)&__pyx_type_17OpenGL_accelerate_8latebind_Curry) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_17OpenGL_accelerate_8latebind_Curry) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __pyx_ptype_17OpenGL_accelerate_8latebind_Curry = &__pyx_type_17OpenGL_accelerate_8latebind_Curry; __Pyx_RefNannyFinishContext(); return 0; @@ -3801,10 +4048,9 @@ if (!__Pyx_RefNanny) { __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); - #endif + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -4302,6 +4548,32 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { return result; } +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) diff --git a/accelerate/src/latebind.pyx b/accelerate/src/latebind.pyx index f009a76e..7d55da8d 100644 --- a/accelerate/src/latebind.pyx +++ b/accelerate/src/latebind.pyx @@ -17,7 +17,9 @@ cdef class LateBind: def __nonzero__(self): """Resolve our final call and check for empty/nonzero on it""" return bool(self.getFinalCall()) - __bool__ = __nonzero__ + def __bool__(self): + """Resolve our final call and check for empty/nonzero on it""" + return bool(self.getFinalCall()) def getFinalCall( self ): """Retrieve and/or bind and retrieve final call""" From 93d6f66877fe0dddd42249204a09a78982ba6927 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Mon, 30 Dec 2019 12:25:25 -0500 Subject: [PATCH 21/48] PPM writing and tabular format of configs in EGL debug module --- OpenGL/EGL/debug.py | 141 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 133 insertions(+), 8 deletions(-) diff --git a/OpenGL/EGL/debug.py b/OpenGL/EGL/debug.py index c577e0ba..f6453e7a 100644 --- a/OpenGL/EGL/debug.py +++ b/OpenGL/EGL/debug.py @@ -1,5 +1,6 @@ """Debug utilities for EGL operations""" from OpenGL.EGL import * +import itertools def eglErrorName(value): """Returns error constant if known, otherwise returns value""" return KNOWN_ERRORS.get(value,value) @@ -21,6 +22,27 @@ def eglErrorName(value): EGL_CONTEXT_LOST:EGL_CONTEXT_LOST, } +def write_ppm(buf, filename): + """Write height * width * 3-component buffer as ppm to filename + + This lets us write a simple image format without + using any libraries that can be viewed on most + linux workstations. + """ + with open(filename, "w") as f: + h, w, c = buf.shape + print("P3", file=f) + print("# ascii ppm file created by pyopengl", file=f) + print("%i %i" % (w, h), file=f) + print("255", file=f) + for y in range(h - 1, -1, -1): + for x in range(w): + pixel = buf[y, x] + l = " %3d %3d %3d" % (pixel[0], pixel[1], pixel[2]) + f.write(l) + f.write("\n") + + def debug_config(display,config): """Get debug display for the given configuration""" result = {} @@ -38,6 +60,21 @@ def debug_config(display,config): result[attr.name] = attr_value return result +def debug_configs(display, configs=None, max_count=256): + """Present a formatted list of configs for the display""" + if configs is None: + configs = (EGLConfig * max_count)() + num_configs = EGLint() + eglGetConfigs(display, configs, max_count, num_configs) + if not num_configs.value: + return [] + configs = configs[: num_configs.value] + debug_configs = [ + debug_config(display, cfg) + for cfg in configs + ] + return debug_configs + SURFACE_TYPE_BITS = [ EGL_MULTISAMPLE_RESOLVE_BOX_BIT, EGL_PBUFFER_BIT, @@ -51,6 +88,7 @@ def debug_config(display,config): EGL_OPENGL_BIT, EGL_OPENGL_ES_BIT, EGL_OPENGL_ES2_BIT, + EGL_OPENGL_ES3_BIT, EGL_OPENVG_BIT, ] CAVEAT_BITS = [ @@ -64,33 +102,33 @@ def debug_config(display,config): ] CONFIG_ATTRS = [ + EGL_CONFIG_ID, + EGL_RED_SIZE, + EGL_GREEN_SIZE, + EGL_BLUE_SIZE, + EGL_DEPTH_SIZE, EGL_ALPHA_SIZE, EGL_ALPHA_MASK_SIZE, + EGL_BUFFER_SIZE, + EGL_STENCIL_SIZE, EGL_BIND_TO_TEXTURE_RGB, EGL_BIND_TO_TEXTURE_RGBA, - EGL_BLUE_SIZE, - EGL_BUFFER_SIZE, EGL_COLOR_BUFFER_TYPE, EGL_CONFIG_CAVEAT, - EGL_CONFIG_ID, EGL_CONFORMANT, - EGL_DEPTH_SIZE, - EGL_GREEN_SIZE, EGL_LEVEL, EGL_LUMINANCE_SIZE, EGL_MAX_PBUFFER_WIDTH, EGL_MAX_PBUFFER_HEIGHT, EGL_MAX_PBUFFER_PIXELS, - EGL_MAX_SWAP_INTERVAL, EGL_MIN_SWAP_INTERVAL, + EGL_MAX_SWAP_INTERVAL, EGL_NATIVE_RENDERABLE, EGL_NATIVE_VISUAL_ID, EGL_NATIVE_VISUAL_TYPE, - EGL_RED_SIZE, EGL_RENDERABLE_TYPE, EGL_SAMPLE_BUFFERS, EGL_SAMPLES, - EGL_STENCIL_SIZE, EGL_SURFACE_TYPE, EGL_TRANSPARENT_TYPE, EGL_TRANSPARENT_RED_VALUE, @@ -105,3 +143,90 @@ def debug_config(display,config): (EGL_CONFIG_CAVEAT,CAVEAT_BITS), (EGL_TRANSPARENT_TYPE,TRANSPARENT_BITS), ]) +def bit_renderer(bit): + def render(value): + if bit.name in value: + return ' Y' + else: + return ' .' + return render + +CONFIG_FORMAT = [ + (EGL_CONFIG_ID,'0x%x', 'id', 'cfg'), + (EGL_BUFFER_SIZE,'%i','sz','bf'), + (EGL_LEVEL,'%i','l','lv'), + (EGL_RED_SIZE,'%i','r','cbuf'), + (EGL_GREEN_SIZE,'%i','g','cbuf'), + (EGL_BLUE_SIZE,'%i','b','cbuf'), + (EGL_ALPHA_SIZE,'%i','a','cbuf'), + (EGL_DEPTH_SIZE,'%i','th','dp'), + (EGL_STENCIL_SIZE,'%i','t','s'), + (EGL_SAMPLES,'%i','ns','mult'), + (EGL_SAMPLE_BUFFERS,'%i','bu','mult'), + (EGL_NATIVE_VISUAL_ID,'0x%x','id','visual'), + (EGL_RENDERABLE_TYPE,bit_renderer(EGL_OPENGL_BIT),'gl','render'), + (EGL_RENDERABLE_TYPE,bit_renderer(EGL_OPENGL_ES_BIT),'es','render'), + (EGL_RENDERABLE_TYPE,bit_renderer(EGL_OPENGL_ES2_BIT),'e2','render'), + (EGL_RENDERABLE_TYPE,bit_renderer(EGL_OPENGL_ES3_BIT),'e3','render'), + (EGL_RENDERABLE_TYPE,bit_renderer(EGL_OPENVG_BIT),'vg','render'), + (EGL_SURFACE_TYPE,bit_renderer(EGL_WINDOW_BIT),'wn','surface'), + (EGL_SURFACE_TYPE,bit_renderer(EGL_PBUFFER_BIT),'pb','surface'), + (EGL_SURFACE_TYPE,bit_renderer(EGL_PIXMAP_BIT),'px','surface'), +] +def format_debug_configs(debug_configs, formats=CONFIG_FORMAT): + """Format config for compact debugging display + + Produces a config summary display for a set of + debug_configs as a text-mode table. + + Uses `formats` (default `CONFIG_FORMAT`) to determine + which fields are extracted and how they are formatted + along with the column/subcolum set to be rendered in + the overall header. + + returns formatted ASCII table for display in debug + logs or utilities + """ + columns = [] + for (key,format,subcol,col) in formats: + column = [] + max_width = 0 + for row in debug_configs: + if isinstance(row,EGLConfig): + raise TypeError(row, 'Call debug_config(display,config)') + value = row[key.name] + if isinstance(format,str): + formatted = format%(value) + else: + formatted = format(value) + max_width = max((len(formatted),max_width)) + column.append(formatted) + columns.append({ + 'rows':column, + 'key':key, + 'format':format, + 'subcol':subcol, + 'col': col, + 'width': max_width, + }) + headers = [] + subheaders = [] + rows = [headers,subheaders] + last_column = None + last_column_width = 0 + for header,subcols in itertools.groupby(columns,lambda x: x['col']): + subcols = list(subcols) + width = sum([col['width'] for col in subcols])+(len(subcols)-1) + headers.append(header.center(width,'.')[:width]) + for column in columns: + subheaders.append(column['subcol'].rjust(column['width'])[:column['width']]) + rows.extend(zip(*[ + [ + v.rjust(col['width'], ' ') + for v in col['rows'] + ] + for col in columns + ])) + return '\n'.join([ + ' '.join(row) for row in rows + ]) From c58c9c4696c9fb3718bfc690306ec71dd00374d4 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Mon, 30 Dec 2019 12:27:43 -0500 Subject: [PATCH 22/48] Move code to debug, rely on EGLError for display, debug configs --- tests/os_egl.py | 125 +++++++++++++++++++----------------------------- 1 file changed, 49 insertions(+), 76 deletions(-) diff --git a/tests/os_egl.py b/tests/os_egl.py index 176f6192..c4dc1cf6 100644 --- a/tests/os_egl.py +++ b/tests/os_egl.py @@ -23,22 +23,6 @@ } -def write_ppm(buf, filename): - f = open(filename, "w") - if f: - h, w, c = buf.shape - print("P3", file=f) - print("# ascii ppm file created by os_egl", file=f) - print("%i %i" % (w, h), file=f) - print("255", file=f) - for y in range(h - 1, -1, -1): - for x in range(w): - pixel = buf[y, x] - l = " %3d %3d %3d" % (pixel[0], pixel[1], pixel[2]) - f.write(l) - f.write("\n") - - def platformDisplay(device): """Get platform display from device specifier @@ -88,7 +72,7 @@ def egl_context( output="output.ppm", ): """Setup a context for rendering""" - major, minor = GLint(), GLint() + major, minor = EGLint(), EGLint() created_device = platform_surface = surface = None if device is None: display = eglGetDisplay(EGL_DEFAULT_DISPLAY) @@ -101,10 +85,13 @@ def egl_context( try: eglInitialize(display, major, minor) except GLError as err: - err.err = debug.eglErrorName(err.err) log.warning("eglInitilise failure on %s: %s", display, err.err) raise NoEGLSupport(display) - num_configs = GLint() + log.debug( + "Available configs:\n%s", + debug.format_debug_configs(debug.debug_configs(display)), + ) + num_configs = EGLint() configs = (EGLConfig * 1)() local_attributes = list(attributes[:]) if pbuffer: @@ -120,65 +107,51 @@ def egl_context( ) log.debug("Attributes: %s", local_attributes) local_attributes = arrays.GLintArray.asArray(local_attributes) - try: - success = eglChooseConfig( - display, local_attributes, configs, 1, num_configs - ) - if not success: - raise RuntimeError("Unable to complete config filtering") - if not num_configs: - configs = (EGLConfig * 10)() - eglGetConfigs(display, configs, 10, num_configs) - if num_configs.value: - for config in configs[: num_configs.value]: - log.warning( - "Unused config: %s", - pprint.pformat(debug.debug_config(display, config)), - ) - raise RuntimeError( - "No compatible configs found on %s" % (device or "default") - ) - # for config in configs[:num_configs.value]: - # log.debug("Config: %s",pprint.pformat(debug.debug_config(display,config))) - config = configs[0] - log.debug( - "Selecting config: %s", - pprint.pformat(debug.debug_config(display, config)), + success = eglChooseConfig(display, local_attributes, configs, 1, num_configs) + if not success: + raise RuntimeError("Unable to complete config filtering") + if not num_configs: + raise RuntimeError( + "No compatible configs found on %s" % (device or "default") ) - surface_attributes = [ - EGL_WIDTH, + # for config in configs[:num_configs.value]: + # log.debug("Config: %s",pprint.pformat(debug.debug_config(display,config))) + config = configs[0] + log.debug( + "Selected config: %s", + debug.format_debug_configs( + debug.debug_configs(display, configs=list(configs)) + ), + ) + surface_attributes = [ + EGL_WIDTH, + width, + EGL_HEIGHT, + height, + EGL_NONE, + ] + if pbuffer: + surface = eglCreatePbufferSurface(display, configs[0], surface_attributes,) + else: + visual = EGLint() + eglGetConfigAttrib(display, configs[0], EGL_NATIVE_VISUAL_ID, visual) + log.debug("Native visual id %s", visual.value) + platform_surface = gbmdevice.create_surface( + created_device, width, - EGL_HEIGHT, height, - EGL_NONE, - ] - if pbuffer: - surface = eglCreatePbufferSurface( - display, configs[0], surface_attributes, - ) - else: - visual = EGLint() - eglGetConfigAttrib(display, configs[0], EGL_NATIVE_VISUAL_ID, visual) - log.debug("Native visual id %s", visual.value) - platform_surface = gbmdevice.create_surface( - created_device, - width, - height, - format=visual.value, - flags=gbmdevice.GBM_BO_USE_RENDERING, - ) - log.debug("Native surface created on %s", device) - if not platform_surface: - raise RuntimeError("Unable to allocate a gbm surface") - log.debug("Creating GBM platform window surface") - surface = eglCreatePlatformWindowSurface( - display, configs[0], platform_surface, None - ) - if surface == EGL_NO_SURFACE: - raise RuntimeError("Platform window surface creation failure") - except GLError as err: - err.err = debug.eglErrorName(err.err) - raise + format=visual.value, + flags=gbmdevice.GBM_BO_USE_RENDERING, + ) + log.debug("Native surface created on %s", device) + if not platform_surface: + raise RuntimeError("Unable to allocate a gbm surface") + log.debug("Creating GBM platform window surface") + surface = eglCreatePlatformWindowSurface( + display, configs[0], platform_surface, None + ) + if surface == EGL_NO_SURFACE: + raise RuntimeError("Platform window surface creation failure") log.debug("Binding api %s", api) eglBindAPI(API_MAP[api]) ctx = eglCreateContext(display, configs[0], EGL_NO_CONTEXT, None) @@ -196,7 +169,7 @@ def egl_context( if output: log.debug("Doing readpixels for writing buffer") content = glReadPixelsub(0, 0, width, height, GL_RGB, outputType=None,) - write_ppm(content, output) + debug.write_ppm(content, output) # glFinish() finally: if display: From 9f115ffef7ab01c957d92d7b4830cf61c4930d51 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Mon, 30 Dec 2019 14:05:57 -0500 Subject: [PATCH 23/48] Explicitly export EGLError from the EGL namespace --- OpenGL/EGL/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenGL/EGL/__init__.py b/OpenGL/EGL/__init__.py index 5673e6ce..3db6aa75 100644 --- a/OpenGL/EGL/__init__.py +++ b/OpenGL/EGL/__init__.py @@ -1,5 +1,6 @@ """OpenGL.EGL the portable interface to GL environments""" from OpenGL.raw.EGL._types import * +from OpenGL.raw.EGL._errors import EGLError from OpenGL.EGL.VERSION.EGL_1_0 import * from OpenGL.EGL.VERSION.EGL_1_1 import * from OpenGL.EGL.VERSION.EGL_1_2 import * From a07c956cbbe7b98cb73844c87ffbb66ffcbe7588 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Mon, 30 Dec 2019 14:08:08 -0500 Subject: [PATCH 24/48] Allow for null values in EGL debug table formatting --- OpenGL/EGL/debug.py | 185 ++++++++++++++++++++++++-------------------- 1 file changed, 99 insertions(+), 86 deletions(-) diff --git a/OpenGL/EGL/debug.py b/OpenGL/EGL/debug.py index f6453e7a..dd519e6d 100644 --- a/OpenGL/EGL/debug.py +++ b/OpenGL/EGL/debug.py @@ -1,27 +1,32 @@ """Debug utilities for EGL operations""" from OpenGL.EGL import * import itertools + + def eglErrorName(value): """Returns error constant if known, otherwise returns value""" - return KNOWN_ERRORS.get(value,value) + return KNOWN_ERRORS.get(value, value) + + KNOWN_ERRORS = { - EGL_SUCCESS:EGL_SUCCESS, - EGL_NOT_INITIALIZED:EGL_NOT_INITIALIZED, - EGL_BAD_ACCESS:EGL_BAD_ACCESS, - EGL_BAD_ALLOC:EGL_BAD_ALLOC, - EGL_BAD_ATTRIBUTE:EGL_BAD_ATTRIBUTE, - EGL_BAD_CONTEXT:EGL_BAD_CONTEXT, - EGL_BAD_CONFIG:EGL_BAD_CONFIG, - EGL_BAD_CURRENT_SURFACE:EGL_BAD_CURRENT_SURFACE, - EGL_BAD_DISPLAY:EGL_BAD_DISPLAY, - EGL_BAD_SURFACE:EGL_BAD_SURFACE, - EGL_BAD_MATCH:EGL_BAD_MATCH, - EGL_BAD_PARAMETER:EGL_BAD_PARAMETER, - EGL_BAD_NATIVE_PIXMAP:EGL_BAD_NATIVE_PIXMAP, - EGL_BAD_NATIVE_WINDOW:EGL_BAD_NATIVE_WINDOW, - EGL_CONTEXT_LOST:EGL_CONTEXT_LOST, + EGL_SUCCESS: EGL_SUCCESS, + EGL_NOT_INITIALIZED: EGL_NOT_INITIALIZED, + EGL_BAD_ACCESS: EGL_BAD_ACCESS, + EGL_BAD_ALLOC: EGL_BAD_ALLOC, + EGL_BAD_ATTRIBUTE: EGL_BAD_ATTRIBUTE, + EGL_BAD_CONTEXT: EGL_BAD_CONTEXT, + EGL_BAD_CONFIG: EGL_BAD_CONFIG, + EGL_BAD_CURRENT_SURFACE: EGL_BAD_CURRENT_SURFACE, + EGL_BAD_DISPLAY: EGL_BAD_DISPLAY, + EGL_BAD_SURFACE: EGL_BAD_SURFACE, + EGL_BAD_MATCH: EGL_BAD_MATCH, + EGL_BAD_PARAMETER: EGL_BAD_PARAMETER, + EGL_BAD_NATIVE_PIXMAP: EGL_BAD_NATIVE_PIXMAP, + EGL_BAD_NATIVE_WINDOW: EGL_BAD_NATIVE_WINDOW, + EGL_CONTEXT_LOST: EGL_CONTEXT_LOST, } + def write_ppm(buf, filename): """Write height * width * 3-component buffer as ppm to filename @@ -43,23 +48,25 @@ def write_ppm(buf, filename): f.write("\n") -def debug_config(display,config): +def debug_config(display, config): """Get debug display for the given configuration""" result = {} value = EGLint() for attr in CONFIG_ATTRS: - eglGetConfigAttrib(display,config, attr, value) + if not eglGetConfigAttrib(display, config, attr, value): + log.warning("Failed to get attribute %s from config", attr) + continue if attr in BITMASK_FIELDS: - attr_value = { - } + attr_value = {} for subattr in BITMASK_FIELDS[attr]: if value.value & subattr: - attr_value[subattr.name] = True + attr_value[subattr.name] = True else: attr_value = value.value result[attr.name] = attr_value return result + def debug_configs(display, configs=None, max_count=256): """Present a formatted list of configs for the display""" if configs is None: @@ -69,12 +76,10 @@ def debug_configs(display, configs=None, max_count=256): if not num_configs.value: return [] configs = configs[: num_configs.value] - debug_configs = [ - debug_config(display, cfg) - for cfg in configs - ] + debug_configs = [debug_config(display, cfg) for cfg in configs] return debug_configs + SURFACE_TYPE_BITS = [ EGL_MULTISAMPLE_RESOLVE_BOX_BIT, EGL_PBUFFER_BIT, @@ -83,7 +88,7 @@ def debug_configs(display, configs=None, max_count=256): EGL_VG_ALPHA_FORMAT_PRE_BIT, EGL_VG_COLORSPACE_LINEAR_BIT, EGL_WINDOW_BIT, -] +] RENDERABLE_TYPE_BITS = [ EGL_OPENGL_BIT, EGL_OPENGL_ES_BIT, @@ -136,43 +141,51 @@ def debug_configs(display, configs=None, max_count=256): EGL_TRANSPARENT_BLUE_VALUE, ] -BITMASK_FIELDS = dict([ - (EGL_SURFACE_TYPE,SURFACE_TYPE_BITS), - (EGL_RENDERABLE_TYPE,RENDERABLE_TYPE_BITS), - (EGL_CONFORMANT,RENDERABLE_TYPE_BITS), - (EGL_CONFIG_CAVEAT,CAVEAT_BITS), - (EGL_TRANSPARENT_TYPE,TRANSPARENT_BITS), -]) +BITMASK_FIELDS = dict( + [ + (EGL_SURFACE_TYPE, SURFACE_TYPE_BITS), + (EGL_RENDERABLE_TYPE, RENDERABLE_TYPE_BITS), + (EGL_CONFORMANT, RENDERABLE_TYPE_BITS), + (EGL_CONFIG_CAVEAT, CAVEAT_BITS), + (EGL_TRANSPARENT_TYPE, TRANSPARENT_BITS), + ] +) + + def bit_renderer(bit): def render(value): if bit.name in value: - return ' Y' + return " Y" else: - return ' .' + return " ." + return render + CONFIG_FORMAT = [ - (EGL_CONFIG_ID,'0x%x', 'id', 'cfg'), - (EGL_BUFFER_SIZE,'%i','sz','bf'), - (EGL_LEVEL,'%i','l','lv'), - (EGL_RED_SIZE,'%i','r','cbuf'), - (EGL_GREEN_SIZE,'%i','g','cbuf'), - (EGL_BLUE_SIZE,'%i','b','cbuf'), - (EGL_ALPHA_SIZE,'%i','a','cbuf'), - (EGL_DEPTH_SIZE,'%i','th','dp'), - (EGL_STENCIL_SIZE,'%i','t','s'), - (EGL_SAMPLES,'%i','ns','mult'), - (EGL_SAMPLE_BUFFERS,'%i','bu','mult'), - (EGL_NATIVE_VISUAL_ID,'0x%x','id','visual'), - (EGL_RENDERABLE_TYPE,bit_renderer(EGL_OPENGL_BIT),'gl','render'), - (EGL_RENDERABLE_TYPE,bit_renderer(EGL_OPENGL_ES_BIT),'es','render'), - (EGL_RENDERABLE_TYPE,bit_renderer(EGL_OPENGL_ES2_BIT),'e2','render'), - (EGL_RENDERABLE_TYPE,bit_renderer(EGL_OPENGL_ES3_BIT),'e3','render'), - (EGL_RENDERABLE_TYPE,bit_renderer(EGL_OPENVG_BIT),'vg','render'), - (EGL_SURFACE_TYPE,bit_renderer(EGL_WINDOW_BIT),'wn','surface'), - (EGL_SURFACE_TYPE,bit_renderer(EGL_PBUFFER_BIT),'pb','surface'), - (EGL_SURFACE_TYPE,bit_renderer(EGL_PIXMAP_BIT),'px','surface'), + (EGL_CONFIG_ID, "0x%x", "id", "cfg"), + (EGL_BUFFER_SIZE, "%i", "sz", "bf"), + (EGL_LEVEL, "%i", "l", "lv"), + (EGL_RED_SIZE, "%i", "r", "cbuf"), + (EGL_GREEN_SIZE, "%i", "g", "cbuf"), + (EGL_BLUE_SIZE, "%i", "b", "cbuf"), + (EGL_ALPHA_SIZE, "%i", "a", "cbuf"), + (EGL_DEPTH_SIZE, "%i", "th", "dp"), + (EGL_STENCIL_SIZE, "%i", "t", "s"), + (EGL_SAMPLES, "%i", "ns", "mult"), + (EGL_SAMPLE_BUFFERS, "%i", "bu", "mult"), + (EGL_NATIVE_VISUAL_ID, "0x%x", "id", "visual"), + (EGL_RENDERABLE_TYPE, bit_renderer(EGL_OPENGL_BIT), "gl", "render"), + (EGL_RENDERABLE_TYPE, bit_renderer(EGL_OPENGL_ES_BIT), "es", "render"), + (EGL_RENDERABLE_TYPE, bit_renderer(EGL_OPENGL_ES2_BIT), "e2", "render"), + (EGL_RENDERABLE_TYPE, bit_renderer(EGL_OPENGL_ES3_BIT), "e3", "render"), + (EGL_RENDERABLE_TYPE, bit_renderer(EGL_OPENVG_BIT), "vg", "render"), + (EGL_SURFACE_TYPE, bit_renderer(EGL_WINDOW_BIT), "wn", "surface"), + (EGL_SURFACE_TYPE, bit_renderer(EGL_PBUFFER_BIT), "pb", "surface"), + (EGL_SURFACE_TYPE, bit_renderer(EGL_PIXMAP_BIT), "px", "surface"), ] + + def format_debug_configs(debug_configs, formats=CONFIG_FORMAT): """Format config for compact debugging display @@ -188,45 +201,45 @@ def format_debug_configs(debug_configs, formats=CONFIG_FORMAT): logs or utilities """ columns = [] - for (key,format,subcol,col) in formats: + for (key, format, subcol, col) in formats: column = [] max_width = 0 for row in debug_configs: - if isinstance(row,EGLConfig): - raise TypeError(row, 'Call debug_config(display,config)') - value = row[key.name] - if isinstance(format,str): - formatted = format%(value) + if isinstance(row, EGLConfig): + raise TypeError(row, "Call debug_config(display,config)") + try: + value = row[key.name] + except KeyError: + formatted = "_" else: - formatted = format(value) - max_width = max((len(formatted),max_width)) + if isinstance(format, str): + formatted = format % (value) + else: + formatted = format(value) + max_width = max((len(formatted), max_width)) column.append(formatted) - columns.append({ - 'rows':column, - 'key':key, - 'format':format, - 'subcol':subcol, - 'col': col, - 'width': max_width, - }) + columns.append( + { + "rows": column, + "key": key, + "format": format, + "subcol": subcol, + "col": col, + "width": max_width, + } + ) headers = [] subheaders = [] - rows = [headers,subheaders] + rows = [headers, subheaders] last_column = None last_column_width = 0 - for header,subcols in itertools.groupby(columns,lambda x: x['col']): + for header, subcols in itertools.groupby(columns, lambda x: x["col"]): subcols = list(subcols) - width = sum([col['width'] for col in subcols])+(len(subcols)-1) - headers.append(header.center(width,'.')[:width]) + width = sum([col["width"] for col in subcols]) + (len(subcols) - 1) + headers.append(header.center(width, ".")[:width]) for column in columns: - subheaders.append(column['subcol'].rjust(column['width'])[:column['width']]) - rows.extend(zip(*[ - [ - v.rjust(col['width'], ' ') - for v in col['rows'] - ] - for col in columns - ])) - return '\n'.join([ - ' '.join(row) for row in rows - ]) + subheaders.append(column["subcol"].rjust(column["width"])[: column["width"]]) + rows.extend( + zip(*[[v.rjust(col["width"], " ") for v in col["rows"]] for col in columns]) + ) + return "\n".join([" ".join(row) for row in rows]) From 144ce858573bb4b8e05a7d69cdd19290f992e939 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Mon, 30 Dec 2019 14:09:43 -0500 Subject: [PATCH 25/48] Further refactoring of os_egl setup --- tests/os_egl.py | 148 ++++++++++++++++++++++++++++-------------------- 1 file changed, 88 insertions(+), 60 deletions(-) diff --git a/tests/os_egl.py b/tests/os_egl.py index c4dc1cf6..e7a42a68 100644 --- a/tests/os_egl.py +++ b/tests/os_egl.py @@ -1,5 +1,5 @@ from __future__ import print_function -import os, logging, pprint, ipdb +import os, logging, pprint log = logging.getLogger(__name__) if not os.environ.get("PYOPENGL_PLATFORM"): @@ -8,7 +8,8 @@ del os.environ["DISPLAY"] import logging, contextlib from functools import wraps -from OpenGL.GL import * + +# from OpenGL.GL import * from OpenGL.EGL import * from OpenGL.EGL import debug from OpenGL import arrays @@ -49,6 +50,44 @@ def platformDisplay(device): return display, created_device +def gbmPlatformSurface(display, config, platform_device, width, height): + """Create a GBM platform surface for display with config on platform_device + + returns egl_surface, gbm_surface + """ + visual = EGLint() + eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, visual) + platform_surface = gbmdevice.create_surface( + platform_device, + width, + height, + format=visual.value, + flags=gbmdevice.GBM_BO_USE_RENDERING, + ) + if not platform_surface: + raise RuntimeError("Unable to allocate a gbm surface") + surface = eglCreatePlatformWindowSurface(display, config, platform_surface, None) + if surface == EGL_NO_SURFACE: + log.error("Failed to create the EGL surface on the GBM surface") + raise RuntimeError("Platform window surface creation failure") + return surface, platform_surface + + +def choose_config(display, attributes): + """utility to choose config for the display based on attributes""" + num_configs = EGLint() + configs = (EGLConfig * 1)() + local_attributes = arrays.GLintArray.asArray(attributes) + success = eglChooseConfig(display, local_attributes, configs, 1, num_configs) + if not success: + raise NoConfig("Unable to complete config filtering", attributes) + if not num_configs: + raise NoConfig( + "No compatible configs found", attributes, + ) + return configs[0] + + @contextlib.contextmanager def egl_context( width=256, @@ -84,15 +123,16 @@ def egl_context( # print("Display: %s"%(display.address,)) try: eglInitialize(display, major, minor) - except GLError as err: + except EGLError as err: log.warning("eglInitilise failure on %s: %s", display, err.err) raise NoEGLSupport(display) log.debug( "Available configs:\n%s", debug.format_debug_configs(debug.debug_configs(display)), ) - num_configs = EGLint() - configs = (EGLConfig * 1)() + + # for config in configs[:num_configs.value]: + # log.debug("Config: %s",pprint.pformat(debug.debug_config(display,config))) local_attributes = list(attributes[:]) if pbuffer: local_attributes.extend( @@ -105,23 +145,10 @@ def egl_context( local_attributes.extend( [EGL_CONFORMANT, api, EGL_NONE,] # end of list ) - log.debug("Attributes: %s", local_attributes) - local_attributes = arrays.GLintArray.asArray(local_attributes) - success = eglChooseConfig(display, local_attributes, configs, 1, num_configs) - if not success: - raise RuntimeError("Unable to complete config filtering") - if not num_configs: - raise RuntimeError( - "No compatible configs found on %s" % (device or "default") - ) - # for config in configs[:num_configs.value]: - # log.debug("Config: %s",pprint.pformat(debug.debug_config(display,config))) - config = configs[0] + config = choose_config(display, local_attributes,) log.debug( - "Selected config: %s", - debug.format_debug_configs( - debug.debug_configs(display, configs=list(configs)) - ), + "Selected config:\n%s", + debug.format_debug_configs(debug.debug_configs(display, configs=[config])), ) surface_attributes = [ EGL_WIDTH, @@ -131,59 +158,45 @@ def egl_context( EGL_NONE, ] if pbuffer: - surface = eglCreatePbufferSurface(display, configs[0], surface_attributes,) + surface = eglCreatePbufferSurface(display, config, surface_attributes,) else: - visual = EGLint() - eglGetConfigAttrib(display, configs[0], EGL_NATIVE_VISUAL_ID, visual) - log.debug("Native visual id %s", visual.value) - platform_surface = gbmdevice.create_surface( - created_device, - width, - height, - format=visual.value, - flags=gbmdevice.GBM_BO_USE_RENDERING, + surface, platform_surface = gbmPlatformSurface( + display, config, created_device, width, height ) - log.debug("Native surface created on %s", device) - if not platform_surface: - raise RuntimeError("Unable to allocate a gbm surface") - log.debug("Creating GBM platform window surface") - surface = eglCreatePlatformWindowSurface( - display, configs[0], platform_surface, None - ) - if surface == EGL_NO_SURFACE: - raise RuntimeError("Platform window surface creation failure") - log.debug("Binding api %s", api) eglBindAPI(API_MAP[api]) - ctx = eglCreateContext(display, configs[0], EGL_NO_CONTEXT, None) + ctx = eglCreateContext(display, config, EGL_NO_CONTEXT, None) if ctx == EGL_NO_CONTEXT: raise RuntimeError("Unable to create context") eglMakeCurrent(display, surface, surface, ctx) - log.debug("Yielding to caller") yield display, ctx, surface - log.debug("Doing context cleanup") - if not pbuffer: - # This crashes on my intel i915 device, as do glFlush and glFinish - eglSwapBuffers(display, surface) - else: - glFinish() if output: log.debug("Doing readpixels for writing buffer") - content = glReadPixelsub(0, 0, width, height, GL_RGB, outputType=None,) + from OpenGL import arrays + + content = arrays.GLubyteArray.zeros((width, height, 3)) + if api == EGL_OPENGL_BIT: + from OpenGL.GL import glReadPixels, GL_UNSIGNED_BYTE, GL_RGB + elif api == EGL_OPENGL_ES3_BIT: + from OpenGL.GLES3 import glReadPixels, GL_UNSIGNED_BYTE, GL_RGB + elif api == EGL_OPENGL_ES2_BIT: + from OpenGL.GLES2 import glReadPixels, GL_UNSIGNED_BYTE, GL_RGB + elif api == EGL_OPENGL_ES_BIT: + from OpenGL.GLES1 import glReadPixels, GL_UNSIGNED_BYTE, GL_RGB + content = glReadPixels( + 0, 0, width, height, GL_RGB, type=GL_UNSIGNED_BYTE, array=content + ) + debug.write_ppm(content, output) # glFinish() finally: if display: - log.debug("Unsetting current") eglMakeCurrent(display, None, None, None) if surface: eglDestroySurface(display, surface) - log.debug("Terminating display") eglTerminate(display) if platform_surface: - log.debug("Cleaning up gbm surface") gbmdevice.gbm.gbm_surface_destroy(platform_surface) if created_device: - log.debug("Closing gbm device") gbmdevice.close_device(created_device) @@ -191,7 +204,22 @@ class NoEGLSupport(Exception): """Raised if we could not initialise an egl context""" +class NoConfig(Exception): + """Raised if we did not find any configs""" + + def debug_info(setup): + from OpenGL.GL import ( + glClearColor, + glClear, + GL_COLOR_BUFFER_BIT, + GL_DEPTH_BUFFER_BIT, + glGetString, + GL_VENDOR, + GL_EXTENSIONS, + glFinish, + ) + display, ctx, surface = setup glClearColor(1.0, 1.0, 1.0, 1.0) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) @@ -211,18 +239,18 @@ def main(): try: with egl_context(device=device, pbuffer=True) as setup: debug_info(setup) - except (NoEGLSupport): - pass - except (GLError, RuntimeError): + except (NoEGLSupport, NoConfig) as err: + log.info("Cannot configure: %s", err) + except (EGLError, RuntimeError): log.exception("Failed during: %s", device) for device in gbmdevice.enumerate_devices(): log.info("Starting tests with: %s", device) try: with egl_context(device=device, pbuffer=False) as setup: debug_info(setup) - except (NoEGLSupport): - pass - except (GLError, RuntimeError): + except (NoEGLSupport, NoConfig) as err: + log.info("Cannot configure: %s", err) + except (EGLError, RuntimeError): log.exception("Failed during: %s", device) From 637caf43d9614571a0d050b3b6ac5dd0e364a25d Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Mon, 30 Dec 2019 18:48:06 -0500 Subject: [PATCH 26/48] Remove flaky test in favour of more robust one below it The first memory test had lots of little heuristics and was very loose, yet managed to produce false-positives all the time, the second does a far more rigorous check with a tiny allowance for error and seems to be more reliable. --- tests/test_vbo_memusage.py | 33 ++++++++++----------------------- tox.ini | 1 + 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/tests/test_vbo_memusage.py b/tests/test_vbo_memusage.py index 204c1945..22d75e0f 100644 --- a/tests/test_vbo_memusage.py +++ b/tests/test_vbo_memusage.py @@ -1,14 +1,19 @@ import pygamegltest import os # We have to import at least *one* VBO implementation... -from OpenGL import GL -assert GL +from OpenGL import GL, arrays from OpenGL.arrays import vbo try: import psutil except ImportError: psutil = None +try: + unicode +except NameError: + unicode = str + long = int import pytest +import gc try: import numpy as np except ImportError: @@ -20,29 +25,9 @@ def get_current_memory(): @pytest.mark.skipif(not psutil,reason='No psutil available') @pytest.mark.skipif(not np,reason='No Numpy available') @pygamegltest.pygametest() -def test_memory_usage(): - """Test allocation as reported in Github #5""" - start = get_current_memory() - np_array = np.zeros( (120000, 1,6),dtype='f') - after_np = get_current_memory() - buffer = vbo.VBO( np_array ) - with buffer: - after_transfer = get_current_memory() - - # 2.8MB buffer, on Python 2.7 is around 2.9MB usage, but on - # Python 3.6 we see a consistently higher memory usage (3.1MB), - # somewhat disturbing... - assert (after_np - start) <= 3200000, (after_np-start) - assert (after_transfer - after_np) <= 3200000, (after_transfer-after_np) - -@pytest.mark.skipif(not psutil,reason='No psutil available') -@pytest.mark.skipif(not np, reason="No numpy available") -@pygamegltest.pygametest() def test_sf_2980896(): """Test SF#2980896 report of memory leak on VBO transfer""" - from OpenGL.arrays import vbo - - data = np.arange(1000).astype(np.float32) + data = arrays.GLfloatArray.zeros((1000,)) memory = get_current_memory() for i in range(100): new_vbo = vbo.VBO(data) @@ -51,6 +36,8 @@ def test_sf_2980896(): assert new_vbo is not None, new_vbo new_vbo.delete() del new_vbo + gc.collect() + GL.glFinish() if i < 1: # the *first* call can load lots of libraries, etc... memory = get_current_memory() diff --git a/tox.ini b/tox.ini index 28372083..47a48e2e 100644 --- a/tox.ini +++ b/tox.ini @@ -13,6 +13,7 @@ passenv = deps= pygame pytest + psutil num1: numpy accel1: ./accelerate #install_command = pip install -I {opts} {packages} From 907ec4a298644c9e8c8b087fe97301bc8c444e1d Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Mon, 30 Dec 2019 19:01:17 -0500 Subject: [PATCH 27/48] Experiment with testing on arm64 (loosely related to GH #29) --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index 30a9261f..4b3095eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,20 @@ + +arch: + - amd64 + - arm64 language: python python: - "2.7" - "3.6" - "3.7" +matrix: + include: + - os: linux + arch: amd64 + dist: bionic + - os: linux + arch: arm64 + dist: bionic install: - pip install pygame numpy cython pytest psutil From dccbbb64c8f4121bc0ba29c1b125e5fba6a91c8e Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Mon, 30 Dec 2019 19:11:28 -0500 Subject: [PATCH 28/48] Revert attempts to use arm64 (pygame doesn't build) but add python 3.8 --- .travis.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4b3095eb..0d058767 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,10 @@ -arch: - - amd64 - - arm64 language: python python: - "2.7" - "3.6" - "3.7" -matrix: - include: - - os: linux - arch: amd64 - dist: bionic - - os: linux - arch: arm64 - dist: bionic + - "3.8" install: - pip install pygame numpy cython pytest psutil From bdb957bc83d385526114a6255efbeafd4f5517a4 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Mon, 30 Dec 2019 19:14:56 -0500 Subject: [PATCH 29/48] Add libsdl1.2-dev to get the sld-config utility --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0d058767..0b5ba5fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,7 @@ addons: - libglapi-mesa - libgbm1 - libgl1-mesa-dri + - libsdl1.2-dev before_install: - sudo apt-get update -qq -y From 447fbfa2862deadaa31b10062e41191a2d32c0c7 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Mon, 30 Dec 2019 19:18:34 -0500 Subject: [PATCH 30/48] Continue trying to get sdl to compile --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0b5ba5fa..1a6528c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,7 @@ addons: - libgbm1 - libgl1-mesa-dri - libsdl1.2-dev + - libfreetype6-dev before_install: - sudo apt-get update -qq -y From c4cd5d0b1dacd0a42ad9226fed44052558aba4b2 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Mon, 30 Dec 2019 19:39:07 -0500 Subject: [PATCH 31/48] Back out adding python3.8 to the build matrix --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1a6528c1..629b7f3f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,8 @@ - language: python python: - "2.7" - "3.6" - "3.7" - - "3.8" install: - pip install pygame numpy cython pytest psutil From 2f401a0d65bb96ea702a39c7e9d1626b94a79f6e Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Wed, 1 Jan 2020 00:05:47 -0500 Subject: [PATCH 32/48] Allow glGetDeviceQueryString without display, use to display drm name The DRM name is only available on the enumeration devices, but then those seem to show all of the devices on the modern ubuntu, so maybe that's all we need for now. --- OpenGL/EGL/EXT/device_base.py | 3 +++ OpenGL/EGL/EXT/device_query.py | 5 ++++- tests/os_egl.py | 27 +++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/OpenGL/EGL/EXT/device_base.py b/OpenGL/EGL/EXT/device_base.py index d72eeb39..d782d87e 100644 --- a/OpenGL/EGL/EXT/device_base.py +++ b/OpenGL/EGL/EXT/device_base.py @@ -23,6 +23,9 @@ def glInitDeviceBaseEXT(): ### END AUTOGENERATED SECTION eglQueryDevicesEXT.extension = None eglQueryDevicesEXT.force_extension = True +eglQueryDeviceStringEXT.extension = None +eglQueryDeviceStringEXT.force_extension = True + def egl_get_devices(max_count=10): """Utility function that retrieves platform devices""" diff --git a/OpenGL/EGL/EXT/device_query.py b/OpenGL/EGL/EXT/device_query.py index 1b11e3d9..45549198 100644 --- a/OpenGL/EGL/EXT/device_query.py +++ b/OpenGL/EGL/EXT/device_query.py @@ -20,4 +20,7 @@ def glInitDeviceQueryEXT(): return extensions.hasGLExtension( _EXTENSION_NAME ) -### END AUTOGENERATED SECTION \ No newline at end of file +### END AUTOGENERATED SECTION + +eglQueryDeviceStringEXT.extension = None +eglQueryDeviceStringEXT.force_extension = True diff --git a/tests/os_egl.py b/tests/os_egl.py index e7a42a68..86e843e1 100644 --- a/tests/os_egl.py +++ b/tests/os_egl.py @@ -47,6 +47,13 @@ def platformDisplay(device): raise RuntimeError("Unable to create EGL display on %s" % (display)) else: raise RuntimeError("eglGetPlatformDisplay has no implementation") + if not created_device: + try: + name = get_device_name(device) + if name is not None: + log.debug("DRM Name: %s", name) + except EGLError: + log.debug("Unable to retrieve the DRM name") return display, created_device @@ -227,6 +234,26 @@ def debug_info(setup): log.info("Extensions: %s", glGetString(GL_EXTENSIONS)) glFinish() +def get_device_name(device): + """Try to get the display's DRM device name + + This is almost certainly not going to work on + anything other than Linux + """ + from OpenGL.EGL.EXT.device_query import ( + eglQueryDeviceStringEXT, + ) + from OpenGL.EGL.EXT.device_drm import ( + EGL_DRM_DEVICE_FILE_EXT, + ) + if eglQueryDeviceStringEXT: + name = eglQueryDeviceStringEXT( + device, + EGL_DRM_DEVICE_FILE_EXT + ) + return name.decode('ascii',errors='ignore') + return None + def main(): # NOTE: having two different implementations here is From a52215fc28df7e72afb63767204a8a6c36c4a22a Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Thu, 2 Jan 2020 11:08:14 -0500 Subject: [PATCH 33/48] TESTS Fix usage of glCompressedTexImage2D in test_core If you run the core test suite on Windows where the extension is supported we see a failure because there is a missing argument. --- tests/test_core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_core.py b/tests/test_core.py index cf533030..5d9e94f9 100755 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -590,7 +590,8 @@ def test_compressed_data(self): GL_TEXTURE_2D, 0, s3tc.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, 256, 256, 0, - image + 256*256*1, + image, ) assert texture From 44a89fe885921d11cd9bbaced6eadbb4a4c89d4b Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Thu, 2 Jan 2020 11:10:22 -0500 Subject: [PATCH 34/48] GITIGNORE Ignore .pyd files for Windows develop builds --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2ea1c8b4..4a54c07f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ build __pycache__ .vscode *.pyc +*.pyd src/khronosapi accelerate/dist *.so From 143ecbc8669e2ac92804850fcf67dbd0ceab817e Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Thu, 2 Jan 2020 13:24:20 -0500 Subject: [PATCH 35/48] GITHUB #7 Use b-strings instead of as_8_bit This should have no effect whatsoever, and indeed it doesn't seem to do anything in testing, but there's no need to create maybe-unicode and then convert to bytes rather than just forcing to bytes to start with. --- OpenGL/raw/WGL/_types.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenGL/raw/WGL/_types.py b/OpenGL/raw/WGL/_types.py index 650dd05a..d265cbca 100644 --- a/OpenGL/raw/WGL/_types.py +++ b/OpenGL/raw/WGL/_types.py @@ -7,9 +7,9 @@ c_void = None class _WGLQuerier( extensions.ExtensionQuerier ): - prefix = as_8_bit('WGL_') + prefix = b'WGL_' assumed_version = [1,0] - version_prefix = as_8_bit('WGL_VERSION_WGL_') + version_prefix = b'WGL_VERSION_WGL_' def pullVersion( self ): # only one version... return [1,0] @@ -19,7 +19,7 @@ def pullExtensions( self ): wglGetCurrentDC.restyle = HDC try: dc = wglGetCurrentDC() - proc_address = PLATFORM.getExtensionProcedure(as_8_bit('wglGetExtensionsStringARB') ) + proc_address = PLATFORM.getExtensionProcedure(b'wglGetExtensionsStringARB') wglGetExtensionStringARB = PLATFORM.functionTypeFor( PLATFORM.WGL )( c_char_p, HDC, From f12403b590cf0722077ec97a7c777ee97d2670b0 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Thu, 2 Jan 2020 13:26:43 -0500 Subject: [PATCH 36/48] WGL FIX Set the resstyle for getCurrentDC in the wrapper --- OpenGL/WGL/VERSION/WGL_1_0.py | 4 ++- tests/test_wgl.py | 50 +++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 tests/test_wgl.py diff --git a/OpenGL/WGL/VERSION/WGL_1_0.py b/OpenGL/WGL/VERSION/WGL_1_0.py index 00b9c19d..e15b4445 100644 --- a/OpenGL/WGL/VERSION/WGL_1_0.py +++ b/OpenGL/WGL/VERSION/WGL_1_0.py @@ -20,4 +20,6 @@ def glInitWgl10VERSION(): return extensions.hasGLExtension( _EXTENSION_NAME ) -### END AUTOGENERATED SECTION \ No newline at end of file +### END AUTOGENERATED SECTION + +wglGetCurrentDC.restyle = ctypes.HDC diff --git a/tests/test_wgl.py b/tests/test_wgl.py new file mode 100644 index 00000000..4e4e6c6a --- /dev/null +++ b/tests/test_wgl.py @@ -0,0 +1,50 @@ +from __future__ import print_function +import pytest, os, sys, unittest +import logging +log = logging.getLogger(__name__) +HERE = os.path.dirname( __file__ ) +if sys.platform != 'win32': + raise pytest.skip(reason='Non-windows platform') +try: + from numpy import * +except ImportError as err: + array = None +import pygame, pygame.display +pygame.display.init() +from OpenGL.GL import * +from OpenGL.WGL import * + + +class TestWGL(unittest.TestCase): + width,height = 300,300 + def setUp(self): + self.screen = pygame.display.set_mode( + (self.width,self.height), + pygame.OPENGL | pygame.DOUBLEBUF, + ) + + pygame.display.set_caption('Testing system') + pygame.key.set_repeat(500,30) + def tearDown(self): + pygame.display.flip() + + def test_wgl_imported(self): + assert bool(wglCreateContext) + def test_create_context(self): + window = pygame.display.get_wm_info()['window'] + wglCreateContext(window) + + def test_get_extensions_low_level(self): + from OpenGL.WGL.ARB.extensions_string import wglGetExtensionsStringARB + window = pygame.display.get_wm_info()['window'] + extensions = wglGetExtensionsStringARB(wglGetCurrentDC()) + assert extensions + assert b'WGL_ARB_extensions_string' in extensions, extensions + + def test_swap_control_interval(self): + from OpenGL.WGL.EXT import swap_control + if not swap_control.wglGetSwapIntervalEXT: + raise pytest.skip(reason='No wglGetSwapIntervalEXT available') + interval = swap_control.wglGetSwapIntervalEXT() + + swap_control.wglSwapIntervalEXT(1) From d625f8b5f4ace82b1712ba2b50baa9072cff0004 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Fri, 3 Jan 2020 12:45:50 -0500 Subject: [PATCH 37/48] TESTS FIX reason cannot be passed as a keyword argument in pytest.skip --- tests/test_wgl.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_wgl.py b/tests/test_wgl.py index 4e4e6c6a..9be91629 100644 --- a/tests/test_wgl.py +++ b/tests/test_wgl.py @@ -4,7 +4,7 @@ log = logging.getLogger(__name__) HERE = os.path.dirname( __file__ ) if sys.platform != 'win32': - raise pytest.skip(reason='Non-windows platform') + raise pytest.skip('Non-windows (WGL) platform', allow_module_level=True) try: from numpy import * except ImportError as err: @@ -14,7 +14,6 @@ from OpenGL.GL import * from OpenGL.WGL import * - class TestWGL(unittest.TestCase): width,height = 300,300 def setUp(self): From eb9a6b4b001c1b86a99ef24b0e9a53a23fe2cf2f Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Fri, 3 Jan 2020 15:09:55 -0500 Subject: [PATCH 38/48] FIX Work around weird numpy scalar behaviour (0-dimension arrays) Seeing test-suite failures where a numpy scalar is getting into the handler and it's not being treated as a one-element array, but as a *0* element array, so everything goes to heck in a handbasket and dogs and cats are friends, mass hysteria, you know the drill This patch means that if you pass in a scalar we'll actually create a new 1-element numpy array and fill that array with the scalar rather than treating the scalar as a number-like thing that can pass through the rest of the machinery. I don't *see* how this changed in the numpy API, so I'm suspicious this is some weird behaviour that either never got noticed before or it was a side-effect of e.g. having two numpy libraries on a machine. --- accelerate/src/numpy_formathandler.c | 977 +++++++++++++++---------- accelerate/src/numpy_formathandler.pyx | 18 +- 2 files changed, 586 insertions(+), 409 deletions(-) diff --git a/accelerate/src/numpy_formathandler.c b/accelerate/src/numpy_formathandler.c index bf2ea3fc..efa7371e 100644 --- a/accelerate/src/numpy_formathandler.c +++ b/accelerate/src/numpy_formathandler.c @@ -1114,7 +1114,7 @@ struct __pyx_obj_17OpenGL_accelerate_13formathandler_FormatHandler { }; -/* "src/numpy_formathandler.pyx":36 +/* "src/numpy_formathandler.pyx":39 * return desc * * cdef class NumpyHandler(FormatHandler): # <<<<<<<<<<<<<< @@ -1151,7 +1151,7 @@ struct __pyx_vtabstruct_17OpenGL_accelerate_13formathandler_FormatHandler { static struct __pyx_vtabstruct_17OpenGL_accelerate_13formathandler_FormatHandler *__pyx_vtabptr_17OpenGL_accelerate_13formathandler_FormatHandler; -/* "src/numpy_formathandler.pyx":36 +/* "src/numpy_formathandler.pyx":39 * return desc * * cdef class NumpyHandler(FormatHandler): # <<<<<<<<<<<<<< @@ -1800,6 +1800,7 @@ static const char __pyx_k_size[] = "size"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_void[] = "void"; static const char __pyx_k_bytes[] = "bytes"; +static const char __pyx_k_class[] = "__class__"; static const char __pyx_k_int16[] = "int16"; static const char __pyx_k_int32[] = "int32"; static const char __pyx_k_int64[] = "int64"; @@ -1875,6 +1876,7 @@ static const char __pyx_k_Incompatible_checksums_s_vs_0x40[] = "Incompatible che static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; static const char __pyx_k_Numpy_format_handler_passed_a_no[] = "Numpy format handler passed a non-numpy-array object %s (of type %s)"; static const char __pyx_k_OpenGL_accelerate_numpy_formatha[] = "OpenGL_accelerate.numpy_formathandler"; +static const char __pyx_k_Unable_to_fill_new_array_with_va[] = "Unable to fill new array with value %r (%s)"; static const char __pyx_k_from_param_received_a_non_contig[] = "from_param received a non-contiguous array! %s"; static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; @@ -1902,6 +1904,7 @@ static PyObject *__pyx_n_s_OpenGL_error; static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Unable_to_fill_new_array_with_va; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_a_to_gl; static PyObject *__pyx_n_s_bool; @@ -1909,6 +1912,7 @@ static PyObject *__pyx_n_s_bytes; static PyObject *__pyx_n_s_bytes_2; static PyObject *__pyx_n_s_c_void_p; static PyObject *__pyx_n_s_char; +static PyObject *__pyx_n_s_class; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_complex128; static PyObject *__pyx_n_s_complex256; @@ -1987,6 +1991,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s static PyObject *__pyx_tp_new_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys = {0, &__pyx_n_s_keys, 0, 0, 0}; +static PyObject *__pyx_int_1; static PyObject *__pyx_int_67406576; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; @@ -1996,10 +2001,11 @@ static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; -static PyObject *__pyx_codeobj__9; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_codeobj__10; /* Late includes */ -/* "src/numpy_formathandler.pyx":30 +/* "src/numpy_formathandler.pyx":33 * cdef np.npy_intp PyArray_SIZE( np.ndarray ) * * cdef np.dtype array_descr( np.ndarray array ): # <<<<<<<<<<<<<< @@ -2014,19 +2020,19 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_de PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("array_descr", 0); - /* "src/numpy_formathandler.pyx":32 + /* "src/numpy_formathandler.pyx":35 * cdef np.dtype array_descr( np.ndarray array ): * """Wrap PyArray_DESCR and incref to deal with the "borrowed" reference""" * cdef np.dtype desc = PyArray_DESCR( array ) # <<<<<<<<<<<<<< * Py_INCREF( desc) * return desc */ - __pyx_t_1 = ((PyObject *)PyArray_DESCR(__pyx_v_array)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)PyArray_DESCR(__pyx_v_array)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_desc = ((PyArray_Descr *)__pyx_t_1); __pyx_t_1 = 0; - /* "src/numpy_formathandler.pyx":33 + /* "src/numpy_formathandler.pyx":36 * """Wrap PyArray_DESCR and incref to deal with the "borrowed" reference""" * cdef np.dtype desc = PyArray_DESCR( array ) * Py_INCREF( desc) # <<<<<<<<<<<<<< @@ -2035,7 +2041,7 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_de */ Py_INCREF(((PyObject *)__pyx_v_desc)); - /* "src/numpy_formathandler.pyx":34 + /* "src/numpy_formathandler.pyx":37 * cdef np.dtype desc = PyArray_DESCR( array ) * Py_INCREF( desc) * return desc # <<<<<<<<<<<<<< @@ -2047,7 +2053,7 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_de __pyx_r = __pyx_v_desc; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":30 + /* "src/numpy_formathandler.pyx":33 * cdef np.npy_intp PyArray_SIZE( np.ndarray ) * * cdef np.dtype array_descr( np.ndarray array ): # <<<<<<<<<<<<<< @@ -2067,7 +2073,7 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_de return __pyx_r; } -/* "src/numpy_formathandler.pyx":69 +/* "src/numpy_formathandler.pyx":72 * HANDLED_TYPES += (np.complex256,) * * def __init__( self, ERROR_ON_COPY=None, a_to_gl=None, gl_to_a=None ): # <<<<<<<<<<<<<< @@ -2124,7 +2130,7 @@ static int __pyx_pw_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler_1__ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 69, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 72, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2144,7 +2150,7 @@ static int __pyx_pw_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler_1__ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 69, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 72, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("OpenGL_accelerate.numpy_formathandler.NumpyHandler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2173,7 +2179,7 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i __Pyx_INCREF(__pyx_v_a_to_gl); __Pyx_INCREF(__pyx_v_gl_to_a); - /* "src/numpy_formathandler.pyx":70 + /* "src/numpy_formathandler.pyx":73 * * def __init__( self, ERROR_ON_COPY=None, a_to_gl=None, gl_to_a=None ): * if ERROR_ON_COPY is None: # <<<<<<<<<<<<<< @@ -2184,41 +2190,41 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "src/numpy_formathandler.pyx":71 + /* "src/numpy_formathandler.pyx":74 * def __init__( self, ERROR_ON_COPY=None, a_to_gl=None, gl_to_a=None ): * if ERROR_ON_COPY is None: * from OpenGL import _configflags # <<<<<<<<<<<<<< * ERROR_ON_COPY = _configflags.ERROR_ON_COPY * if a_to_gl is None: */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_configflags); __Pyx_GIVEREF(__pyx_n_s_configflags); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_configflags); - __pyx_t_4 = __Pyx_Import(__pyx_n_s_OpenGL, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_4 = __Pyx_Import(__pyx_n_s_OpenGL, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_configflags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_configflags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_v__configflags = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "src/numpy_formathandler.pyx":72 + /* "src/numpy_formathandler.pyx":75 * if ERROR_ON_COPY is None: * from OpenGL import _configflags * ERROR_ON_COPY = _configflags.ERROR_ON_COPY # <<<<<<<<<<<<<< * if a_to_gl is None: * from OpenGL.arrays.numpymodule import ARRAY_TO_GL_TYPE_MAPPING */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__configflags, __pyx_n_s_ERROR_ON_COPY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__configflags, __pyx_n_s_ERROR_ON_COPY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_ERROR_ON_COPY, __pyx_t_4); __pyx_t_4 = 0; - /* "src/numpy_formathandler.pyx":70 + /* "src/numpy_formathandler.pyx":73 * * def __init__( self, ERROR_ON_COPY=None, a_to_gl=None, gl_to_a=None ): * if ERROR_ON_COPY is None: # <<<<<<<<<<<<<< @@ -2227,7 +2233,7 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i */ } - /* "src/numpy_formathandler.pyx":73 + /* "src/numpy_formathandler.pyx":76 * from OpenGL import _configflags * ERROR_ON_COPY = _configflags.ERROR_ON_COPY * if a_to_gl is None: # <<<<<<<<<<<<<< @@ -2238,29 +2244,29 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "src/numpy_formathandler.pyx":74 + /* "src/numpy_formathandler.pyx":77 * ERROR_ON_COPY = _configflags.ERROR_ON_COPY * if a_to_gl is None: * from OpenGL.arrays.numpymodule import ARRAY_TO_GL_TYPE_MAPPING # <<<<<<<<<<<<<< * a_to_gl = ARRAY_TO_GL_TYPE_MAPPING * if gl_to_a is None: */ - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_n_s_ARRAY_TO_GL_TYPE_MAPPING); __Pyx_GIVEREF(__pyx_n_s_ARRAY_TO_GL_TYPE_MAPPING); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_ARRAY_TO_GL_TYPE_MAPPING); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_OpenGL_arrays_numpymodule, __pyx_t_4, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_n_s_OpenGL_arrays_numpymodule, __pyx_t_4, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_ARRAY_TO_GL_TYPE_MAPPING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_ARRAY_TO_GL_TYPE_MAPPING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_4); __pyx_v_ARRAY_TO_GL_TYPE_MAPPING = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/numpy_formathandler.pyx":75 + /* "src/numpy_formathandler.pyx":78 * if a_to_gl is None: * from OpenGL.arrays.numpymodule import ARRAY_TO_GL_TYPE_MAPPING * a_to_gl = ARRAY_TO_GL_TYPE_MAPPING # <<<<<<<<<<<<<< @@ -2270,7 +2276,7 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i __Pyx_INCREF(__pyx_v_ARRAY_TO_GL_TYPE_MAPPING); __Pyx_DECREF_SET(__pyx_v_a_to_gl, __pyx_v_ARRAY_TO_GL_TYPE_MAPPING); - /* "src/numpy_formathandler.pyx":73 + /* "src/numpy_formathandler.pyx":76 * from OpenGL import _configflags * ERROR_ON_COPY = _configflags.ERROR_ON_COPY * if a_to_gl is None: # <<<<<<<<<<<<<< @@ -2279,7 +2285,7 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i */ } - /* "src/numpy_formathandler.pyx":76 + /* "src/numpy_formathandler.pyx":79 * from OpenGL.arrays.numpymodule import ARRAY_TO_GL_TYPE_MAPPING * a_to_gl = ARRAY_TO_GL_TYPE_MAPPING * if gl_to_a is None: # <<<<<<<<<<<<<< @@ -2290,29 +2296,29 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "src/numpy_formathandler.pyx":77 + /* "src/numpy_formathandler.pyx":80 * a_to_gl = ARRAY_TO_GL_TYPE_MAPPING * if gl_to_a is None: * from OpenGL.arrays.numpymodule import GL_TYPE_TO_ARRAY_MAPPING # <<<<<<<<<<<<<< * gl_to_a = GL_TYPE_TO_ARRAY_MAPPING * self.ERROR_ON_COPY = ERROR_ON_COPY */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_GL_TYPE_TO_ARRAY_MAPPING); __Pyx_GIVEREF(__pyx_n_s_GL_TYPE_TO_ARRAY_MAPPING); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_GL_TYPE_TO_ARRAY_MAPPING); - __pyx_t_4 = __Pyx_Import(__pyx_n_s_OpenGL_arrays_numpymodule, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_4 = __Pyx_Import(__pyx_n_s_OpenGL_arrays_numpymodule, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_GL_TYPE_TO_ARRAY_MAPPING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_GL_TYPE_TO_ARRAY_MAPPING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_v_GL_TYPE_TO_ARRAY_MAPPING = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "src/numpy_formathandler.pyx":78 + /* "src/numpy_formathandler.pyx":81 * if gl_to_a is None: * from OpenGL.arrays.numpymodule import GL_TYPE_TO_ARRAY_MAPPING * gl_to_a = GL_TYPE_TO_ARRAY_MAPPING # <<<<<<<<<<<<<< @@ -2322,7 +2328,7 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i __Pyx_INCREF(__pyx_v_GL_TYPE_TO_ARRAY_MAPPING); __Pyx_DECREF_SET(__pyx_v_gl_to_a, __pyx_v_GL_TYPE_TO_ARRAY_MAPPING); - /* "src/numpy_formathandler.pyx":76 + /* "src/numpy_formathandler.pyx":79 * from OpenGL.arrays.numpymodule import ARRAY_TO_GL_TYPE_MAPPING * a_to_gl = ARRAY_TO_GL_TYPE_MAPPING * if gl_to_a is None: # <<<<<<<<<<<<<< @@ -2331,24 +2337,24 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i */ } - /* "src/numpy_formathandler.pyx":79 + /* "src/numpy_formathandler.pyx":82 * from OpenGL.arrays.numpymodule import GL_TYPE_TO_ARRAY_MAPPING * gl_to_a = GL_TYPE_TO_ARRAY_MAPPING * self.ERROR_ON_COPY = ERROR_ON_COPY # <<<<<<<<<<<<<< * self.array_to_gl_constant = a_to_gl * self.gl_constant_to_array = gl_to_a */ - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_ERROR_ON_COPY); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_ERROR_ON_COPY); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_v_self->__pyx_base.ERROR_ON_COPY = __pyx_t_5; - /* "src/numpy_formathandler.pyx":80 + /* "src/numpy_formathandler.pyx":83 * gl_to_a = GL_TYPE_TO_ARRAY_MAPPING * self.ERROR_ON_COPY = ERROR_ON_COPY * self.array_to_gl_constant = a_to_gl # <<<<<<<<<<<<<< * self.gl_constant_to_array = gl_to_a * */ - if (!(likely(PyDict_CheckExact(__pyx_v_a_to_gl))||((__pyx_v_a_to_gl) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_a_to_gl)->tp_name), 0))) __PYX_ERR(0, 80, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_a_to_gl))||((__pyx_v_a_to_gl) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_a_to_gl)->tp_name), 0))) __PYX_ERR(0, 83, __pyx_L1_error) __pyx_t_4 = __pyx_v_a_to_gl; __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -2357,14 +2363,14 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i __pyx_v_self->array_to_gl_constant = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "src/numpy_formathandler.pyx":81 + /* "src/numpy_formathandler.pyx":84 * self.ERROR_ON_COPY = ERROR_ON_COPY * self.array_to_gl_constant = a_to_gl * self.gl_constant_to_array = gl_to_a # <<<<<<<<<<<<<< * * cdef np.ndarray c_check_array( self, object instance ): */ - if (!(likely(PyDict_CheckExact(__pyx_v_gl_to_a))||((__pyx_v_gl_to_a) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_gl_to_a)->tp_name), 0))) __PYX_ERR(0, 81, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_gl_to_a))||((__pyx_v_gl_to_a) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_gl_to_a)->tp_name), 0))) __PYX_ERR(0, 84, __pyx_L1_error) __pyx_t_4 = __pyx_v_gl_to_a; __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -2373,7 +2379,7 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i __pyx_v_self->gl_constant_to_array = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "src/numpy_formathandler.pyx":69 + /* "src/numpy_formathandler.pyx":72 * HANDLED_TYPES += (np.complex256,) * * def __init__( self, ERROR_ON_COPY=None, a_to_gl=None, gl_to_a=None ): # <<<<<<<<<<<<<< @@ -2400,7 +2406,7 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i return __pyx_r; } -/* "src/numpy_formathandler.pyx":83 +/* "src/numpy_formathandler.pyx":86 * self.gl_constant_to_array = gl_to_a * * cdef np.ndarray c_check_array( self, object instance ): # <<<<<<<<<<<<<< @@ -2416,7 +2422,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("c_check_array", 0); - /* "src/numpy_formathandler.pyx":84 + /* "src/numpy_formathandler.pyx":87 * * cdef np.ndarray c_check_array( self, object instance ): * if not PyArray_Check( instance ): # <<<<<<<<<<<<<< @@ -2426,14 +2432,14 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __pyx_t_1 = ((!(PyArray_Check(__pyx_v_instance) != 0)) != 0); if (unlikely(__pyx_t_1)) { - /* "src/numpy_formathandler.pyx":86 + /* "src/numpy_formathandler.pyx":89 * if not PyArray_Check( instance ): * raise TypeError( * """Numpy format handler passed a non-numpy-array object %s (of type %s)"""%( instance, type(instance) ), # <<<<<<<<<<<<<< * ) - * + * return instance */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_instance); __Pyx_GIVEREF(__pyx_v_instance); @@ -2441,25 +2447,25 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_instance))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_instance))); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)Py_TYPE(__pyx_v_instance))); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Numpy_format_handler_passed_a_no, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Numpy_format_handler_passed_a_no, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":85 + /* "src/numpy_formathandler.pyx":88 * cdef np.ndarray c_check_array( self, object instance ): * if not PyArray_Check( instance ): * raise TypeError( # <<<<<<<<<<<<<< * """Numpy format handler passed a non-numpy-array object %s (of type %s)"""%( instance, type(instance) ), * ) */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 85, __pyx_L1_error) + __PYX_ERR(0, 88, __pyx_L1_error) - /* "src/numpy_formathandler.pyx":84 + /* "src/numpy_formathandler.pyx":87 * * cdef np.ndarray c_check_array( self, object instance ): * if not PyArray_Check( instance ): # <<<<<<<<<<<<<< @@ -2468,9 +2474,9 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ } - /* "src/numpy_formathandler.pyx":89 + /* "src/numpy_formathandler.pyx":91 + * """Numpy format handler passed a non-numpy-array object %s (of type %s)"""%( instance, type(instance) ), * ) - * * return instance # <<<<<<<<<<<<<< * * cdef c_from_param( self, object instance, object typeCode ): @@ -2480,7 +2486,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __pyx_r = ((PyArrayObject *)__pyx_v_instance); goto __pyx_L0; - /* "src/numpy_formathandler.pyx":83 + /* "src/numpy_formathandler.pyx":86 * self.gl_constant_to_array = gl_to_a * * cdef np.ndarray c_check_array( self, object instance ): # <<<<<<<<<<<<<< @@ -2500,7 +2506,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH return __pyx_r; } -/* "src/numpy_formathandler.pyx":91 +/* "src/numpy_formathandler.pyx":93 * return instance * * cdef c_from_param( self, object instance, object typeCode ): # <<<<<<<<<<<<<< @@ -2523,29 +2529,29 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("c_from_param", 0); - /* "src/numpy_formathandler.pyx":93 + /* "src/numpy_formathandler.pyx":95 * cdef c_from_param( self, object instance, object typeCode ): * """simple function-based from_param""" * cdef np.ndarray working = self.c_check_array( instance ) # <<<<<<<<<<<<<< * cdef np.dtype targetType * if typeCode: */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_working = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "src/numpy_formathandler.pyx":95 + /* "src/numpy_formathandler.pyx":97 * cdef np.ndarray working = self.c_check_array( instance ) * cdef np.dtype targetType * if typeCode: # <<<<<<<<<<<<<< * targetType = (self.gl_constant_to_array[ typeCode ]) * if array_descr(instance) != targetType: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_typeCode); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_typeCode); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 97, __pyx_L1_error) if (__pyx_t_2) { - /* "src/numpy_formathandler.pyx":96 + /* "src/numpy_formathandler.pyx":98 * cdef np.dtype targetType * if typeCode: * targetType = (self.gl_constant_to_array[ typeCode ]) # <<<<<<<<<<<<<< @@ -2554,9 +2560,9 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ if (unlikely(__pyx_v_self->gl_constant_to_array == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 96, __pyx_L1_error) + __PYX_ERR(0, 98, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->gl_constant_to_array, __pyx_v_typeCode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->gl_constant_to_array, __pyx_v_typeCode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); @@ -2564,46 +2570,46 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_v_targetType = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "src/numpy_formathandler.pyx":97 + /* "src/numpy_formathandler.pyx":99 * if typeCode: * targetType = (self.gl_constant_to_array[ typeCode ]) * if array_descr(instance) != targetType: # <<<<<<<<<<<<<< * raise CopyError( * """Array of type %r passed, required array of type %r""", */ - if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 97, __pyx_L1_error) - __pyx_t_3 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(((PyArrayObject *)__pyx_v_instance))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) + if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(((PyArrayObject *)__pyx_v_instance))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_v_targetType), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_v_targetType), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_2)) { - /* "src/numpy_formathandler.pyx":98 + /* "src/numpy_formathandler.pyx":100 * targetType = (self.gl_constant_to_array[ typeCode ]) * if array_descr(instance) != targetType: * raise CopyError( # <<<<<<<<<<<<<< * """Array of type %r passed, required array of type %r""", * array_descr(instance).char, targetType.char, */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CopyError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CopyError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "src/numpy_formathandler.pyx":100 + /* "src/numpy_formathandler.pyx":102 * raise CopyError( * """Array of type %r passed, required array of type %r""", * array_descr(instance).char, targetType.char, # <<<<<<<<<<<<<< * ) * if not PyArray_ISCARRAY_RO( instance ): */ - if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 100, __pyx_L1_error) - __pyx_t_4 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(((PyArrayObject *)__pyx_v_instance))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L1_error) + if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_4 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(((PyArrayObject *)__pyx_v_instance))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_char); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_char); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_targetType), __pyx_n_s_char); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_targetType), __pyx_n_s_char); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -2620,7 +2626,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_kp_s_Array_of_type_r_passed_required, __pyx_t_5, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -2630,7 +2636,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_kp_s_Array_of_type_r_passed_required, __pyx_t_5, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -2638,7 +2644,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle } else #endif { - __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -2652,16 +2658,16 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_4); __pyx_t_5 = 0; __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 98, __pyx_L1_error) + __PYX_ERR(0, 100, __pyx_L1_error) - /* "src/numpy_formathandler.pyx":97 + /* "src/numpy_formathandler.pyx":99 * if typeCode: * targetType = (self.gl_constant_to_array[ typeCode ]) * if array_descr(instance) != targetType: # <<<<<<<<<<<<<< @@ -2670,7 +2676,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ } - /* "src/numpy_formathandler.pyx":95 + /* "src/numpy_formathandler.pyx":97 * cdef np.ndarray working = self.c_check_array( instance ) * cdef np.dtype targetType * if typeCode: # <<<<<<<<<<<<<< @@ -2679,48 +2685,48 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ } - /* "src/numpy_formathandler.pyx":102 + /* "src/numpy_formathandler.pyx":104 * array_descr(instance).char, targetType.char, * ) * if not PyArray_ISCARRAY_RO( instance ): # <<<<<<<<<<<<<< * raise CopyError( * """from_param received a non-contiguous array! %s"""%( */ - if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 102, __pyx_L1_error) + if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 104, __pyx_L1_error) __pyx_t_2 = ((!(PyArray_ISCARRAY_RO(((PyArrayObject *)__pyx_v_instance)) != 0)) != 0); if (unlikely(__pyx_t_2)) { - /* "src/numpy_formathandler.pyx":103 + /* "src/numpy_formathandler.pyx":105 * ) * if not PyArray_ISCARRAY_RO( instance ): * raise CopyError( # <<<<<<<<<<<<<< * """from_param received a non-contiguous array! %s"""%( * working, */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CopyError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CopyError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "src/numpy_formathandler.pyx":105 + /* "src/numpy_formathandler.pyx":107 * raise CopyError( * """from_param received a non-contiguous array! %s"""%( * working, # <<<<<<<<<<<<<< * ) * ) */ - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_v_working)); __Pyx_GIVEREF(((PyObject *)__pyx_v_working)); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_working)); - /* "src/numpy_formathandler.pyx":104 + /* "src/numpy_formathandler.pyx":106 * if not PyArray_ISCARRAY_RO( instance ): * raise CopyError( * """from_param received a non-contiguous array! %s"""%( # <<<<<<<<<<<<<< * working, * ) */ - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_from_param_received_a_non_contig, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_from_param_received_a_non_contig, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -2736,14 +2742,14 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 103, __pyx_L1_error) + __PYX_ERR(0, 105, __pyx_L1_error) - /* "src/numpy_formathandler.pyx":102 + /* "src/numpy_formathandler.pyx":104 * array_descr(instance).char, targetType.char, * ) * if not PyArray_ISCARRAY_RO( instance ): # <<<<<<<<<<<<<< @@ -2752,7 +2758,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ } - /* "src/numpy_formathandler.pyx":108 + /* "src/numpy_formathandler.pyx":110 * ) * ) * return c_void_p( PyArray_DATA(working)) # <<<<<<<<<<<<<< @@ -2760,9 +2766,9 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle * cdef c_dataPointer( self, object instance ): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_c_void_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_c_void_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_FromSize_t(((size_t)PyArray_DATA(__pyx_v_working))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_FromSize_t(((size_t)PyArray_DATA(__pyx_v_working))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -2777,14 +2783,14 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":91 + /* "src/numpy_formathandler.pyx":93 * return instance * * cdef c_from_param( self, object instance, object typeCode ): # <<<<<<<<<<<<<< @@ -2810,7 +2816,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":110 +/* "src/numpy_formathandler.pyx":112 * return c_void_p( PyArray_DATA(working)) * * cdef c_dataPointer( self, object instance ): # <<<<<<<<<<<<<< @@ -2825,7 +2831,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("c_dataPointer", 0); - /* "src/numpy_formathandler.pyx":112 + /* "src/numpy_formathandler.pyx":114 * cdef c_dataPointer( self, object instance ): * """Retrieve data-pointer directly""" * return PyArray_DATA(self.c_check_array( instance )) # <<<<<<<<<<<<<< @@ -2833,16 +2839,16 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle * """Create an array initialized to zeros""" */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_FromSize_t(((size_t)PyArray_DATA(((PyArrayObject *)__pyx_t_1)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(((size_t)PyArray_DATA(((PyArrayObject *)__pyx_t_1)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":110 + /* "src/numpy_formathandler.pyx":112 * return c_void_p( PyArray_DATA(working)) * * cdef c_dataPointer( self, object instance ): # <<<<<<<<<<<<<< @@ -2862,7 +2868,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":113 +/* "src/numpy_formathandler.pyx":115 * """Retrieve data-pointer directly""" * return PyArray_DATA(self.c_check_array( instance )) * cdef c_zeros( self, object dims, object typeCode ): # <<<<<<<<<<<<<< @@ -2893,7 +2899,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __Pyx_RefNannySetupContext("c_zeros", 0); __Pyx_INCREF(__pyx_v_dims); - /* "src/numpy_formathandler.pyx":116 + /* "src/numpy_formathandler.pyx":118 * """Create an array initialized to zeros""" * cdef np.ndarray c_dims * try: # <<<<<<<<<<<<<< @@ -2909,39 +2915,39 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "src/numpy_formathandler.pyx":118 + /* "src/numpy_formathandler.pyx":120 * try: * c_dims = PyArray_ContiguousFromAny( * [int(x) for x in dims], np.NPY_INTP, 1,1 # <<<<<<<<<<<<<< * ) * except (ValueError,TypeError), err: */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L3_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_v_dims)) || PyTuple_CheckExact(__pyx_v_dims)) { __pyx_t_5 = __pyx_v_dims; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L3_error) + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 118, __pyx_L3_error) + __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 120, __pyx_L3_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 118, __pyx_L3_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 120, __pyx_L3_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 118, __pyx_L3_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 120, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 118, __pyx_L3_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 120, __pyx_L3_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 118, __pyx_L3_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 120, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); #endif } @@ -2951,7 +2957,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 118, __pyx_L3_error) + else __PYX_ERR(0, 120, __pyx_L3_error) } break; } @@ -2959,27 +2965,27 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle } __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 118, __pyx_L3_error) + __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 120, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 118, __pyx_L3_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 120, __pyx_L3_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "src/numpy_formathandler.pyx":117 + /* "src/numpy_formathandler.pyx":119 * cdef np.ndarray c_dims * try: * c_dims = PyArray_ContiguousFromAny( # <<<<<<<<<<<<<< * [int(x) for x in dims], np.NPY_INTP, 1,1 * ) */ - __pyx_t_5 = ((PyObject *)PyArray_ContiguousFromAny(__pyx_t_4, NPY_INTP, 1, 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 117, __pyx_L3_error) + __pyx_t_5 = ((PyObject *)PyArray_ContiguousFromAny(__pyx_t_4, NPY_INTP, 1, 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_c_dims = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "src/numpy_formathandler.pyx":116 + /* "src/numpy_formathandler.pyx":118 * """Create an array initialized to zeros""" * cdef np.ndarray c_dims * try: # <<<<<<<<<<<<<< @@ -2996,7 +3002,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "src/numpy_formathandler.pyx":120 + /* "src/numpy_formathandler.pyx":122 * [int(x) for x in dims], np.NPY_INTP, 1,1 * ) * except (ValueError,TypeError), err: # <<<<<<<<<<<<<< @@ -3006,23 +3012,23 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_9) { __Pyx_AddTraceback("OpenGL_accelerate.numpy_formathandler.NumpyHandler.c_zeros", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_8) < 0) __PYX_ERR(0, 120, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_8) < 0) __PYX_ERR(0, 122, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_v_err = __pyx_t_4; - /* "src/numpy_formathandler.pyx":121 + /* "src/numpy_formathandler.pyx":123 * ) * except (ValueError,TypeError), err: * dims = (int(dims),) # <<<<<<<<<<<<<< * c_dims = PyArray_ContiguousFromAny( * dims, np.NPY_INTP, 1,1 */ - __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_v_dims); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 121, __pyx_L5_except_error) + __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_v_dims); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 123, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L5_except_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 123, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); @@ -3030,14 +3036,14 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __Pyx_DECREF_SET(__pyx_v_dims, __pyx_t_11); __pyx_t_11 = 0; - /* "src/numpy_formathandler.pyx":122 + /* "src/numpy_formathandler.pyx":124 * except (ValueError,TypeError), err: * dims = (int(dims),) * c_dims = PyArray_ContiguousFromAny( # <<<<<<<<<<<<<< * dims, np.NPY_INTP, 1,1 * ) */ - __pyx_t_11 = ((PyObject *)PyArray_ContiguousFromAny(__pyx_v_dims, NPY_INTP, 1, 1)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 122, __pyx_L5_except_error) + __pyx_t_11 = ((PyObject *)PyArray_ContiguousFromAny(__pyx_v_dims, NPY_INTP, 1, 1)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 124, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF_SET(__pyx_v_c_dims, ((PyArrayObject *)__pyx_t_11)); __pyx_t_11 = 0; @@ -3049,7 +3055,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "src/numpy_formathandler.pyx":116 + /* "src/numpy_formathandler.pyx":118 * """Create an array initialized to zeros""" * cdef np.ndarray c_dims * try: # <<<<<<<<<<<<<< @@ -3069,19 +3075,19 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_L8_try_end:; } - /* "src/numpy_formathandler.pyx":125 + /* "src/numpy_formathandler.pyx":127 * dims, np.NPY_INTP, 1,1 * ) * cdef np.dtype typecode = self.typeCodeToDtype( typeCode ) # <<<<<<<<<<<<<< * Py_INCREF( typecode ) * cdef np.npy_intp ndims = PyArray_SIZE(c_dims) */ - __pyx_t_8 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->typeCodeToDtype(__pyx_v_self, __pyx_v_typeCode)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_8 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->typeCodeToDtype(__pyx_v_self, __pyx_v_typeCode)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_typecode = ((PyArray_Descr *)__pyx_t_8); __pyx_t_8 = 0; - /* "src/numpy_formathandler.pyx":126 + /* "src/numpy_formathandler.pyx":128 * ) * cdef np.dtype typecode = self.typeCodeToDtype( typeCode ) * Py_INCREF( typecode ) # <<<<<<<<<<<<<< @@ -3090,7 +3096,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ Py_INCREF(((PyObject *)__pyx_v_typecode)); - /* "src/numpy_formathandler.pyx":127 + /* "src/numpy_formathandler.pyx":129 * cdef np.dtype typecode = self.typeCodeToDtype( typeCode ) * Py_INCREF( typecode ) * cdef np.npy_intp ndims = PyArray_SIZE(c_dims) # <<<<<<<<<<<<<< @@ -3099,19 +3105,19 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ __pyx_v_ndims = PyArray_SIZE(__pyx_v_c_dims); - /* "src/numpy_formathandler.pyx":128 + /* "src/numpy_formathandler.pyx":130 * Py_INCREF( typecode ) * cdef np.npy_intp ndims = PyArray_SIZE(c_dims) * cdef np.ndarray result = PyArray_Zeros( ndims, PyArray_DATA(c_dims), typecode, 0 ) # <<<<<<<<<<<<<< * # Py_INCREF( result ) * return result */ - __pyx_t_8 = ((PyObject *)PyArray_Zeros(((int)__pyx_v_ndims), ((npy_intp *)PyArray_DATA(__pyx_v_c_dims)), __pyx_v_typecode, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_8 = ((PyObject *)PyArray_Zeros(((int)__pyx_v_ndims), ((npy_intp *)PyArray_DATA(__pyx_v_c_dims)), __pyx_v_typecode, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_result = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "src/numpy_formathandler.pyx":130 + /* "src/numpy_formathandler.pyx":132 * cdef np.ndarray result = PyArray_Zeros( ndims, PyArray_DATA(c_dims), typecode, 0 ) * # Py_INCREF( result ) * return result # <<<<<<<<<<<<<< @@ -3123,7 +3129,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; - /* "src/numpy_formathandler.pyx":113 + /* "src/numpy_formathandler.pyx":115 * """Retrieve data-pointer directly""" * return PyArray_DATA(self.c_check_array( instance )) * cdef c_zeros( self, object dims, object typeCode ): # <<<<<<<<<<<<<< @@ -3152,7 +3158,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":131 +/* "src/numpy_formathandler.pyx":133 * # Py_INCREF( result ) * return result * cdef c_arraySize( self, object instance, object typeCode ): # <<<<<<<<<<<<<< @@ -3167,7 +3173,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("c_arraySize", 0); - /* "src/numpy_formathandler.pyx":133 + /* "src/numpy_formathandler.pyx":135 * cdef c_arraySize( self, object instance, object typeCode ): * """Retrieve array size reference""" * return (self.c_check_array( instance )).size # <<<<<<<<<<<<<< @@ -3175,16 +3181,16 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle * """Given a data-value, calculate number of bytes required to represent""" */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":131 + /* "src/numpy_formathandler.pyx":133 * # Py_INCREF( result ) * return result * cdef c_arraySize( self, object instance, object typeCode ): # <<<<<<<<<<<<<< @@ -3204,7 +3210,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":134 +/* "src/numpy_formathandler.pyx":136 * """Retrieve array size reference""" * return (self.c_check_array( instance )).size * cdef c_arrayByteCount( self, object instance ): # <<<<<<<<<<<<<< @@ -3218,7 +3224,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("c_arrayByteCount", 0); - /* "src/numpy_formathandler.pyx":136 + /* "src/numpy_formathandler.pyx":138 * cdef c_arrayByteCount( self, object instance ): * """Given a data-value, calculate number of bytes required to represent""" * return instance.nbytes # <<<<<<<<<<<<<< @@ -3226,13 +3232,13 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle * """Given a value, guess OpenGL type of the corresponding pointer""" */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_instance, __pyx_n_s_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_instance, __pyx_n_s_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":134 + /* "src/numpy_formathandler.pyx":136 * """Retrieve array size reference""" * return (self.c_check_array( instance )).size * cdef c_arrayByteCount( self, object instance ): # <<<<<<<<<<<<<< @@ -3251,7 +3257,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":137 +/* "src/numpy_formathandler.pyx":139 * """Given a data-value, calculate number of bytes required to represent""" * return instance.nbytes * cdef c_arrayToGLType( self, object instance ): # <<<<<<<<<<<<<< @@ -3271,19 +3277,19 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("c_arrayToGLType", 0); - /* "src/numpy_formathandler.pyx":139 + /* "src/numpy_formathandler.pyx":141 * cdef c_arrayToGLType( self, object instance ): * """Given a value, guess OpenGL type of the corresponding pointer""" * cdef np.ndarray value = self.c_check_array( instance ) # <<<<<<<<<<<<<< * cdef object constant = self.array_to_gl_constant.get( array_descr(value) ) * if constant is None: */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_value = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "src/numpy_formathandler.pyx":140 + /* "src/numpy_formathandler.pyx":142 * """Given a value, guess OpenGL type of the corresponding pointer""" * cdef np.ndarray value = self.c_check_array( instance ) * cdef object constant = self.array_to_gl_constant.get( array_descr(value) ) # <<<<<<<<<<<<<< @@ -3292,17 +3298,17 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ if (unlikely(__pyx_v_self->array_to_gl_constant == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 140, __pyx_L1_error) + __PYX_ERR(0, 142, __pyx_L1_error) } - __pyx_t_1 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_value)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_value)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->array_to_gl_constant, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->array_to_gl_constant, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_constant = __pyx_t_2; __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":141 + /* "src/numpy_formathandler.pyx":143 * cdef np.ndarray value = self.c_check_array( instance ) * cdef object constant = self.array_to_gl_constant.get( array_descr(value) ) * if constant is None: # <<<<<<<<<<<<<< @@ -3313,22 +3319,22 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_t_4 = (__pyx_t_3 != 0); if (unlikely(__pyx_t_4)) { - /* "src/numpy_formathandler.pyx":144 + /* "src/numpy_formathandler.pyx":146 * raise TypeError( * """Don't know GL type for array of type %r, known types: %s\nvalue:%s"""%( * array_descr(value), self.array_to_gl_constant.keys(), value, # <<<<<<<<<<<<<< * ) * ) */ - __pyx_t_2 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_value)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_value)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_v_self->array_to_gl_constant == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); - __PYX_ERR(0, 144, __pyx_L1_error) + __PYX_ERR(0, 146, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_self->array_to_gl_constant); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_self->array_to_gl_constant); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); @@ -3340,32 +3346,32 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_t_2 = 0; __pyx_t_1 = 0; - /* "src/numpy_formathandler.pyx":143 + /* "src/numpy_formathandler.pyx":145 * if constant is None: * raise TypeError( * """Don't know GL type for array of type %r, known types: %s\nvalue:%s"""%( # <<<<<<<<<<<<<< * array_descr(value), self.array_to_gl_constant.keys(), value, * ) */ - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Don_t_know_GL_type_for_array_of, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Don_t_know_GL_type_for_array_of, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "src/numpy_formathandler.pyx":142 + /* "src/numpy_formathandler.pyx":144 * cdef object constant = self.array_to_gl_constant.get( array_descr(value) ) * if constant is None: * raise TypeError( # <<<<<<<<<<<<<< * """Don't know GL type for array of type %r, known types: %s\nvalue:%s"""%( * array_descr(value), self.array_to_gl_constant.keys(), value, */ - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 142, __pyx_L1_error) + __PYX_ERR(0, 144, __pyx_L1_error) - /* "src/numpy_formathandler.pyx":141 + /* "src/numpy_formathandler.pyx":143 * cdef np.ndarray value = self.c_check_array( instance ) * cdef object constant = self.array_to_gl_constant.get( array_descr(value) ) * if constant is None: # <<<<<<<<<<<<<< @@ -3374,7 +3380,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ } - /* "src/numpy_formathandler.pyx":147 + /* "src/numpy_formathandler.pyx":149 * ) * ) * return constant # <<<<<<<<<<<<<< @@ -3386,7 +3392,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_r = __pyx_v_constant; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":137 + /* "src/numpy_formathandler.pyx":139 * """Given a data-value, calculate number of bytes required to represent""" * return instance.nbytes * cdef c_arrayToGLType( self, object instance ): # <<<<<<<<<<<<<< @@ -3409,74 +3415,175 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":148 +/* "src/numpy_formathandler.pyx":150 * ) * return constant * cdef c_asArray( self, object instance, object typeCode ): # <<<<<<<<<<<<<< * """Retrieve the given value as a (contiguous) array of type typeCode""" - * cdef np.ndarray working = (self.c_check_array( instance )) + * cdef np.ndarray working */ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler_c_asArray(struct __pyx_obj_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *__pyx_v_self, PyObject *__pyx_v_instance, PyObject *__pyx_v_typeCode) { PyArrayObject *__pyx_v_working = 0; PyArray_Descr *__pyx_v_typecode = 0; + int __pyx_v_res; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; + PyObject *__pyx_t_3 = NULL; int __pyx_t_4; __Pyx_RefNannySetupContext("c_asArray", 0); - /* "src/numpy_formathandler.pyx":150 - * cdef c_asArray( self, object instance, object typeCode ): - * """Retrieve the given value as a (contiguous) array of type typeCode""" - * cdef np.ndarray working = (self.c_check_array( instance )) # <<<<<<<<<<<<<< + /* "src/numpy_formathandler.pyx":155 * cdef np.dtype typecode - * if typeCode is None: + * cdef int res + * if PyArray_CheckScalar(instance): # <<<<<<<<<<<<<< + * Py_INCREF(instance) + * working = self.c_zeros((1,), typeCode) */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_t_1; - __Pyx_INCREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_working = ((PyArrayObject *)__pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_1 = (PyArray_CheckScalar(__pyx_v_instance) != 0); + if (__pyx_t_1) { + + /* "src/numpy_formathandler.pyx":156 + * cdef int res + * if PyArray_CheckScalar(instance): + * Py_INCREF(instance) # <<<<<<<<<<<<<< + * working = self.c_zeros((1,), typeCode) + * res = PyArray_FillWithScalar(working, instance) + */ + Py_INCREF(__pyx_v_instance); + + /* "src/numpy_formathandler.pyx":157 + * if PyArray_CheckScalar(instance): + * Py_INCREF(instance) + * working = self.c_zeros((1,), typeCode) # <<<<<<<<<<<<<< + * res = PyArray_FillWithScalar(working, instance) + * if res < -1: + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.c_zeros(((struct __pyx_obj_17OpenGL_accelerate_13formathandler_FormatHandler *)__pyx_v_self), __pyx_tuple_, __pyx_v_typeCode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_v_working = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/numpy_formathandler.pyx":158 + * Py_INCREF(instance) + * working = self.c_zeros((1,), typeCode) + * res = PyArray_FillWithScalar(working, instance) # <<<<<<<<<<<<<< + * if res < -1: + * raise ValueError("Unable to fill new array with value %r (%s)"%(instance,instance.__class__)) + */ + __pyx_v_res = PyArray_FillWithScalar(((PyObject *)__pyx_v_working), __pyx_v_instance); + + /* "src/numpy_formathandler.pyx":159 + * working = self.c_zeros((1,), typeCode) + * res = PyArray_FillWithScalar(working, instance) + * if res < -1: # <<<<<<<<<<<<<< + * raise ValueError("Unable to fill new array with value %r (%s)"%(instance,instance.__class__)) + * else: + */ + __pyx_t_1 = ((__pyx_v_res < -1L) != 0); + if (unlikely(__pyx_t_1)) { - /* "src/numpy_formathandler.pyx":152 - * cdef np.ndarray working = (self.c_check_array( instance )) + /* "src/numpy_formathandler.pyx":160 + * res = PyArray_FillWithScalar(working, instance) + * if res < -1: + * raise ValueError("Unable to fill new array with value %r (%s)"%(instance,instance.__class__)) # <<<<<<<<<<<<<< + * else: + * working = (self.c_check_array( instance )) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_instance, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_instance); + __Pyx_GIVEREF(__pyx_v_instance); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_instance); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Unable_to_fill_new_array_with_va, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 160, __pyx_L1_error) + + /* "src/numpy_formathandler.pyx":159 + * working = self.c_zeros((1,), typeCode) + * res = PyArray_FillWithScalar(working, instance) + * if res < -1: # <<<<<<<<<<<<<< + * raise ValueError("Unable to fill new array with value %r (%s)"%(instance,instance.__class__)) + * else: + */ + } + + /* "src/numpy_formathandler.pyx":155 * cdef np.dtype typecode + * cdef int res + * if PyArray_CheckScalar(instance): # <<<<<<<<<<<<<< + * Py_INCREF(instance) + * working = self.c_zeros((1,), typeCode) + */ + goto __pyx_L3; + } + + /* "src/numpy_formathandler.pyx":162 + * raise ValueError("Unable to fill new array with value %r (%s)"%(instance,instance.__class__)) + * else: + * working = (self.c_check_array( instance )) # <<<<<<<<<<<<<< + * if typeCode is None: + * typecode = array_descr(working) + */ + /*else*/ { + __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_t_3; + __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_working = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + } + __pyx_L3:; + + /* "src/numpy_formathandler.pyx":163 + * else: + * working = (self.c_check_array( instance )) * if typeCode is None: # <<<<<<<<<<<<<< * typecode = array_descr(working) * else: */ - __pyx_t_3 = (__pyx_v_typeCode == Py_None); - __pyx_t_4 = (__pyx_t_3 != 0); + __pyx_t_1 = (__pyx_v_typeCode == Py_None); + __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { - /* "src/numpy_formathandler.pyx":153 - * cdef np.dtype typecode + /* "src/numpy_formathandler.pyx":164 + * working = (self.c_check_array( instance )) * if typeCode is None: * typecode = array_descr(working) # <<<<<<<<<<<<<< * else: * typecode = self.typeCodeToDtype( typeCode ) */ - __pyx_t_2 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_working)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_working)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_typecode = ((PyArray_Descr *)__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":152 - * cdef np.ndarray working = (self.c_check_array( instance )) - * cdef np.dtype typecode + /* "src/numpy_formathandler.pyx":163 + * else: + * working = (self.c_check_array( instance )) * if typeCode is None: # <<<<<<<<<<<<<< * typecode = array_descr(working) * else: */ - goto __pyx_L3; + goto __pyx_L5; } - /* "src/numpy_formathandler.pyx":155 + /* "src/numpy_formathandler.pyx":166 * typecode = array_descr(working) * else: * typecode = self.typeCodeToDtype( typeCode ) # <<<<<<<<<<<<<< @@ -3484,14 +3591,14 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle * cdef c_unitSize( self, object instance, typeCode ): */ /*else*/ { - __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->typeCodeToDtype(__pyx_v_self, __pyx_v_typeCode)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->typeCodeToDtype(__pyx_v_self, __pyx_v_typeCode)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_typecode = ((PyArray_Descr *)__pyx_t_2); __pyx_t_2 = 0; } - __pyx_L3:; + __pyx_L5:; - /* "src/numpy_formathandler.pyx":156 + /* "src/numpy_formathandler.pyx":167 * else: * typecode = self.typeCodeToDtype( typeCode ) * return self.contiguous( working, typecode ) # <<<<<<<<<<<<<< @@ -3499,24 +3606,24 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle * """Retrieve last dimension of the array""" */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->contiguous(__pyx_v_self, __pyx_v_working, __pyx_v_typecode)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->contiguous(__pyx_v_self, __pyx_v_working, __pyx_v_typecode)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":148 + /* "src/numpy_formathandler.pyx":150 * ) * return constant * cdef c_asArray( self, object instance, object typeCode ): # <<<<<<<<<<<<<< * """Retrieve the given value as a (contiguous) array of type typeCode""" - * cdef np.ndarray working = (self.c_check_array( instance )) + * cdef np.ndarray working */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("OpenGL_accelerate.numpy_formathandler.NumpyHandler.c_asArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -3527,7 +3634,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":157 +/* "src/numpy_formathandler.pyx":168 * typecode = self.typeCodeToDtype( typeCode ) * return self.contiguous( working, typecode ) * cdef c_unitSize( self, object instance, typeCode ): # <<<<<<<<<<<<<< @@ -3541,7 +3648,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("c_unitSize", 0); - /* "src/numpy_formathandler.pyx":159 + /* "src/numpy_formathandler.pyx":170 * cdef c_unitSize( self, object instance, typeCode ): * """Retrieve last dimension of the array""" * return PyArray_DIM(instance, PyArray_NDIM(instance)-1) # <<<<<<<<<<<<<< @@ -3549,15 +3656,15 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle * """Retrieve full set of dimensions for the array as tuple""" */ __Pyx_XDECREF(__pyx_r); - if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 159, __pyx_L1_error) - if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 159, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(PyArray_DIM(((PyArrayObject *)__pyx_v_instance), (PyArray_NDIM(((PyArrayObject *)__pyx_v_instance)) - 1))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) + if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 170, __pyx_L1_error) + if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(PyArray_DIM(((PyArrayObject *)__pyx_v_instance), (PyArray_NDIM(((PyArrayObject *)__pyx_v_instance)) - 1))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":157 + /* "src/numpy_formathandler.pyx":168 * typecode = self.typeCodeToDtype( typeCode ) * return self.contiguous( working, typecode ) * cdef c_unitSize( self, object instance, typeCode ): # <<<<<<<<<<<<<< @@ -3576,7 +3683,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":160 +/* "src/numpy_formathandler.pyx":171 * """Retrieve last dimension of the array""" * return PyArray_DIM(instance, PyArray_NDIM(instance)-1) * cdef c_dimensions( self, object instance ): # <<<<<<<<<<<<<< @@ -3590,7 +3697,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("c_dimensions", 0); - /* "src/numpy_formathandler.pyx":162 + /* "src/numpy_formathandler.pyx":173 * cdef c_dimensions( self, object instance ): * """Retrieve full set of dimensions for the array as tuple""" * return instance.shape # <<<<<<<<<<<<<< @@ -3598,13 +3705,13 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle * cdef np.dtype typeCodeToDtype( self, object typeCode ): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_instance, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_instance, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":160 + /* "src/numpy_formathandler.pyx":171 * """Retrieve last dimension of the array""" * return PyArray_DIM(instance, PyArray_NDIM(instance)-1) * cdef c_dimensions( self, object instance ): # <<<<<<<<<<<<<< @@ -3623,7 +3730,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":164 +/* "src/numpy_formathandler.pyx":175 * return instance.shape * * cdef np.dtype typeCodeToDtype( self, object typeCode ): # <<<<<<<<<<<<<< @@ -3641,7 +3748,7 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH int __pyx_t_5; __Pyx_RefNannySetupContext("typeCodeToDtype", 0); - /* "src/numpy_formathandler.pyx":166 + /* "src/numpy_formathandler.pyx":177 * cdef np.dtype typeCodeToDtype( self, object typeCode ): * """Convert type-code specification to a numpy dtype instance""" * if isinstance( typeCode, np.dtype ): # <<<<<<<<<<<<<< @@ -3652,7 +3759,7 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "src/numpy_formathandler.pyx":167 + /* "src/numpy_formathandler.pyx":178 * """Convert type-code specification to a numpy dtype instance""" * if isinstance( typeCode, np.dtype ): * return typeCode # <<<<<<<<<<<<<< @@ -3660,12 +3767,12 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH * return np.dtype( typeCode ) */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - if (!(likely(((__pyx_v_typeCode) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_typeCode, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(0, 167, __pyx_L1_error) + if (!(likely(((__pyx_v_typeCode) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_typeCode, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_INCREF(__pyx_v_typeCode); __pyx_r = ((PyArray_Descr *)__pyx_v_typeCode); goto __pyx_L0; - /* "src/numpy_formathandler.pyx":166 + /* "src/numpy_formathandler.pyx":177 * cdef np.dtype typeCodeToDtype( self, object typeCode ): * """Convert type-code specification to a numpy dtype instance""" * if isinstance( typeCode, np.dtype ): # <<<<<<<<<<<<<< @@ -3674,16 +3781,16 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ } - /* "src/numpy_formathandler.pyx":168 + /* "src/numpy_formathandler.pyx":179 * if isinstance( typeCode, np.dtype ): * return typeCode * elif isinstance( typeCode, (bytes,unicode) ): # <<<<<<<<<<<<<< * return np.dtype( typeCode ) * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_IsInstance(__pyx_v_typeCode, __pyx_t_3); __pyx_t_5 = (__pyx_t_1 != 0); @@ -3701,7 +3808,7 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "src/numpy_formathandler.pyx":169 + /* "src/numpy_formathandler.pyx":180 * return typeCode * elif isinstance( typeCode, (bytes,unicode) ): * return np.dtype( typeCode ) # <<<<<<<<<<<<<< @@ -3709,13 +3816,13 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH * return self.gl_constant_to_array[ typeCode ] */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_v_typeCode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_v_typeCode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":168 + /* "src/numpy_formathandler.pyx":179 * if isinstance( typeCode, np.dtype ): * return typeCode * elif isinstance( typeCode, (bytes,unicode) ): # <<<<<<<<<<<<<< @@ -3724,7 +3831,7 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ } - /* "src/numpy_formathandler.pyx":171 + /* "src/numpy_formathandler.pyx":182 * return np.dtype( typeCode ) * else: * return self.gl_constant_to_array[ typeCode ] # <<<<<<<<<<<<<< @@ -3735,17 +3842,17 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __Pyx_XDECREF(((PyObject *)__pyx_r)); if (unlikely(__pyx_v_self->gl_constant_to_array == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 171, __pyx_L1_error) + __PYX_ERR(0, 182, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->gl_constant_to_array, __pyx_v_typeCode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->gl_constant_to_array, __pyx_v_typeCode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(0, 171, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(0, 182, __pyx_L1_error) __pyx_r = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } - /* "src/numpy_formathandler.pyx":164 + /* "src/numpy_formathandler.pyx":175 * return instance.shape * * cdef np.dtype typeCodeToDtype( self, object typeCode ): # <<<<<<<<<<<<<< @@ -3765,7 +3872,7 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH return __pyx_r; } -/* "src/numpy_formathandler.pyx":172 +/* "src/numpy_formathandler.pyx":183 * else: * return self.gl_constant_to_array[ typeCode ] * cdef np.ndarray contiguous( self, np.ndarray instance, np.dtype dtype ): # <<<<<<<<<<<<<< @@ -3787,7 +3894,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH int __pyx_t_9; __Pyx_RefNannySetupContext("contiguous", 0); - /* "src/numpy_formathandler.pyx":182 + /* "src/numpy_formathandler.pyx":193 * :rtype: np.ndarray * """ * if self.ERROR_ON_COPY: # <<<<<<<<<<<<<< @@ -3797,7 +3904,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __pyx_t_1 = (__pyx_v_self->__pyx_base.ERROR_ON_COPY != 0); if (__pyx_t_1) { - /* "src/numpy_formathandler.pyx":183 + /* "src/numpy_formathandler.pyx":194 * """ * if self.ERROR_ON_COPY: * if not PyArray_ISCARRAY_RO( instance ): # <<<<<<<<<<<<<< @@ -3807,17 +3914,17 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __pyx_t_1 = ((!(PyArray_ISCARRAY_RO(__pyx_v_instance) != 0)) != 0); if (unlikely(__pyx_t_1)) { - /* "src/numpy_formathandler.pyx":184 + /* "src/numpy_formathandler.pyx":195 * if self.ERROR_ON_COPY: * if not PyArray_ISCARRAY_RO( instance ): * raise CopyError( # <<<<<<<<<<<<<< * """Non-contiguous array passed""", * instance, */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CopyError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CopyError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "src/numpy_formathandler.pyx":186 + /* "src/numpy_formathandler.pyx":197 * raise CopyError( * """Non-contiguous array passed""", * instance, # <<<<<<<<<<<<<< @@ -3839,7 +3946,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_Non_contiguous_array_passed, ((PyObject *)__pyx_v_instance)}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -3847,13 +3954,13 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_Non_contiguous_array_passed, ((PyObject *)__pyx_v_instance)}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -3864,16 +3971,16 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __Pyx_INCREF(((PyObject *)__pyx_v_instance)); __Pyx_GIVEREF(((PyObject *)__pyx_v_instance)); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_instance)); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 184, __pyx_L1_error) + __PYX_ERR(0, 195, __pyx_L1_error) - /* "src/numpy_formathandler.pyx":183 + /* "src/numpy_formathandler.pyx":194 * """ * if self.ERROR_ON_COPY: * if not PyArray_ISCARRAY_RO( instance ): # <<<<<<<<<<<<<< @@ -3882,44 +3989,44 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ } - /* "src/numpy_formathandler.pyx":188 + /* "src/numpy_formathandler.pyx":199 * instance, * ) * elif array_descr(instance) != dtype: # <<<<<<<<<<<<<< * raise CopyError( * """Array of type %r passed, required array of type %r""", */ - __pyx_t_2 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_instance)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_instance)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_v_dtype), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_v_dtype), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_1)) { - /* "src/numpy_formathandler.pyx":189 + /* "src/numpy_formathandler.pyx":200 * ) * elif array_descr(instance) != dtype: * raise CopyError( # <<<<<<<<<<<<<< * """Array of type %r passed, required array of type %r""", * array_descr(instance).char, dtype.char, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CopyError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CopyError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "src/numpy_formathandler.pyx":191 + /* "src/numpy_formathandler.pyx":202 * raise CopyError( * """Array of type %r passed, required array of type %r""", * array_descr(instance).char, dtype.char, # <<<<<<<<<<<<<< * ) * # okay, so just return... */ - __pyx_t_6 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_instance)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_6 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_instance)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_char); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_char); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dtype), __pyx_n_s_char); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dtype), __pyx_n_s_char); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_5 = 0; @@ -3936,7 +4043,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_kp_s_Array_of_type_r_passed_required, __pyx_t_4, __pyx_t_6}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -3946,7 +4053,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_kp_s_Array_of_type_r_passed_required, __pyx_t_4, __pyx_t_6}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -3954,7 +4061,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH } else #endif { - __pyx_t_8 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -3968,16 +4075,16 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_5, __pyx_t_6); __pyx_t_4 = 0; __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 189, __pyx_L1_error) + __PYX_ERR(0, 200, __pyx_L1_error) - /* "src/numpy_formathandler.pyx":188 + /* "src/numpy_formathandler.pyx":199 * instance, * ) * elif array_descr(instance) != dtype: # <<<<<<<<<<<<<< @@ -3986,7 +4093,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ } - /* "src/numpy_formathandler.pyx":194 + /* "src/numpy_formathandler.pyx":205 * ) * # okay, so just return... * return instance # <<<<<<<<<<<<<< @@ -3998,7 +4105,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __pyx_r = __pyx_v_instance; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":182 + /* "src/numpy_formathandler.pyx":193 * :rtype: np.ndarray * """ * if self.ERROR_ON_COPY: # <<<<<<<<<<<<<< @@ -4007,31 +4114,73 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ } - /* "src/numpy_formathandler.pyx":197 + /* "src/numpy_formathandler.pyx":208 * else: * # "convert" regardless (will return same instance if already contiguous) + * if PyArray_CheckScalar(instance): # <<<<<<<<<<<<<< + * Py_INCREF( instance ) + * return PyArray_EnsureArray(instance) + */ + /*else*/ { + __pyx_t_1 = (PyArray_CheckScalar(((PyObject *)__pyx_v_instance)) != 0); + if (__pyx_t_1) { + + /* "src/numpy_formathandler.pyx":209 + * # "convert" regardless (will return same instance if already contiguous) + * if PyArray_CheckScalar(instance): + * Py_INCREF( instance ) # <<<<<<<<<<<<<< + * return PyArray_EnsureArray(instance) + * if not PyArray_ISCARRAY_RO( instance ) or array_descr(instance) != dtype: + */ + Py_INCREF(((PyObject *)__pyx_v_instance)); + + /* "src/numpy_formathandler.pyx":210 + * if PyArray_CheckScalar(instance): + * Py_INCREF( instance ) + * return PyArray_EnsureArray(instance) # <<<<<<<<<<<<<< + * if not PyArray_ISCARRAY_RO( instance ) or array_descr(instance) != dtype: + * # TODO: make sure there's no way to segfault here + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_3 = ((PyObject *)PyArray_EnsureArray(((PyObject *)__pyx_v_instance))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/numpy_formathandler.pyx":208 + * else: + * # "convert" regardless (will return same instance if already contiguous) + * if PyArray_CheckScalar(instance): # <<<<<<<<<<<<<< + * Py_INCREF( instance ) + * return PyArray_EnsureArray(instance) + */ + } + + /* "src/numpy_formathandler.pyx":211 + * Py_INCREF( instance ) + * return PyArray_EnsureArray(instance) * if not PyArray_ISCARRAY_RO( instance ) or array_descr(instance) != dtype: # <<<<<<<<<<<<<< * # TODO: make sure there's no way to segfault here * Py_INCREF( instance ) */ - /*else*/ { __pyx_t_9 = ((!(PyArray_ISCARRAY_RO(__pyx_v_instance) != 0)) != 0); if (!__pyx_t_9) { } else { __pyx_t_1 = __pyx_t_9; - goto __pyx_L6_bool_binop_done; + goto __pyx_L7_bool_binop_done; } - __pyx_t_3 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_instance)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_instance)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_v_dtype), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_v_dtype), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_9; - __pyx_L6_bool_binop_done:; + __pyx_L7_bool_binop_done:; if (__pyx_t_1) { - /* "src/numpy_formathandler.pyx":199 + /* "src/numpy_formathandler.pyx":213 * if not PyArray_ISCARRAY_RO( instance ) or array_descr(instance) != dtype: * # TODO: make sure there's no way to segfault here * Py_INCREF( instance ) # <<<<<<<<<<<<<< @@ -4040,7 +4189,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ Py_INCREF(((PyObject *)__pyx_v_instance)); - /* "src/numpy_formathandler.pyx":200 + /* "src/numpy_formathandler.pyx":214 * # TODO: make sure there's no way to segfault here * Py_INCREF( instance ) * Py_INCREF( dtype ) # <<<<<<<<<<<<<< @@ -4049,7 +4198,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ Py_INCREF(((PyObject *)__pyx_v_dtype)); - /* "src/numpy_formathandler.pyx":201 + /* "src/numpy_formathandler.pyx":215 * Py_INCREF( instance ) * Py_INCREF( dtype ) * return PyArray_FromArray( # <<<<<<<<<<<<<< @@ -4058,29 +4207,29 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - /* "src/numpy_formathandler.pyx":204 + /* "src/numpy_formathandler.pyx":218 * instance, * dtype, * NPY_ARRAY_CARRAY|NPY_ARRAY_FORCECAST # <<<<<<<<<<<<<< * ) * */ - __pyx_t_2 = ((PyObject *)PyArray_FromArray(__pyx_v_instance, __pyx_v_dtype, (NPY_ARRAY_CARRAY | NPY_ARRAY_FORCECAST))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)PyArray_FromArray(__pyx_v_instance, __pyx_v_dtype, (NPY_ARRAY_CARRAY | NPY_ARRAY_FORCECAST))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":197 - * else: - * # "convert" regardless (will return same instance if already contiguous) + /* "src/numpy_formathandler.pyx":211 + * Py_INCREF( instance ) + * return PyArray_EnsureArray(instance) * if not PyArray_ISCARRAY_RO( instance ) or array_descr(instance) != dtype: # <<<<<<<<<<<<<< * # TODO: make sure there's no way to segfault here * Py_INCREF( instance ) */ } - /* "src/numpy_formathandler.pyx":208 + /* "src/numpy_formathandler.pyx":222 * * else: * return instance # <<<<<<<<<<<<<< @@ -4095,7 +4244,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH } } - /* "src/numpy_formathandler.pyx":172 + /* "src/numpy_formathandler.pyx":183 * else: * return self.gl_constant_to_array[ typeCode ] * cdef np.ndarray contiguous( self, np.ndarray instance, np.dtype dtype ): # <<<<<<<<<<<<<< @@ -4119,7 +4268,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH return __pyx_r; } -/* "src/numpy_formathandler.pyx":37 +/* "src/numpy_formathandler.pyx":40 * * cdef class NumpyHandler(FormatHandler): * cdef public dict array_to_gl_constant # <<<<<<<<<<<<<< @@ -4174,7 +4323,7 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler_20a __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__set__", 0); - if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 37, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 40, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -4224,7 +4373,7 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler_20a return __pyx_r; } -/* "src/numpy_formathandler.pyx":38 +/* "src/numpy_formathandler.pyx":41 * cdef class NumpyHandler(FormatHandler): * cdef public dict array_to_gl_constant * cdef public dict gl_constant_to_array # <<<<<<<<<<<<<< @@ -4279,7 +4428,7 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler_20g __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__set__", 0); - if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 38, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 41, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -5163,7 +5312,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 272, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5219,7 +5368,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * * info.buf = PyArray_DATA(self) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 276, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5477,7 +5626,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 306, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -6357,7 +6506,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 856, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -6425,7 +6574,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 860, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -6534,7 +6683,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 880, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -7162,7 +7311,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1038, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1038, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -7291,7 +7440,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1044, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1044, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -7417,7 +7566,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1050, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1050, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -7684,6 +7833,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_fill_new_array_with_va, __pyx_k_Unable_to_fill_new_array_with_va, sizeof(__pyx_k_Unable_to_fill_new_array_with_va), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_a_to_gl, __pyx_k_a_to_gl, sizeof(__pyx_k_a_to_gl), 0, 0, 1, 1}, {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, @@ -7691,6 +7841,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_bytes_2, __pyx_k_bytes_2, sizeof(__pyx_k_bytes_2), 0, 0, 1, 1}, {&__pyx_n_s_c_void_p, __pyx_k_c_void_p, sizeof(__pyx_k_c_void_p), 0, 0, 1, 1}, {&__pyx_n_s_char, __pyx_k_char, sizeof(__pyx_k_char), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_complex128, __pyx_k_complex128, sizeof(__pyx_k_complex128), 0, 0, 1, 1}, {&__pyx_n_s_complex256, __pyx_k_complex256, sizeof(__pyx_k_complex256), 0, 0, 1, 1}, @@ -7757,8 +7908,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 85, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 122, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(2, 285, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 856, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1038, __pyx_L1_error) @@ -7771,6 +7922,17 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + /* "src/numpy_formathandler.pyx":157 + * if PyArray_CheckScalar(instance): + * Py_INCREF(instance) + * working = self.c_zeros((1,), typeCode) # <<<<<<<<<<<<<< + * res = PyArray_FillWithScalar(working, instance) + * if res < -1: + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + /* "../../../.local/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): @@ -7778,9 +7940,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(2, 272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(2, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); /* "../../../.local/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) @@ -7789,9 +7951,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(2, 276, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); /* "../../../.local/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306 * if ((descr.byteorder == c'>' and little_endian) or @@ -7800,9 +7962,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); /* "../../../.local/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856 * @@ -7811,9 +7973,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); /* "../../../.local/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880 * t = child.type_num @@ -7822,9 +7984,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 880, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); /* "../../../.local/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038 * _import_array() @@ -7833,9 +7995,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * cdef inline int import_umath() except -1: */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 1038, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 1038, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); /* "../../../.local/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044 * _import_umath() @@ -7844,19 +8006,19 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 1044, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 1044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); /* "(tree fragment)":1 * def __pyx_unpickle_NumpyHandler(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ - __pyx_tuple__8 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_NumpyHandler, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_NumpyHandler, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -7868,6 +8030,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type; if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_67406576 = PyInt_FromLong(67406576L); if (unlikely(!__pyx_int_67406576)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -7931,14 +8094,14 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler.typeCodeToDtype = (PyArray_Descr *(*)(struct __pyx_obj_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *, PyObject *))__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler_typeCodeToDtype; __pyx_vtable_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler.contiguous = (PyArrayObject *(*)(struct __pyx_obj_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *, PyArrayObject *, PyArray_Descr *))__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler_contiguous; __pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler.tp_base = __pyx_ptype_17OpenGL_accelerate_13formathandler_FormatHandler; - if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler) < 0) __PYX_ERR(0, 36, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler.tp_dictoffset && __pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_SetVtable(__pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler.tp_dict, __pyx_vtabptr_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler) < 0) __PYX_ERR(0, 36, __pyx_L1_error) - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NumpyHandler, (PyObject *)&__pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler) < 0) __PYX_ERR(0, 36, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler) < 0) __PYX_ERR(0, 36, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler.tp_dict, __pyx_vtabptr_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NumpyHandler, (PyObject *)&__pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler = &__pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); @@ -8320,297 +8483,297 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":39 + /* "src/numpy_formathandler.pyx":42 * cdef public dict array_to_gl_constant * cdef public dict gl_constant_to_array * isOutput = True # <<<<<<<<<<<<<< * HANDLED_TYPES = ( * np.ndarray, */ - if (PyDict_SetItem((PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler->tp_dict, __pyx_n_s_isOutput, Py_True) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler->tp_dict, __pyx_n_s_isOutput, Py_True) < 0) __PYX_ERR(0, 42, __pyx_L1_error) PyType_Modified(__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler); - /* "src/numpy_formathandler.pyx":42 + /* "src/numpy_formathandler.pyx":45 * HANDLED_TYPES = ( * np.ndarray, * np.bool_, # <<<<<<<<<<<<<< * np.int8, * np.uint8, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":43 + /* "src/numpy_formathandler.pyx":46 * np.ndarray, * np.bool_, * np.int8, # <<<<<<<<<<<<<< * np.uint8, * np.int16, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":44 + /* "src/numpy_formathandler.pyx":47 * np.bool_, * np.int8, * np.uint8, # <<<<<<<<<<<<<< * np.int16, * np.uint16, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":45 + /* "src/numpy_formathandler.pyx":48 * np.int8, * np.uint8, * np.int16, # <<<<<<<<<<<<<< * np.uint16, * np.int32, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":46 + /* "src/numpy_formathandler.pyx":49 * np.uint8, * np.int16, * np.uint16, # <<<<<<<<<<<<<< * np.int32, * np.uint32, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":47 + /* "src/numpy_formathandler.pyx":50 * np.int16, * np.uint16, * np.int32, # <<<<<<<<<<<<<< * np.uint32, * np.int64, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":48 + /* "src/numpy_formathandler.pyx":51 * np.uint16, * np.int32, * np.uint32, # <<<<<<<<<<<<<< * np.int64, * np.uint64, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":49 + /* "src/numpy_formathandler.pyx":52 * np.int32, * np.uint32, * np.int64, # <<<<<<<<<<<<<< * np.uint64, * np.int64, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":50 + /* "src/numpy_formathandler.pyx":53 * np.uint32, * np.int64, * np.uint64, # <<<<<<<<<<<<<< * np.int64, * np.uint64, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint64); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 50, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint64); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":51 + /* "src/numpy_formathandler.pyx":54 * np.int64, * np.uint64, * np.int64, # <<<<<<<<<<<<<< * np.uint64, * np.float16, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":52 + /* "src/numpy_formathandler.pyx":55 * np.uint64, * np.int64, * np.uint64, # <<<<<<<<<<<<<< * np.float16, * np.float32, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint64); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint64); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":53 + /* "src/numpy_formathandler.pyx":56 * np.int64, * np.uint64, * np.float16, # <<<<<<<<<<<<<< * np.float32, * np.float64, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float16); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float16); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":54 + /* "src/numpy_formathandler.pyx":57 * np.uint64, * np.float16, * np.float32, # <<<<<<<<<<<<<< * np.float64, * np.complex64, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":55 + /* "src/numpy_formathandler.pyx":58 * np.float16, * np.float32, * np.float64, # <<<<<<<<<<<<<< * np.complex64, * np.complex128, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":56 + /* "src/numpy_formathandler.pyx":59 * np.float32, * np.float64, * np.complex64, # <<<<<<<<<<<<<< * np.complex128, * np.bytes_, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_complex64); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_complex64); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":57 + /* "src/numpy_formathandler.pyx":60 * np.float64, * np.complex64, * np.complex128, # <<<<<<<<<<<<<< * np.bytes_, * np.str_, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_complex128); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_complex128); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":58 + /* "src/numpy_formathandler.pyx":61 * np.complex64, * np.complex128, * np.bytes_, # <<<<<<<<<<<<<< * np.str_, * np.void, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bytes_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bytes_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":59 + /* "src/numpy_formathandler.pyx":62 * np.complex128, * np.bytes_, * np.str_, # <<<<<<<<<<<<<< * np.void, * np.datetime64, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_str); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_str); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":60 + /* "src/numpy_formathandler.pyx":63 * np.bytes_, * np.str_, * np.void, # <<<<<<<<<<<<<< * np.datetime64, * np.timedelta64, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_void); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_void); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":61 + /* "src/numpy_formathandler.pyx":64 * np.str_, * np.void, * np.datetime64, # <<<<<<<<<<<<<< * np.timedelta64, * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":62 + /* "src/numpy_formathandler.pyx":65 * np.void, * np.datetime64, * np.timedelta64, # <<<<<<<<<<<<<< * ) * if hasattr(np,'float128'): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":41 + /* "src/numpy_formathandler.pyx":44 * isOutput = True * HANDLED_TYPES = ( * np.ndarray, # <<<<<<<<<<<<<< * np.bool_, * np.int8, */ - __pyx_t_2 = PyTuple_New(22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_5numpy_ndarray)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5numpy_ndarray)); @@ -8678,52 +8841,52 @@ if (!__Pyx_RefNanny) { __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler->tp_dict, __pyx_n_s_HANDLED_TYPES, __pyx_t_2) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler->tp_dict, __pyx_n_s_HANDLED_TYPES, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler); - /* "src/numpy_formathandler.pyx":64 + /* "src/numpy_formathandler.pyx":67 * np.timedelta64, * ) * if hasattr(np,'float128'): # <<<<<<<<<<<<<< * HANDLED_TYPES += (np.float128,) * if hasattr(np,'complex256'): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_23 = __Pyx_HasAttr(__pyx_t_2, __pyx_n_s_float128); if (unlikely(__pyx_t_23 == ((int)-1))) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_23 = __Pyx_HasAttr(__pyx_t_2, __pyx_n_s_float128); if (unlikely(__pyx_t_23 == ((int)-1))) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_24 = (__pyx_t_23 != 0); if (__pyx_t_24) { - /* "src/numpy_formathandler.pyx":65 + /* "src/numpy_formathandler.pyx":68 * ) * if hasattr(np,'float128'): * HANDLED_TYPES += (np.float128,) # <<<<<<<<<<<<<< * if hasattr(np,'complex256'): * HANDLED_TYPES += (np.complex256,) */ - __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler, __pyx_n_s_HANDLED_TYPES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler, __pyx_n_s_HANDLED_TYPES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_22, __pyx_n_s_np); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_22, __pyx_n_s_np); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); - __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_22, __pyx_n_s_float128); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_22, __pyx_n_s_float128); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - __pyx_t_22 = PyTuple_New(1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_22 = PyTuple_New(1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_21); __pyx_t_21 = 0; - __pyx_t_21 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_22); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_21 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_22); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler->tp_dict, __pyx_n_s_HANDLED_TYPES, __pyx_t_21) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler->tp_dict, __pyx_n_s_HANDLED_TYPES, __pyx_t_21) < 0) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; PyType_Modified(__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler); - /* "src/numpy_formathandler.pyx":64 + /* "src/numpy_formathandler.pyx":67 * np.timedelta64, * ) * if hasattr(np,'float128'): # <<<<<<<<<<<<<< @@ -8732,48 +8895,48 @@ if (!__Pyx_RefNanny) { */ } - /* "src/numpy_formathandler.pyx":66 + /* "src/numpy_formathandler.pyx":69 * if hasattr(np,'float128'): * HANDLED_TYPES += (np.float128,) * if hasattr(np,'complex256'): # <<<<<<<<<<<<<< * HANDLED_TYPES += (np.complex256,) * */ - __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_np); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_np); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); - __pyx_t_24 = __Pyx_HasAttr(__pyx_t_21, __pyx_n_s_complex256); if (unlikely(__pyx_t_24 == ((int)-1))) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_24 = __Pyx_HasAttr(__pyx_t_21, __pyx_n_s_complex256); if (unlikely(__pyx_t_24 == ((int)-1))) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __pyx_t_23 = (__pyx_t_24 != 0); if (__pyx_t_23) { - /* "src/numpy_formathandler.pyx":67 + /* "src/numpy_formathandler.pyx":70 * HANDLED_TYPES += (np.float128,) * if hasattr(np,'complex256'): * HANDLED_TYPES += (np.complex256,) # <<<<<<<<<<<<<< * * def __init__( self, ERROR_ON_COPY=None, a_to_gl=None, gl_to_a=None ): */ - __Pyx_GetNameInClass(__pyx_t_21, (PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler, __pyx_n_s_HANDLED_TYPES); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GetNameInClass(__pyx_t_21, (PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler, __pyx_n_s_HANDLED_TYPES); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); - __Pyx_GetModuleGlobalName(__pyx_t_22, __pyx_n_s_np); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_22, __pyx_n_s_np); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_22, __pyx_n_s_complex256); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_22, __pyx_n_s_complex256); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - __pyx_t_22 = PyTuple_New(1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_22 = PyTuple_New(1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_21, __pyx_t_22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_21, __pyx_t_22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler->tp_dict, __pyx_n_s_HANDLED_TYPES, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler->tp_dict, __pyx_n_s_HANDLED_TYPES, __pyx_t_2) < 0) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler); - /* "src/numpy_formathandler.pyx":66 + /* "src/numpy_formathandler.pyx":69 * if hasattr(np,'float128'): * HANDLED_TYPES += (np.float128,) * if hasattr(np,'complex256'): # <<<<<<<<<<<<<< @@ -8782,7 +8945,7 @@ if (!__Pyx_RefNanny) { */ } - /* "src/numpy_formathandler.pyx":213 + /* "src/numpy_formathandler.pyx":227 * # Cython numpy tutorial neglects to mention this AFAICS * # get segfaults without it * import_array() # <<<<<<<<<<<<<< diff --git a/accelerate/src/numpy_formathandler.pyx b/accelerate/src/numpy_formathandler.pyx index 42e22a33..86dc2458 100644 --- a/accelerate/src/numpy_formathandler.pyx +++ b/accelerate/src/numpy_formathandler.pyx @@ -14,11 +14,14 @@ cdef extern from "numpy/arrayobject.h": cdef np.ndarray PyArray_FromArray( np.ndarray, np.dtype, int ) cdef np.ndarray PyArray_ContiguousFromAny( object op, int, int, int max_depth) cdef int PyArray_Check( object ) + cdef int PyArray_CheckScalar( object ) int NPY_ARRAY_CARRAY int NPY_ARRAY_FORCECAST int PyArray_ISCARRAY( np.ndarray instance ) int PyArray_ISCARRAY_RO( np.ndarray instance ) cdef np.ndarray PyArray_Zeros(int nd, np.Py_intptr_t* dims, np.dtype, int fortran) + cdef np.ndarray PyArray_EnsureArray(object) + cdef int PyArray_FillWithScalar(object, object) cdef void import_array() cdef void* PyArray_DATA( np.ndarray ) cdef int PyArray_NDIM( np.ndarray ) @@ -85,7 +88,6 @@ cdef class NumpyHandler(FormatHandler): raise TypeError( """Numpy format handler passed a non-numpy-array object %s (of type %s)"""%( instance, type(instance) ), ) - return instance cdef c_from_param( self, object instance, object typeCode ): @@ -147,8 +149,17 @@ cdef class NumpyHandler(FormatHandler): return constant cdef c_asArray( self, object instance, object typeCode ): """Retrieve the given value as a (contiguous) array of type typeCode""" - cdef np.ndarray working = (self.c_check_array( instance )) + cdef np.ndarray working cdef np.dtype typecode + cdef int res + if PyArray_CheckScalar(instance): + Py_INCREF(instance) + working = self.c_zeros((1,), typeCode) + res = PyArray_FillWithScalar(working, instance) + if res < -1: + raise ValueError("Unable to fill new array with value %r (%s)"%(instance,instance.__class__)) + else: + working = (self.c_check_array( instance )) if typeCode is None: typecode = array_descr(working) else: @@ -194,6 +205,9 @@ cdef class NumpyHandler(FormatHandler): return instance else: # "convert" regardless (will return same instance if already contiguous) + if PyArray_CheckScalar(instance): + Py_INCREF( instance ) + return PyArray_EnsureArray(instance) if not PyArray_ISCARRAY_RO( instance ) or array_descr(instance) != dtype: # TODO: make sure there's no way to segfault here Py_INCREF( instance ) From 1b7c3c349c7d55b04235b27f3c13adecc08a3d31 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Fri, 3 Jan 2020 15:13:47 -0500 Subject: [PATCH 39/48] In ctypes arrays allow for numpy style short-string type specifiers --- OpenGL/arrays/ctypesarrays.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OpenGL/arrays/ctypesarrays.py b/OpenGL/arrays/ctypesarrays.py index 2ae50aa4..99c7cb7c 100644 --- a/OpenGL/arrays/ctypesarrays.py +++ b/OpenGL/arrays/ctypesarrays.py @@ -136,4 +136,13 @@ def dimensions( cls, value, typeCode=None ): GL_1_1.GL_CHAR: _types.GLchar, GL_1_1.GL_BYTE: _types.GLbyte, GL_1_1.GL_UNSIGNED_BYTE: _types.GLubyte, + 'f': _types.GLfloat, + 'd': _types.GLdouble, + 'i': _types.GLint, + 'I': _types.GLuint, + 'h': _types.GLshort, + 'H': _types.GLushort, + 'b': _types.GLbyte, + 'B': _types.GLubyte, + 's': _types.GLchar, } From 8cf737def761da7d310de5244179ca1ba88ec61a Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Fri, 3 Jan 2020 16:35:40 -0500 Subject: [PATCH 40/48] More support for using short-string types for convenience --- OpenGL/arrays/ctypesparameters.py | 9 +++++++++ OpenGL/arrays/ctypespointers.py | 9 +++++++++ OpenGL/arrays/lists.py | 9 +++++++++ OpenGL/arrays/numpybuffers.py | 9 +++++++++ OpenGL/arrays/numpymodule.py | 9 +++++++++ 5 files changed, 45 insertions(+) diff --git a/OpenGL/arrays/ctypesparameters.py b/OpenGL/arrays/ctypesparameters.py index 44b3ad9e..cf922ab1 100644 --- a/OpenGL/arrays/ctypesparameters.py +++ b/OpenGL/arrays/ctypesparameters.py @@ -140,4 +140,13 @@ def dimensions( self, value, typeCode=None ): GL_1_1.GL_CHAR: _types.GLchar, GL_1_1.GL_BYTE: _types.GLbyte, GL_1_1.GL_UNSIGNED_BYTE: _types.GLubyte, + 'f': _types.GLfloat, + 'd': _types.GLdouble, + 'i': _types.GLint, + 'I': _types.GLuint, + 'h': _types.GLshort, + 'H': _types.GLushort, + 'b': _types.GLbyte, + 'B': _types.GLubyte, + 's': _types.GLchar, } diff --git a/OpenGL/arrays/ctypespointers.py b/OpenGL/arrays/ctypespointers.py index a519dcf7..9facab60 100644 --- a/OpenGL/arrays/ctypespointers.py +++ b/OpenGL/arrays/ctypespointers.py @@ -79,4 +79,13 @@ def dimensions( self, value, typeCode=None ): GL_1_1.GL_CHAR: _types.GLchar, GL_1_1.GL_BYTE: _types.GLbyte, GL_1_1.GL_UNSIGNED_BYTE: _types.GLubyte, + 'f': _types.GLfloat, + 'd': _types.GLdouble, + 'i': _types.GLint, + 'I': _types.GLuint, + 'h': _types.GLshort, + 'H': _types.GLushort, + 'b': _types.GLbyte, + 'B': _types.GLubyte, + 's': _types.GLchar, } diff --git a/OpenGL/arrays/lists.py b/OpenGL/arrays/lists.py index 854ca296..b704200d 100644 --- a/OpenGL/arrays/lists.py +++ b/OpenGL/arrays/lists.py @@ -194,4 +194,13 @@ def arrayByteCount( cls, value, typeCode = None ): GL_1_1.GL_CHAR: _types.GLchar, GL_1_1.GL_BYTE: _types.GLbyte, GL_1_1.GL_UNSIGNED_BYTE: _types.GLubyte, + 'f': _types.GLfloat, + 'd': _types.GLdouble, + 'i': _types.GLint, + 'I': _types.GLuint, + 'h': _types.GLshort, + 'H': _types.GLushort, + 'b': _types.GLbyte, + 'B': _types.GLubyte, + 's': _types.GLchar, } diff --git a/OpenGL/arrays/numpybuffers.py b/OpenGL/arrays/numpybuffers.py index 34ffa951..9ab207ae 100644 --- a/OpenGL/arrays/numpybuffers.py +++ b/OpenGL/arrays/numpybuffers.py @@ -108,4 +108,13 @@ def lookupDtype( char ): GL_1_1.GL_UNSIGNED_SHORT: lookupDtype(USHORT_TYPE), _types.GL_VOID_P: lookupDtype('P'), None: None, + 'f': lookupDtype('f'), + 'd': lookupDtype('d'), + 'i': lookupDtype('i'), + 'I': lookupDtype('I'), + 'h': lookupDtype('h'), + 'H': lookupDtype('H'), + 'b': lookupDtype('b'), + 'B': lookupDtype('B'), + 's': lookupDtype('B'), } diff --git a/OpenGL/arrays/numpymodule.py b/OpenGL/arrays/numpymodule.py index e090bc66..68f34788 100644 --- a/OpenGL/arrays/numpymodule.py +++ b/OpenGL/arrays/numpymodule.py @@ -255,4 +255,13 @@ def lookupDtype( char ): GL_1_1.GL_UNSIGNED_SHORT: lookupDtype(USHORT_TYPE), _types.GL_VOID_P: lookupDtype('P'), None: None, + 'f': lookupDtype('f'), + 'd': lookupDtype('d'), + 'i': lookupDtype('i'), + 'I': lookupDtype('I'), + 'h': lookupDtype('h'), + 'H': lookupDtype('H'), + 'b': lookupDtype('b'), + 'B': lookupDtype('B'), + 's': lookupDtype('B'), } From 581d24000b1d3b07d0996afe480ca6660b238f5b Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Fri, 3 Jan 2020 16:41:28 -0500 Subject: [PATCH 41/48] TESTS Don't print glget calls, compressed image api call revert Apparently the call to the compressed api image that failed on win32 was correct on linux so it's that there's a broken bit on win32 that doesn't tigger the wrapper operation. --- tests/test_core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_core.py b/tests/test_core.py index 5d9e94f9..9bbc2f7e 100755 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -451,7 +451,7 @@ def test_glget( self ): continue if key >= 0x92be and key <= 0x92c9: continue - print( 'Trying glGetFloatv( 0x%x )'%(key,)) + # print( 'Trying glGetFloatv( 0x%x )'%(key,)) try: result = glGetFloatv( key ) except error.GLError as err: @@ -590,7 +590,7 @@ def test_compressed_data(self): GL_TEXTURE_2D, 0, s3tc.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, 256, 256, 0, - 256*256*1, + # 256*256*1, image, ) assert texture From 6ec398da44f34877d6e739d498420ecfe7830b0a Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Fri, 3 Jan 2020 16:52:03 -0500 Subject: [PATCH 42/48] Switch to assertRaises --- accelerate/tests/test_numpyaccel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accelerate/tests/test_numpyaccel.py b/accelerate/tests/test_numpyaccel.py index ed3396ed..b58e4c77 100644 --- a/accelerate/tests/test_numpyaccel.py +++ b/accelerate/tests/test_numpyaccel.py @@ -71,7 +71,7 @@ def test_zeros( self ): def test_asArrayCopy( self ): a2 = self.array[:,0] assert not a2.flags.contiguous - self.failUnlessRaises( + self.assertRaises( error.CopyError, self.eoc_handler.asArray, a2 From c26398b91aa0ebb8865b3b464dd42ce61b4aa83b Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Fri, 3 Jan 2020 16:52:44 -0500 Subject: [PATCH 43/48] Switch to pytest.mark for skipping numpy handler when not available --- accelerate/tests/test_arraydatatypeaccel.py | 74 ++++++++++++--------- 1 file changed, 41 insertions(+), 33 deletions(-) diff --git a/accelerate/tests/test_arraydatatypeaccel.py b/accelerate/tests/test_arraydatatypeaccel.py index e06248ac..d309dfba 100644 --- a/accelerate/tests/test_arraydatatypeaccel.py +++ b/accelerate/tests/test_arraydatatypeaccel.py @@ -3,12 +3,18 @@ from OpenGL.arrays import vbo from OpenGL import GL from OpenGL._bytes import integer_types +import pytest try: import numpy except ImportError: numpy = None +try: + import OpenGL_accelerate +except ImportError: + pytest.skip('Accelerate not installed, skipping', allow_module_level=True) class _BaseTest( object ): + array = None def setUp( self ): self.handler = adt.ArrayDatatype assert self.handler.isAccelerated @@ -38,39 +44,41 @@ def test_arrayToGLType( self ): p = self.handler.arrayToGLType( self.array ) assert p == GL.GL_FLOAT -if numpy: - # Skip if modifies the functions, which are *shared* between the - # classes... - #@pytest.mark.skipif( not numpy, reason="Numpy not available") - class TestNumpy( _BaseTest, unittest.TestCase ): - def setUp( self ): - self.array = numpy.array( [[1,2,3],[4,5,6]],'f') - super(TestNumpy,self).setUp() - def test_dataPointer( self ): - p = self.handler.dataPointer( self.array ) - assert isinstance( p, integer_types) - assert p == self.array.ctypes.data - def test_zeros( self ): - p = self.handler.zeros( (2,3,4), 'f' ) - assert p.shape == (2,3,4) - assert p.dtype == numpy.float32 - def test_asArrayConvert( self ): - p = self.handler.asArray( self.array, GL.GL_DOUBLE ) - assert p is not self.array - assert p.dtype == numpy.float64 - p = self.handler.asArray( self.array, 'd' ) - assert p is not self.array - assert p.dtype == numpy.float64 - def test_zeros_typed( self ): - z = self.handler.zeros( (2,3,4), GL.GL_FLOAT) - assert z.shape == (2,3,4) - assert z.dtype == numpy.float32 - def test_downconvert( self ): - p = self.handler.asArray( numpy.array( [1,2,3],'d'), GL.GL_FLOAT ) - assert p.dtype == numpy.float32 - def test_zeros_small( self ): - z = self.handler.zeros( 0, GL.GL_BYTE ) - assert z.dtype == numpy.byte, z +# Skip if modifies the functions, which are *shared* between the +# classes... +@pytest.mark.skipif( not numpy, reason="Numpy not available") +class TestNumpy( _BaseTest, unittest.TestCase ): + def setUp( self ): + super(TestNumpy,self).setUp() + self.array = numpy.array( [[1,2,3],[4,5,6]],'f') + handler = adt.ArrayDatatype.getHandler( self.array ) + handler.registerReturn( ) + + def test_dataPointer( self ): + p = self.handler.dataPointer( self.array ) + assert isinstance( p, integer_types) + assert p == self.array.ctypes.data + def test_zeros( self ): + p = self.handler.zeros( (2,3,4), 'f' ) + assert p.shape == (2,3,4) + assert p.dtype == numpy.float32 + def test_asArrayConvert( self ): + p = self.handler.asArray( self.array, GL.GL_DOUBLE ) + assert p is not self.array + assert p.dtype == numpy.float64 + p = self.handler.asArray( self.array, 'd' ) + assert p is not self.array + assert p.dtype == numpy.float64 + def test_zeros_typed( self ): + z = self.handler.zeros( (2,3,4), GL.GL_FLOAT) + assert z.shape == (2,3,4) + assert z.dtype == numpy.float32 + def test_downconvert( self ): + p = self.handler.asArray( numpy.array( [1,2,3],'d'), GL.GL_FLOAT ) + assert p.dtype == numpy.float32 + def test_zeros_small( self ): + z = self.handler.zeros( (0,), GL.GL_BYTE ) + assert z.dtype == numpy.byte, z class TestVBO( _BaseTest, unittest.TestCase ): def setUp( self ): From 60aec44bb9cb6ece393c07c25f003075a02db9da Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Fri, 3 Jan 2020 16:53:53 -0500 Subject: [PATCH 44/48] Update cython source with current release --- accelerate/src/arraydatatype.c | 233 +++++++++++++++--- accelerate/src/buffers_formathandler.c | 116 ++++++--- accelerate/src/errorchecker.c | 32 ++- accelerate/src/formathandler.c | 116 ++++++--- accelerate/src/latebind.c | 40 ++- accelerate/src/nones_formathandler.c | 116 ++++++--- accelerate/src/numpy_formathandler.c | 126 +++++++--- accelerate/src/vbo.c | 161 +++++++++--- accelerate/src/wrapper.c | 324 ++++++++++++++++++++++--- 9 files changed, 1000 insertions(+), 264 deletions(-) diff --git a/accelerate/src/arraydatatype.c b/accelerate/src/arraydatatype.c index 2c29f6c0..e3955ca5 100644 --- a/accelerate/src/arraydatatype.c +++ b/accelerate/src/arraydatatype.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.4 */ +/* Generated by Cython 0.29.14 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_4" -#define CYTHON_HEX_VERSION 0x001D04F0 +#define CYTHON_ABI "0_29_14" +#define CYTHON_HEX_VERSION 0x001D0EF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -310,8 +310,13 @@ #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" +#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES @@ -346,26 +351,6 @@ #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif -#if CYTHON_USE_DICT_VERSIONS -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ - }\ - } -#else -#define __PYX_GET_DICT_VERSION(dict) (0) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); -#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) @@ -620,7 +605,8 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1452,7 +1438,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObje #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif @@ -1516,6 +1502,32 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) {\ @@ -18506,7 +18518,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_HandlerRegist sizeof(struct __pyx_obj_17OpenGL_accelerate_13arraydatatype_HandlerRegistry), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_13arraydatatype_HandlerRegistry, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -18556,6 +18573,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_HandlerRegist #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_13arraydatatype_ArrayDatatype __pyx_vtable_17OpenGL_accelerate_13arraydatatype_ArrayDatatype; @@ -18678,7 +18701,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_ArrayDatatype sizeof(struct __pyx_obj_17OpenGL_accelerate_13arraydatatype_ArrayDatatype), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_13arraydatatype_ArrayDatatype, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -18728,6 +18756,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_ArrayDatatype #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_13arraydatatype_Output __pyx_vtable_17OpenGL_accelerate_13arraydatatype_Output; @@ -18801,7 +18835,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_Output = { sizeof(struct __pyx_obj_17OpenGL_accelerate_13arraydatatype_Output), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_13arraydatatype_Output, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -18851,6 +18890,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_Output = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_13arraydatatype_OutputOrInput __pyx_vtable_17OpenGL_accelerate_13arraydatatype_OutputOrInput; @@ -18875,7 +18920,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_OutputOrInput sizeof(struct __pyx_obj_17OpenGL_accelerate_13arraydatatype_OutputOrInput), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_13arraydatatype_Output, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -18929,6 +18979,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_OutputOrInput #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_13arraydatatype_SizedOutput __pyx_vtable_17OpenGL_accelerate_13arraydatatype_SizedOutput; @@ -18990,7 +19046,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_SizedOutput = sizeof(struct __pyx_obj_17OpenGL_accelerate_13arraydatatype_SizedOutput), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_13arraydatatype_SizedOutput, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -19040,6 +19101,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_SizedOutput = #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_13arraydatatype_SizedOutputOrInput __pyx_vtable_17OpenGL_accelerate_13arraydatatype_SizedOutputOrInput; @@ -19064,7 +19131,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_SizedOutputOr sizeof(struct __pyx_obj_17OpenGL_accelerate_13arraydatatype_SizedOutputOrInput), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_13arraydatatype_SizedOutput, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -19118,6 +19190,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_SizedOutputOr #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_13arraydatatype_AsArrayOfType __pyx_vtable_17OpenGL_accelerate_13arraydatatype_AsArrayOfType; @@ -19230,7 +19308,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayOfType sizeof(struct __pyx_obj_17OpenGL_accelerate_13arraydatatype_AsArrayOfType), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_13arraydatatype_AsArrayOfType, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -19280,6 +19363,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayOfType #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_13arraydatatype_AsArrayTyped __pyx_vtable_17OpenGL_accelerate_13arraydatatype_AsArrayTyped; @@ -19376,7 +19465,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTyped sizeof(struct __pyx_obj_17OpenGL_accelerate_13arraydatatype_AsArrayTyped), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_13arraydatatype_AsArrayTyped, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -19426,6 +19520,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTyped #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSizeChecked __pyx_vtable_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSizeChecked; @@ -19450,7 +19550,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTypedS sizeof(struct __pyx_obj_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSizeChecked), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_13arraydatatype_AsArrayTyped, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -19500,6 +19605,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTypedS #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSize __pyx_vtable_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSize; @@ -19596,7 +19707,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTypedS sizeof(struct __pyx_obj_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSize), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSize, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -19646,6 +19762,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTypedS #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static PyMethodDef __pyx_methods[] = { @@ -19969,7 +20091,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_13arraydatatype_HandlerRegistry.c_get_output_handler = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_13arraydatatype_HandlerRegistry *))__pyx_f_17OpenGL_accelerate_13arraydatatype_15HandlerRegistry_c_get_output_handler; __pyx_vtable_17OpenGL_accelerate_13arraydatatype_HandlerRegistry.c_handler_by_plugin_name = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_13arraydatatype_HandlerRegistry *, PyObject *))__pyx_f_17OpenGL_accelerate_13arraydatatype_15HandlerRegistry_c_handler_by_plugin_name; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_13arraydatatype_HandlerRegistry) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_13arraydatatype_HandlerRegistry.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_13arraydatatype_HandlerRegistry.tp_dictoffset && __pyx_type_17OpenGL_accelerate_13arraydatatype_HandlerRegistry.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_13arraydatatype_HandlerRegistry.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -19980,7 +20104,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtabptr_17OpenGL_accelerate_13arraydatatype_ArrayDatatype = &__pyx_vtable_17OpenGL_accelerate_13arraydatatype_ArrayDatatype; __pyx_vtable_17OpenGL_accelerate_13arraydatatype_ArrayDatatype.c_zeros = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_13arraydatatype_ArrayDatatype *, PyObject *, PyObject *))__pyx_f_17OpenGL_accelerate_13arraydatatype_13ArrayDatatype_c_zeros; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_13arraydatatype_ArrayDatatype) < 0) __PYX_ERR(0, 106, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_13arraydatatype_ArrayDatatype.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_13arraydatatype_ArrayDatatype.tp_dictoffset && __pyx_type_17OpenGL_accelerate_13arraydatatype_ArrayDatatype.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_13arraydatatype_ArrayDatatype.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -20019,7 +20145,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_13arraydatatype_Output.c_getSize = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_13arraydatatype_Output *, PyObject *))__pyx_f_17OpenGL_accelerate_13arraydatatype_6Output_c_getSize; __pyx_type_17OpenGL_accelerate_13arraydatatype_Output.tp_base = __pyx_ptype_17OpenGL_accelerate_7wrapper_cArgConverter; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_13arraydatatype_Output) < 0) __PYX_ERR(0, 261, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_13arraydatatype_Output.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_13arraydatatype_Output.tp_dictoffset && __pyx_type_17OpenGL_accelerate_13arraydatatype_Output.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_13arraydatatype_Output.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -20032,7 +20160,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_13arraydatatype_OutputOrInput.__pyx_base.__pyx_base.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_cArgConverter *, PyObject *, int, PyObject *))__pyx_f_17OpenGL_accelerate_13arraydatatype_13OutputOrInput_c_call; __pyx_type_17OpenGL_accelerate_13arraydatatype_OutputOrInput.tp_base = __pyx_ptype_17OpenGL_accelerate_13arraydatatype_Output; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_13arraydatatype_OutputOrInput) < 0) __PYX_ERR(0, 310, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_13arraydatatype_OutputOrInput.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_13arraydatatype_OutputOrInput.tp_dictoffset && __pyx_type_17OpenGL_accelerate_13arraydatatype_OutputOrInput.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_13arraydatatype_OutputOrInput.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -20045,7 +20175,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_13arraydatatype_SizedOutput.__pyx_base.c_getSize = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_13arraydatatype_Output *, PyObject *))__pyx_f_17OpenGL_accelerate_13arraydatatype_11SizedOutput_c_getSize; __pyx_type_17OpenGL_accelerate_13arraydatatype_SizedOutput.tp_base = __pyx_ptype_17OpenGL_accelerate_13arraydatatype_Output; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_13arraydatatype_SizedOutput) < 0) __PYX_ERR(0, 317, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_13arraydatatype_SizedOutput.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_13arraydatatype_SizedOutput.tp_dictoffset && __pyx_type_17OpenGL_accelerate_13arraydatatype_SizedOutput.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_13arraydatatype_SizedOutput.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -20058,7 +20190,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_13arraydatatype_SizedOutputOrInput.__pyx_base.__pyx_base.__pyx_base.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_cArgConverter *, PyObject *, int, PyObject *))__pyx_f_17OpenGL_accelerate_13arraydatatype_18SizedOutputOrInput_c_call; __pyx_type_17OpenGL_accelerate_13arraydatatype_SizedOutputOrInput.tp_base = __pyx_ptype_17OpenGL_accelerate_13arraydatatype_SizedOutput; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_13arraydatatype_SizedOutputOrInput) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_13arraydatatype_SizedOutputOrInput.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_13arraydatatype_SizedOutputOrInput.tp_dictoffset && __pyx_type_17OpenGL_accelerate_13arraydatatype_SizedOutputOrInput.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_13arraydatatype_SizedOutputOrInput.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -20074,7 +20208,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_13arraydatatype_AsArrayOfType.__pyx_base.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_pyArgConverter *, PyObject *, PyObject *, PyObject *))__pyx_f_17OpenGL_accelerate_13arraydatatype_13AsArrayOfType_c_call; __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayOfType.tp_base = __pyx_ptype_17OpenGL_accelerate_7wrapper_pyArgConverter; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayOfType) < 0) __PYX_ERR(0, 358, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayOfType.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayOfType.tp_dictoffset && __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayOfType.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayOfType.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -20087,7 +20223,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_13arraydatatype_AsArrayTyped.__pyx_base.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_pyArgConverter *, PyObject *, PyObject *, PyObject *))__pyx_f_17OpenGL_accelerate_13arraydatatype_12AsArrayTyped_c_call; __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTyped.tp_base = __pyx_ptype_17OpenGL_accelerate_7wrapper_pyArgConverter; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTyped) < 0) __PYX_ERR(0, 384, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTyped.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTyped.tp_dictoffset && __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTyped.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTyped.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -20100,7 +20238,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSizeChecked.__pyx_base.__pyx_base.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_pyArgConverter *, PyObject *, PyObject *, PyObject *))__pyx_f_17OpenGL_accelerate_13arraydatatype_23AsArrayTypedSizeChecked_c_call; __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSizeChecked.tp_base = __pyx_ptype_17OpenGL_accelerate_13arraydatatype_AsArrayTyped; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSizeChecked) < 0) __PYX_ERR(0, 406, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSizeChecked.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSizeChecked.tp_dictoffset && __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSizeChecked.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSizeChecked.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -20113,7 +20253,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSize.__pyx_base.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_cArgConverter *, PyObject *, int, PyObject *))__pyx_f_17OpenGL_accelerate_13arraydatatype_16AsArrayTypedSize_c_call; __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSize.tp_base = __pyx_ptype_17OpenGL_accelerate_7wrapper_cArgConverter; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSize) < 0) __PYX_ERR(0, 428, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSize.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSize.tp_dictoffset && __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSize.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_13arraydatatype_AsArrayTypedSize.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -20335,10 +20477,9 @@ if (!__Pyx_RefNanny) { __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); - #endif + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -20357,9 +20498,9 @@ if (!__Pyx_RefNanny) { } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error; /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); @@ -21261,7 +21402,7 @@ static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); @@ -21332,12 +21473,12 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif @@ -21643,6 +21784,32 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } #endif +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) diff --git a/accelerate/src/buffers_formathandler.c b/accelerate/src/buffers_formathandler.c index 11f09865..67014830 100644 --- a/accelerate/src/buffers_formathandler.c +++ b/accelerate/src/buffers_formathandler.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.4 */ +/* Generated by Cython 0.29.14 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_4" -#define CYTHON_HEX_VERSION 0x001D04F0 +#define CYTHON_ABI "0_29_14" +#define CYTHON_HEX_VERSION 0x001D0EF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -310,8 +310,13 @@ #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" +#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES @@ -346,26 +351,6 @@ #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif -#if CYTHON_USE_DICT_VERSIONS -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ - }\ - } -#else -#define __PYX_GET_DICT_VERSION(dict) (0) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); -#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) @@ -620,7 +605,8 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1058,6 +1044,32 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) {\ @@ -1091,7 +1103,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObje #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif @@ -3781,7 +3793,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_21buffers_formathandler_Memor sizeof(struct __pyx_obj_17OpenGL_accelerate_21buffers_formathandler_MemoryviewHandler), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_21buffers_formathandler_MemoryviewHandler, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -3831,6 +3848,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_21buffers_formathandler_Memor #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static PyMethodDef __pyx_methods[] = { @@ -4066,7 +4089,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_21buffers_formathandler_MemoryviewHandler.c_as_memoryview = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_21buffers_formathandler_MemoryviewHandler *, PyObject *))__pyx_f_17OpenGL_accelerate_21buffers_formathandler_17MemoryviewHandler_c_as_memoryview; __pyx_type_17OpenGL_accelerate_21buffers_formathandler_MemoryviewHandler.tp_base = __pyx_ptype_17OpenGL_accelerate_13formathandler_FormatHandler; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_21buffers_formathandler_MemoryviewHandler) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_21buffers_formathandler_MemoryviewHandler.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_21buffers_formathandler_MemoryviewHandler.tp_dictoffset && __pyx_type_17OpenGL_accelerate_21buffers_formathandler_MemoryviewHandler.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_21buffers_formathandler_MemoryviewHandler.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -4268,10 +4293,9 @@ if (!__Pyx_RefNanny) { __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); - #endif + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -4290,9 +4314,9 @@ if (!__Pyx_RefNanny) { } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error; /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); @@ -5071,6 +5095,32 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } #endif +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) @@ -5160,7 +5210,7 @@ static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); @@ -5231,12 +5281,12 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif diff --git a/accelerate/src/errorchecker.c b/accelerate/src/errorchecker.c index 6d2576e1..13050a21 100644 --- a/accelerate/src/errorchecker.c +++ b/accelerate/src/errorchecker.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.10 */ +/* Generated by Cython 0.29.14 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_10" -#define CYTHON_HEX_VERSION 0x001D0AF0 +#define CYTHON_ABI "0_29_14" +#define CYTHON_HEX_VERSION 0x001D0EF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -310,12 +310,12 @@ #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#if PY_VERSION_HEX < 0x030800A4 +#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #define __Pyx_DefaultClassType PyType_Type #endif @@ -964,7 +964,7 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif @@ -3700,7 +3700,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_12errorchecker__ErrorChecker sizeof(struct __pyx_obj_17OpenGL_accelerate_12errorchecker__ErrorChecker), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_12errorchecker__ErrorChecker, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -3753,6 +3758,9 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_12errorchecker__ErrorChecker #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static PyMethodDef __pyx_methods[] = { @@ -4146,9 +4154,9 @@ if (!__Pyx_RefNanny) { } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error; /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); @@ -4507,7 +4515,7 @@ static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); @@ -4578,12 +4586,12 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif diff --git a/accelerate/src/formathandler.c b/accelerate/src/formathandler.c index a54d1aa4..6e390dd8 100644 --- a/accelerate/src/formathandler.c +++ b/accelerate/src/formathandler.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.4 */ +/* Generated by Cython 0.29.14 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_4" -#define CYTHON_HEX_VERSION 0x001D04F0 +#define CYTHON_ABI "0_29_14" +#define CYTHON_HEX_VERSION 0x001D0EF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -310,8 +310,13 @@ #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" +#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES @@ -346,26 +351,6 @@ #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif -#if CYTHON_USE_DICT_VERSIONS -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ - }\ - } -#else -#define __PYX_GET_DICT_VERSION(dict) (0) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); -#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) @@ -620,7 +605,8 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -959,7 +945,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif @@ -1062,6 +1048,32 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) {\ @@ -3902,7 +3914,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13formathandler_FormatHandler sizeof(struct __pyx_obj_17OpenGL_accelerate_13formathandler_FormatHandler), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_13formathandler_FormatHandler, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -3952,6 +3969,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_13formathandler_FormatHandler #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static PyMethodDef __pyx_methods[] = { @@ -4135,7 +4158,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_13formathandler_FormatHandler.c_unitSize = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_13formathandler_FormatHandler *, PyObject *, PyObject *))__pyx_f_17OpenGL_accelerate_13formathandler_13FormatHandler_c_unitSize; __pyx_vtable_17OpenGL_accelerate_13formathandler_FormatHandler.c_dimensions = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_13formathandler_FormatHandler *, PyObject *))__pyx_f_17OpenGL_accelerate_13formathandler_13FormatHandler_c_dimensions; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_13formathandler_FormatHandler) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_13formathandler_FormatHandler.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_13formathandler_FormatHandler.tp_dictoffset && __pyx_type_17OpenGL_accelerate_13formathandler_FormatHandler.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_13formathandler_FormatHandler.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -4344,10 +4369,9 @@ if (!__Pyx_RefNanny) { __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); - #endif + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -4366,9 +4390,9 @@ if (!__Pyx_RefNanny) { } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error; /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); @@ -4794,7 +4818,7 @@ static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); @@ -4865,12 +4889,12 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif @@ -5272,6 +5296,32 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject return (likely(r)) ? r : __Pyx_GetAttr3Default(d); } +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) diff --git a/accelerate/src/latebind.c b/accelerate/src/latebind.c index e8edce4f..4bf752ff 100644 --- a/accelerate/src/latebind.c +++ b/accelerate/src/latebind.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.10 */ +/* Generated by Cython 0.29.14 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_10" -#define CYTHON_HEX_VERSION 0x001D0AF0 +#define CYTHON_ABI "0_29_14" +#define CYTHON_HEX_VERSION 0x001D0EF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -310,12 +310,12 @@ #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#if PY_VERSION_HEX < 0x030800A4 +#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #define __Pyx_DefaultClassType PyType_Type #endif @@ -912,7 +912,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif @@ -3479,7 +3479,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_8latebind_LateBind = { sizeof(struct __pyx_obj_17OpenGL_accelerate_8latebind_LateBind), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_8latebind_LateBind, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -3532,6 +3537,9 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_8latebind_LateBind = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static PyObject *__pyx_tp_new_17OpenGL_accelerate_8latebind_Curry(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { @@ -3598,7 +3606,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_8latebind_Curry = { sizeof(struct __pyx_obj_17OpenGL_accelerate_8latebind_Curry), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_8latebind_Curry, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -3651,6 +3664,9 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_8latebind_Curry = { #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static PyMethodDef __pyx_methods[] = { @@ -4069,9 +4085,9 @@ if (!__Pyx_RefNanny) { } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error; /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); @@ -4204,7 +4220,7 @@ static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); @@ -4275,12 +4291,12 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif diff --git a/accelerate/src/nones_formathandler.c b/accelerate/src/nones_formathandler.c index 957eea6e..4bf4bfcf 100644 --- a/accelerate/src/nones_formathandler.c +++ b/accelerate/src/nones_formathandler.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.4 */ +/* Generated by Cython 0.29.14 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_4" -#define CYTHON_HEX_VERSION 0x001D04F0 +#define CYTHON_ABI "0_29_14" +#define CYTHON_HEX_VERSION 0x001D0EF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -310,8 +310,13 @@ #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" +#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES @@ -346,26 +351,6 @@ #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif -#if CYTHON_USE_DICT_VERSIONS -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ - }\ - } -#else -#define __PYX_GET_DICT_VERSION(dict) (0) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); -#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) @@ -620,7 +605,8 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1009,6 +995,32 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject * /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) {\ @@ -1060,7 +1072,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObje #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif @@ -2247,7 +2259,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_19nones_formathandler_NoneHan sizeof(struct __pyx_obj_17OpenGL_accelerate_19nones_formathandler_NoneHandler), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_19nones_formathandler_NoneHandler, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -2297,6 +2314,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_19nones_formathandler_NoneHan #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static PyMethodDef __pyx_methods[] = { @@ -2470,7 +2493,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_19nones_formathandler_NoneHandler.__pyx_base.c_dimensions = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_13formathandler_FormatHandler *, PyObject *))__pyx_f_17OpenGL_accelerate_19nones_formathandler_11NoneHandler_c_dimensions; __pyx_type_17OpenGL_accelerate_19nones_formathandler_NoneHandler.tp_base = __pyx_ptype_17OpenGL_accelerate_13formathandler_FormatHandler; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_19nones_formathandler_NoneHandler) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_19nones_formathandler_NoneHandler.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_19nones_formathandler_NoneHandler.tp_dictoffset && __pyx_type_17OpenGL_accelerate_19nones_formathandler_NoneHandler.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_19nones_formathandler_NoneHandler.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -2671,10 +2696,9 @@ if (!__Pyx_RefNanny) { __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); - #endif + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -2693,9 +2717,9 @@ if (!__Pyx_RefNanny) { } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error; /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); @@ -2902,6 +2926,32 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { return result; } +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) @@ -3212,7 +3262,7 @@ static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); @@ -3283,12 +3333,12 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif diff --git a/accelerate/src/numpy_formathandler.c b/accelerate/src/numpy_formathandler.c index efa7371e..3b323f3e 100644 --- a/accelerate/src/numpy_formathandler.c +++ b/accelerate/src/numpy_formathandler.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.4 */ +/* Generated by Cython 0.29.14 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_4" -#define CYTHON_HEX_VERSION 0x001D04F0 +#define CYTHON_ABI "0_29_14" +#define CYTHON_HEX_VERSION 0x001D0EF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -310,8 +310,13 @@ #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" +#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES @@ -346,26 +351,6 @@ #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif -#if CYTHON_USE_DICT_VERSIONS -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ - }\ - } -#else -#define __PYX_GET_DICT_VERSION(dict) (0) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); -#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) @@ -624,7 +609,8 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1271,7 +1257,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObje #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif @@ -1357,6 +1343,32 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) {\ @@ -7712,7 +7724,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHa sizeof(struct __pyx_obj_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -7762,6 +7779,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHa #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static PyMethodDef __pyx_methods[] = { @@ -8095,7 +8118,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler.contiguous = (PyArrayObject *(*)(struct __pyx_obj_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *, PyArrayObject *, PyArray_Descr *))__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler_contiguous; __pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler.tp_base = __pyx_ptype_17OpenGL_accelerate_13formathandler_FormatHandler; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler.tp_dictoffset && __pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -8348,10 +8373,9 @@ if (!__Pyx_RefNanny) { __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); - #endif + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -8370,9 +8394,9 @@ if (!__Pyx_RefNanny) { } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error; /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); @@ -9346,7 +9370,7 @@ static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); @@ -9417,12 +9441,12 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif @@ -9734,6 +9758,32 @@ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { return 0; } +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) @@ -10912,13 +10962,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); } else { float r = b.imag / b.real; - float s = 1.0 / (b.real + b.imag * r); + float s = (float)(1.0) / (b.real + b.imag * r); return __pyx_t_float_complex_from_parts( (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); } } else { float r = b.real / b.imag; - float s = 1.0 / (b.imag + b.real * r); + float s = (float)(1.0) / (b.imag + b.real * r); return __pyx_t_float_complex_from_parts( (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); } @@ -10976,7 +11026,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { case 1: return a; case 2: - z = __Pyx_c_prod_float(a, a); return __Pyx_c_prod_float(a, a); case 3: z = __Pyx_c_prod_float(a, a); @@ -11067,13 +11116,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); } else { double r = b.imag / b.real; - double s = 1.0 / (b.real + b.imag * r); + double s = (double)(1.0) / (b.real + b.imag * r); return __pyx_t_double_complex_from_parts( (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); } } else { double r = b.real / b.imag; - double s = 1.0 / (b.imag + b.real * r); + double s = (double)(1.0) / (b.imag + b.real * r); return __pyx_t_double_complex_from_parts( (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); } @@ -11131,7 +11180,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { case 1: return a; case 2: - z = __Pyx_c_prod_double(a, a); return __Pyx_c_prod_double(a, a); case 3: z = __Pyx_c_prod_double(a, a); diff --git a/accelerate/src/vbo.c b/accelerate/src/vbo.c index ef14fa77..e4147d8e 100644 --- a/accelerate/src/vbo.c +++ b/accelerate/src/vbo.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.4 */ +/* Generated by Cython 0.29.14 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_4" -#define CYTHON_HEX_VERSION 0x001D04F0 +#define CYTHON_ABI "0_29_14" +#define CYTHON_HEX_VERSION 0x001D0EF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -310,8 +310,13 @@ #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" +#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES @@ -346,26 +351,6 @@ #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif -#if CYTHON_USE_DICT_VERSIONS -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ - }\ - } -#else -#define __PYX_GET_DICT_VERSION(dict) (0) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); -#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) @@ -620,7 +605,8 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1087,7 +1073,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif @@ -1134,6 +1120,32 @@ static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObje /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) {\ @@ -1309,18 +1321,18 @@ static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ - (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ + (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ - (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ + (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #else #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\ __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ - (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ + (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix)) #endif @@ -11510,7 +11522,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_3vbo_VBO = { sizeof(struct __pyx_obj_17OpenGL_accelerate_3vbo_VBO), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_3vbo_VBO, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -11560,6 +11577,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_3vbo_VBO = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_3vbo_VBOOffset __pyx_vtable_17OpenGL_accelerate_3vbo_VBOOffset; @@ -11737,7 +11760,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_3vbo_VBOOffset = { sizeof(struct __pyx_obj_17OpenGL_accelerate_3vbo_VBOOffset), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_3vbo_VBOOffset, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -11787,6 +11815,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_3vbo_VBOOffset = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_3vbo_VBOHandler __pyx_vtable_17OpenGL_accelerate_3vbo_VBOHandler; @@ -11856,7 +11890,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_3vbo_VBOHandler = { sizeof(struct __pyx_obj_17OpenGL_accelerate_3vbo_VBOHandler), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_3vbo_VBOHandler, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -11906,6 +11945,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_3vbo_VBOHandler = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_3vbo_VBOOffsetHandler __pyx_vtable_17OpenGL_accelerate_3vbo_VBOOffsetHandler; @@ -11967,7 +12012,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_3vbo_VBOOffsetHandler = { sizeof(struct __pyx_obj_17OpenGL_accelerate_3vbo_VBOOffsetHandler), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_3vbo_VBOOffsetHandler, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -12017,6 +12067,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_3vbo_VBOOffsetHandler = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static PyMethodDef __pyx_methods[] = { @@ -12324,7 +12380,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_3vbo_VBO.c_set_array = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_3vbo_VBO *, PyObject *, PyObject *))__pyx_f_17OpenGL_accelerate_3vbo_3VBO_c_set_array; __pyx_vtable_17OpenGL_accelerate_3vbo_VBO.check_live = (int (*)(struct __pyx_obj_17OpenGL_accelerate_3vbo_VBO *))__pyx_f_17OpenGL_accelerate_3vbo_3VBO_check_live; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_3vbo_VBO) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_3vbo_VBO.tp_print = 0; + #endif #if CYTHON_COMPILING_IN_CPYTHON { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_17OpenGL_accelerate_3vbo_VBO, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 13, __pyx_L1_error) @@ -12373,7 +12431,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtabptr_17OpenGL_accelerate_3vbo_VBOOffset = &__pyx_vtable_17OpenGL_accelerate_3vbo_VBOOffset; __pyx_vtable_17OpenGL_accelerate_3vbo_VBOOffset.check_live = (int (*)(struct __pyx_obj_17OpenGL_accelerate_3vbo_VBOOffset *))__pyx_f_17OpenGL_accelerate_3vbo_9VBOOffset_check_live; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_3vbo_VBOOffset) < 0) __PYX_ERR(0, 257, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_3vbo_VBOOffset.tp_print = 0; + #endif if (__Pyx_SetVtable(__pyx_type_17OpenGL_accelerate_3vbo_VBOOffset.tp_dict, __pyx_vtabptr_17OpenGL_accelerate_3vbo_VBOOffset) < 0) __PYX_ERR(0, 257, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_VBOOffset, (PyObject *)&__pyx_type_17OpenGL_accelerate_3vbo_VBOOffset) < 0) __PYX_ERR(0, 257, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_17OpenGL_accelerate_3vbo_VBOOffset) < 0) __PYX_ERR(0, 257, __pyx_L1_error) @@ -12395,7 +12455,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_3vbo_VBOHandler.__pyx_base.c_dimensions = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_13formathandler_FormatHandler *, PyObject *))__pyx_f_17OpenGL_accelerate_3vbo_10VBOHandler_c_dimensions; __pyx_type_17OpenGL_accelerate_3vbo_VBOHandler.tp_base = __pyx_ptype_17OpenGL_accelerate_13formathandler_FormatHandler; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_3vbo_VBOHandler) < 0) __PYX_ERR(0, 290, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_3vbo_VBOHandler.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_3vbo_VBOHandler.tp_dictoffset && __pyx_type_17OpenGL_accelerate_3vbo_VBOHandler.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_3vbo_VBOHandler.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -12415,7 +12477,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_3vbo_VBOOffsetHandler.__pyx_base.c_dimensions = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_13formathandler_FormatHandler *, PyObject *))__pyx_f_17OpenGL_accelerate_3vbo_16VBOOffsetHandler_c_dimensions; __pyx_type_17OpenGL_accelerate_3vbo_VBOOffsetHandler.tp_base = __pyx_ptype_17OpenGL_accelerate_13formathandler_FormatHandler; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_3vbo_VBOOffsetHandler) < 0) __PYX_ERR(0, 332, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_3vbo_VBOOffsetHandler.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_3vbo_VBOOffsetHandler.tp_dictoffset && __pyx_type_17OpenGL_accelerate_3vbo_VBOOffsetHandler.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_3vbo_VBOOffsetHandler.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -12617,10 +12681,9 @@ if (!__Pyx_RefNanny) { __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); - #endif + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -12639,9 +12702,9 @@ if (!__Pyx_RefNanny) { } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error; /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); @@ -13139,7 +13202,7 @@ static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); @@ -13210,12 +13273,12 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif @@ -13352,6 +13415,32 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec } #endif +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) diff --git a/accelerate/src/wrapper.c b/accelerate/src/wrapper.c index bcd47316..f555caf7 100644 --- a/accelerate/src/wrapper.c +++ b/accelerate/src/wrapper.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.29.4 */ +/* Generated by Cython 0.29.14 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -7,8 +7,8 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_29_4" -#define CYTHON_HEX_VERSION 0x001D04F0 +#define CYTHON_ABI "0_29_14" +#define CYTHON_HEX_VERSION 0x001D0EF0 #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -310,8 +310,13 @@ #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" +#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES @@ -346,26 +351,6 @@ #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif -#if CYTHON_USE_DICT_VERSIONS -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ - }\ - } -#else -#define __PYX_GET_DICT_VERSION(dict) (0) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); -#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) @@ -620,7 +605,8 @@ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* enc const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1441,6 +1427,32 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) {\ @@ -1473,7 +1485,7 @@ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif @@ -22432,7 +22444,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_cArgConverter = { sizeof(struct __pyx_obj_17OpenGL_accelerate_7wrapper_cArgConverter), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_7wrapper_cArgConverter, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -22482,6 +22499,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_cArgConverter = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_7wrapper_pyArgConverter __pyx_vtable_17OpenGL_accelerate_7wrapper_pyArgConverter; @@ -22520,7 +22543,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_pyArgConverter = { sizeof(struct __pyx_obj_17OpenGL_accelerate_7wrapper_pyArgConverter), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_7wrapper_pyArgConverter, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -22570,6 +22598,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_pyArgConverter = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_7wrapper_cArgumentConverter __pyx_vtable_17OpenGL_accelerate_7wrapper_cArgumentConverter; @@ -22608,7 +22642,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_cArgumentConverter = sizeof(struct __pyx_obj_17OpenGL_accelerate_7wrapper_cArgumentConverter), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_7wrapper_cArgumentConverter, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -22658,6 +22697,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_cArgumentConverter = #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_7wrapper_returnConverter __pyx_vtable_17OpenGL_accelerate_7wrapper_returnConverter; @@ -22696,7 +22741,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_returnConverter = { sizeof(struct __pyx_obj_17OpenGL_accelerate_7wrapper_returnConverter), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_7wrapper_returnConverter, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -22746,6 +22796,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_returnConverter = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_7wrapper_CArgCalculatorElement __pyx_vtable_17OpenGL_accelerate_7wrapper_CArgCalculatorElement; @@ -22822,7 +22878,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_CArgCalculatorElemen sizeof(struct __pyx_obj_17OpenGL_accelerate_7wrapper_CArgCalculatorElement), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_7wrapper_CArgCalculatorElement, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -22872,6 +22933,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_CArgCalculatorElemen #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_7wrapper_CArgCalculator __pyx_vtable_17OpenGL_accelerate_7wrapper_CArgCalculator; @@ -22932,7 +22999,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_CArgCalculator = { sizeof(struct __pyx_obj_17OpenGL_accelerate_7wrapper_CArgCalculator), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_7wrapper_CArgCalculator, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -22982,6 +23054,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_CArgCalculator = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_7wrapper_PyArgCalculatorElement __pyx_vtable_17OpenGL_accelerate_7wrapper_PyArgCalculatorElement; @@ -23058,7 +23136,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_PyArgCalculatorEleme sizeof(struct __pyx_obj_17OpenGL_accelerate_7wrapper_PyArgCalculatorElement), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_7wrapper_PyArgCalculatorElement, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -23108,6 +23191,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_PyArgCalculatorEleme #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_7wrapper_PyArgCalculator __pyx_vtable_17OpenGL_accelerate_7wrapper_PyArgCalculator; @@ -23176,7 +23265,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_PyArgCalculator = { sizeof(struct __pyx_obj_17OpenGL_accelerate_7wrapper_PyArgCalculator), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_7wrapper_PyArgCalculator, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -23226,6 +23320,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_PyArgCalculator = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_7wrapper_CArgumentCalculator __pyx_vtable_17OpenGL_accelerate_7wrapper_CArgumentCalculator; @@ -23286,7 +23386,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_CArgumentCalculator sizeof(struct __pyx_obj_17OpenGL_accelerate_7wrapper_CArgumentCalculator), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_7wrapper_CArgumentCalculator, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -23336,6 +23441,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_CArgumentCalculator #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_7wrapper_CallFuncPyConverter __pyx_vtable_17OpenGL_accelerate_7wrapper_CallFuncPyConverter; @@ -23397,7 +23508,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_CallFuncPyConverter sizeof(struct __pyx_obj_17OpenGL_accelerate_7wrapper_CallFuncPyConverter), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_7wrapper_CallFuncPyConverter, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -23451,6 +23567,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_CallFuncPyConverter #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_7wrapper_DefaultCConverter __pyx_vtable_17OpenGL_accelerate_7wrapper_DefaultCConverter; @@ -23475,7 +23597,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_DefaultCConverter = sizeof(struct __pyx_obj_17OpenGL_accelerate_7wrapper_DefaultCConverter), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_7wrapper_cArgConverter, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -23529,6 +23656,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_DefaultCConverter = #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static PyObject *__pyx_tp_new_17OpenGL_accelerate_7wrapper_Wrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { @@ -23681,7 +23814,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_Wrapper = { sizeof(struct __pyx_obj_17OpenGL_accelerate_7wrapper_Wrapper), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_7wrapper_Wrapper, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -23731,6 +23869,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_Wrapper = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_7wrapper_getPyArgsName __pyx_vtable_17OpenGL_accelerate_7wrapper_getPyArgsName; @@ -23801,7 +23945,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_getPyArgsName = { sizeof(struct __pyx_obj_17OpenGL_accelerate_7wrapper_getPyArgsName), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_7wrapper_getPyArgsName, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -23855,6 +24004,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_getPyArgsName = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_7wrapper_returnPyArgument __pyx_vtable_17OpenGL_accelerate_7wrapper_returnPyArgument; @@ -23925,7 +24080,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_returnPyArgument = { sizeof(struct __pyx_obj_17OpenGL_accelerate_7wrapper_returnPyArgument), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_7wrapper_returnPyArgument, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -23979,6 +24139,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_returnPyArgument = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_7wrapper_returnPyArgumentIndex __pyx_vtable_17OpenGL_accelerate_7wrapper_returnPyArgumentIndex; @@ -24023,7 +24189,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_returnPyArgumentInde sizeof(struct __pyx_obj_17OpenGL_accelerate_7wrapper_returnPyArgumentIndex), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_7wrapper_returnConverter, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -24077,6 +24248,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_returnPyArgumentInde #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static struct __pyx_vtabstruct_17OpenGL_accelerate_7wrapper_returnCArgument __pyx_vtable_17OpenGL_accelerate_7wrapper_returnCArgument; @@ -24147,7 +24324,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_returnCArgument = { sizeof(struct __pyx_obj_17OpenGL_accelerate_7wrapper_returnCArgument), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_7wrapper_returnCArgument, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -24201,6 +24383,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_returnCArgument = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static PyObject *__pyx_tp_new_17OpenGL_accelerate_7wrapper_MultiReturn(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { @@ -24278,7 +24466,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_MultiReturn = { sizeof(struct __pyx_obj_17OpenGL_accelerate_7wrapper_MultiReturn), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_17OpenGL_accelerate_7wrapper_MultiReturn, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 @@ -24328,6 +24521,12 @@ static PyTypeObject __pyx_type_17OpenGL_accelerate_7wrapper_MultiReturn = { #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif }; static PyMethodDef __pyx_methods[] = { @@ -24650,7 +24849,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtabptr_17OpenGL_accelerate_7wrapper_cArgConverter = &__pyx_vtable_17OpenGL_accelerate_7wrapper_cArgConverter; __pyx_vtable_17OpenGL_accelerate_7wrapper_cArgConverter.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_cArgConverter *, PyObject *, int, PyObject *))__pyx_f_17OpenGL_accelerate_7wrapper_13cArgConverter_c_call; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_7wrapper_cArgConverter) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_7wrapper_cArgConverter.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_7wrapper_cArgConverter.tp_dictoffset && __pyx_type_17OpenGL_accelerate_7wrapper_cArgConverter.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_7wrapper_cArgConverter.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -24671,7 +24872,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtabptr_17OpenGL_accelerate_7wrapper_pyArgConverter = &__pyx_vtable_17OpenGL_accelerate_7wrapper_pyArgConverter; __pyx_vtable_17OpenGL_accelerate_7wrapper_pyArgConverter.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_pyArgConverter *, PyObject *, PyObject *, PyObject *))__pyx_f_17OpenGL_accelerate_7wrapper_14pyArgConverter_c_call; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_7wrapper_pyArgConverter) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_7wrapper_pyArgConverter.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_7wrapper_pyArgConverter.tp_dictoffset && __pyx_type_17OpenGL_accelerate_7wrapper_pyArgConverter.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_7wrapper_pyArgConverter.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -24692,7 +24895,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtabptr_17OpenGL_accelerate_7wrapper_cArgumentConverter = &__pyx_vtable_17OpenGL_accelerate_7wrapper_cArgumentConverter; __pyx_vtable_17OpenGL_accelerate_7wrapper_cArgumentConverter.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_cArgumentConverter *, PyObject *))__pyx_f_17OpenGL_accelerate_7wrapper_18cArgumentConverter_c_call; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_7wrapper_cArgumentConverter) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_7wrapper_cArgumentConverter.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_7wrapper_cArgumentConverter.tp_dictoffset && __pyx_type_17OpenGL_accelerate_7wrapper_cArgumentConverter.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_7wrapper_cArgumentConverter.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -24713,7 +24918,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtabptr_17OpenGL_accelerate_7wrapper_returnConverter = &__pyx_vtable_17OpenGL_accelerate_7wrapper_returnConverter; __pyx_vtable_17OpenGL_accelerate_7wrapper_returnConverter.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_returnConverter *, PyObject *, PyObject *, PyObject *, PyObject *))__pyx_f_17OpenGL_accelerate_7wrapper_15returnConverter_c_call; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_7wrapper_returnConverter) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_7wrapper_returnConverter.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_7wrapper_returnConverter.tp_dictoffset && __pyx_type_17OpenGL_accelerate_7wrapper_returnConverter.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_7wrapper_returnConverter.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -24734,7 +24941,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtabptr_17OpenGL_accelerate_7wrapper_CArgCalculatorElement = &__pyx_vtable_17OpenGL_accelerate_7wrapper_CArgCalculatorElement; __pyx_vtable_17OpenGL_accelerate_7wrapper_CArgCalculatorElement.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_CArgCalculatorElement *, PyObject *))__pyx_f_17OpenGL_accelerate_7wrapper_21CArgCalculatorElement_c_call; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_7wrapper_CArgCalculatorElement) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_7wrapper_CArgCalculatorElement.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_7wrapper_CArgCalculatorElement.tp_dictoffset && __pyx_type_17OpenGL_accelerate_7wrapper_CArgCalculatorElement.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_7wrapper_CArgCalculatorElement.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -24755,7 +24964,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtabptr_17OpenGL_accelerate_7wrapper_CArgCalculator = &__pyx_vtable_17OpenGL_accelerate_7wrapper_CArgCalculator; __pyx_vtable_17OpenGL_accelerate_7wrapper_CArgCalculator.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_CArgCalculator *, PyObject *))__pyx_f_17OpenGL_accelerate_7wrapper_14CArgCalculator_c_call; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_7wrapper_CArgCalculator) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_7wrapper_CArgCalculator.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_7wrapper_CArgCalculator.tp_dictoffset && __pyx_type_17OpenGL_accelerate_7wrapper_CArgCalculator.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_7wrapper_CArgCalculator.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -24766,7 +24977,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtabptr_17OpenGL_accelerate_7wrapper_PyArgCalculatorElement = &__pyx_vtable_17OpenGL_accelerate_7wrapper_PyArgCalculatorElement; __pyx_vtable_17OpenGL_accelerate_7wrapper_PyArgCalculatorElement.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_PyArgCalculatorElement *, PyObject *))__pyx_f_17OpenGL_accelerate_7wrapper_22PyArgCalculatorElement_c_call; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_7wrapper_PyArgCalculatorElement) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_7wrapper_PyArgCalculatorElement.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_7wrapper_PyArgCalculatorElement.tp_dictoffset && __pyx_type_17OpenGL_accelerate_7wrapper_PyArgCalculatorElement.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_7wrapper_PyArgCalculatorElement.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -24787,7 +25000,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtabptr_17OpenGL_accelerate_7wrapper_PyArgCalculator = &__pyx_vtable_17OpenGL_accelerate_7wrapper_PyArgCalculator; __pyx_vtable_17OpenGL_accelerate_7wrapper_PyArgCalculator.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_PyArgCalculator *, PyObject *))__pyx_f_17OpenGL_accelerate_7wrapper_15PyArgCalculator_c_call; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_7wrapper_PyArgCalculator) < 0) __PYX_ERR(0, 130, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_7wrapper_PyArgCalculator.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_7wrapper_PyArgCalculator.tp_dictoffset && __pyx_type_17OpenGL_accelerate_7wrapper_PyArgCalculator.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_7wrapper_PyArgCalculator.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -24798,7 +25013,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtabptr_17OpenGL_accelerate_7wrapper_CArgumentCalculator = &__pyx_vtable_17OpenGL_accelerate_7wrapper_CArgumentCalculator; __pyx_vtable_17OpenGL_accelerate_7wrapper_CArgumentCalculator.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_CArgumentCalculator *, PyObject *))__pyx_f_17OpenGL_accelerate_7wrapper_19CArgumentCalculator_c_call; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_7wrapper_CArgumentCalculator) < 0) __PYX_ERR(0, 165, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_7wrapper_CArgumentCalculator.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_7wrapper_CArgumentCalculator.tp_dictoffset && __pyx_type_17OpenGL_accelerate_7wrapper_CArgumentCalculator.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_7wrapper_CArgumentCalculator.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -24811,7 +25028,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_7wrapper_CallFuncPyConverter.__pyx_base.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_pyArgConverter *, PyObject *, PyObject *, PyObject *))__pyx_f_17OpenGL_accelerate_7wrapper_19CallFuncPyConverter_c_call; __pyx_type_17OpenGL_accelerate_7wrapper_CallFuncPyConverter.tp_base = __pyx_ptype_17OpenGL_accelerate_7wrapper_pyArgConverter; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_7wrapper_CallFuncPyConverter) < 0) __PYX_ERR(0, 204, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_7wrapper_CallFuncPyConverter.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_7wrapper_CallFuncPyConverter.tp_dictoffset && __pyx_type_17OpenGL_accelerate_7wrapper_CallFuncPyConverter.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_7wrapper_CallFuncPyConverter.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -24844,7 +25063,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_7wrapper_DefaultCConverter.__pyx_base.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_cArgConverter *, PyObject *, int, PyObject *))__pyx_f_17OpenGL_accelerate_7wrapper_17DefaultCConverter_c_call; __pyx_type_17OpenGL_accelerate_7wrapper_DefaultCConverter.tp_base = __pyx_ptype_17OpenGL_accelerate_7wrapper_cArgConverter; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_7wrapper_DefaultCConverter) < 0) __PYX_ERR(0, 219, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_7wrapper_DefaultCConverter.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_7wrapper_DefaultCConverter.tp_dictoffset && __pyx_type_17OpenGL_accelerate_7wrapper_DefaultCConverter.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_7wrapper_DefaultCConverter.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -24863,7 +25084,9 @@ static int __Pyx_modinit_type_init_code(void) { if (__Pyx_setup_reduce((PyObject*)&__pyx_type_17OpenGL_accelerate_7wrapper_DefaultCConverter) < 0) __PYX_ERR(0, 219, __pyx_L1_error) __pyx_ptype_17OpenGL_accelerate_7wrapper_DefaultCConverter = &__pyx_type_17OpenGL_accelerate_7wrapper_DefaultCConverter; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_7wrapper_Wrapper) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_7wrapper_Wrapper.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_7wrapper_Wrapper.tp_dictoffset && __pyx_type_17OpenGL_accelerate_7wrapper_Wrapper.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_7wrapper_Wrapper.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -24875,7 +25098,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_7wrapper_getPyArgsName.__pyx_base.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_cArgConverter *, PyObject *, int, PyObject *))__pyx_f_17OpenGL_accelerate_7wrapper_13getPyArgsName_c_call; __pyx_type_17OpenGL_accelerate_7wrapper_getPyArgsName.tp_base = __pyx_ptype_17OpenGL_accelerate_7wrapper_cArgConverter; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_7wrapper_getPyArgsName) < 0) __PYX_ERR(0, 343, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_7wrapper_getPyArgsName.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_7wrapper_getPyArgsName.tp_dictoffset && __pyx_type_17OpenGL_accelerate_7wrapper_getPyArgsName.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_7wrapper_getPyArgsName.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -24888,7 +25113,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_7wrapper_returnPyArgument.__pyx_base.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_returnConverter *, PyObject *, PyObject *, PyObject *, PyObject *))__pyx_f_17OpenGL_accelerate_7wrapper_16returnPyArgument_c_call; __pyx_type_17OpenGL_accelerate_7wrapper_returnPyArgument.tp_base = __pyx_ptype_17OpenGL_accelerate_7wrapper_returnConverter; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_7wrapper_returnPyArgument) < 0) __PYX_ERR(0, 363, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_7wrapper_returnPyArgument.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_7wrapper_returnPyArgument.tp_dictoffset && __pyx_type_17OpenGL_accelerate_7wrapper_returnPyArgument.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_7wrapper_returnPyArgument.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -24901,7 +25128,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_7wrapper_returnPyArgumentIndex.__pyx_base.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_returnConverter *, PyObject *, PyObject *, PyObject *, PyObject *))__pyx_f_17OpenGL_accelerate_7wrapper_21returnPyArgumentIndex_c_call; __pyx_type_17OpenGL_accelerate_7wrapper_returnPyArgumentIndex.tp_base = __pyx_ptype_17OpenGL_accelerate_7wrapper_returnConverter; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_7wrapper_returnPyArgumentIndex) < 0) __PYX_ERR(0, 379, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_7wrapper_returnPyArgumentIndex.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_7wrapper_returnPyArgumentIndex.tp_dictoffset && __pyx_type_17OpenGL_accelerate_7wrapper_returnPyArgumentIndex.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_7wrapper_returnPyArgumentIndex.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -24914,7 +25143,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_vtable_17OpenGL_accelerate_7wrapper_returnCArgument.__pyx_base.c_call = (PyObject *(*)(struct __pyx_obj_17OpenGL_accelerate_7wrapper_returnConverter *, PyObject *, PyObject *, PyObject *, PyObject *))__pyx_f_17OpenGL_accelerate_7wrapper_15returnCArgument_c_call; __pyx_type_17OpenGL_accelerate_7wrapper_returnCArgument.tp_base = __pyx_ptype_17OpenGL_accelerate_7wrapper_returnConverter; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_7wrapper_returnCArgument) < 0) __PYX_ERR(0, 393, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_7wrapper_returnCArgument.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_7wrapper_returnCArgument.tp_dictoffset && __pyx_type_17OpenGL_accelerate_7wrapper_returnCArgument.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_7wrapper_returnCArgument.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -24923,7 +25154,9 @@ static int __Pyx_modinit_type_init_code(void) { if (__Pyx_setup_reduce((PyObject*)&__pyx_type_17OpenGL_accelerate_7wrapper_returnCArgument) < 0) __PYX_ERR(0, 393, __pyx_L1_error) __pyx_ptype_17OpenGL_accelerate_7wrapper_returnCArgument = &__pyx_type_17OpenGL_accelerate_7wrapper_returnCArgument; if (PyType_Ready(&__pyx_type_17OpenGL_accelerate_7wrapper_MultiReturn) < 0) __PYX_ERR(0, 410, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 __pyx_type_17OpenGL_accelerate_7wrapper_MultiReturn.tp_print = 0; + #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_17OpenGL_accelerate_7wrapper_MultiReturn.tp_dictoffset && __pyx_type_17OpenGL_accelerate_7wrapper_MultiReturn.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_17OpenGL_accelerate_7wrapper_MultiReturn.tp_getattro = __Pyx_PyObject_GenericGetAttr; } @@ -25122,10 +25355,9 @@ if (!__Pyx_RefNanny) { __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); - #endif + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_cython_runtime); if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) @@ -25144,9 +25376,9 @@ if (!__Pyx_RefNanny) { } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error; /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); @@ -25720,6 +25952,32 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject return (likely(r)) ? r : __Pyx_GetAttr3Default(d); } +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) @@ -25817,7 +26075,7 @@ static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); @@ -25888,12 +26146,12 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, nargs, + args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif From 57b7706766173aa907f96700b37d77fb96c7f13d Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Fri, 3 Jan 2020 16:54:36 -0500 Subject: [PATCH 45/48] Run accelerate tests from base tox as well --- tests/test_gldouble_ctypes.py | 11 +---------- tox.ini | 3 ++- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/tests/test_gldouble_ctypes.py b/tests/test_gldouble_ctypes.py index 79a8ca78..c2c67e58 100644 --- a/tests/test_gldouble_ctypes.py +++ b/tests/test_gldouble_ctypes.py @@ -9,12 +9,9 @@ from OpenGL.arrays import arraydatatype handler = arraydatatype.ArrayDatatype.getHandler( GLdouble * 16 ) handler.registerReturn( ) - import time,traceback start = time.time() - window = None - def display(): try: glutSetWindow(window); @@ -29,19 +26,15 @@ def display(): except Exception: traceback.print_exc() sys.exit(0) - size = (250,250) - def reshape( *args ): global size size = args glViewport( *( (0,0)+args) ) display() - def ontimer( *args ): print('timer', args, '@time', time.time()-start) glutTimerFunc( 1000, ontimer, 24 ) - def idle(): delta = time.time()-start if delta < 10: @@ -70,14 +63,12 @@ def idle(): pass # Older PyOpenGL, you may see a seg-fault here... import sys sys.exit( 0 ) - def printFunction( name ): def onevent( *args ): print('%s -> %s'%(name, ", ".join( [str(a) for a in args ]))) return onevent - if __name__ == "__main__": import sys newArgv = glutInit(sys.argv) @@ -100,6 +91,6 @@ def onevent( *args ): glutSpecialFunc( printFunction( 'Special' )) glutSpecialUpFunc( printFunction( 'SpecialUp' )) glutTimerFunc( 1000, ontimer, 23 ) - + glutIdleFunc( idle ) glutMainLoop() diff --git a/tox.ini b/tox.ini index 47a48e2e..681147a6 100644 --- a/tox.ini +++ b/tox.ini @@ -18,4 +18,5 @@ deps= accel1: ./accelerate #install_command = pip install -I {opts} {packages} commands= - pytest -sv {posargs:tests/} + accel1: pytest -sv -rxXs {posargs:tests/ accelerate/tests} + accel0: pytest -sv -rxXs {posargs:tests/} From 38edb04cf5ab47cfe45ee724727ccd376d4cafac Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sat, 4 Jan 2020 00:51:34 -0500 Subject: [PATCH 46/48] WIN FIX GL entry points are NULL on windows initially WGL platform leaves the entry points even for core OpenGL functionality as null until you have a context and the image wrapper code was assuming it could rely on the entry point being non-null in deciding whether to wrap the function. --- OpenGL/GL/images.py | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/OpenGL/GL/images.py b/OpenGL/GL/images.py index fd968da6..527ecc3f 100644 --- a/OpenGL/GL/images.py +++ b/OpenGL/GL/images.py @@ -575,39 +575,30 @@ def typedImageFunction( suffix, arrayConstant, baseFunction ): """Produce a typed version of the given image function""" functionName = baseFunction.__name__ functionName = '%(functionName)s%(suffix)s'%locals() - if baseFunction: - arrayType = arrays.GL_CONSTANT_TO_ARRAY_TYPE[ arrayConstant ] - function = setDimensionsAsInts( - setImageInput( - baseFunction, - arrayType, - typeName = arrayConstant, - ) + arrayType = arrays.GL_CONSTANT_TO_ARRAY_TYPE[ arrayConstant ] + function = setDimensionsAsInts( + setImageInput( + baseFunction, + arrayType, + typeName = arrayConstant, ) - return functionName, function - else: - return functionName, baseFunction + ) + return functionName, function def _setDataSize( baseFunction, argument='imageSize' ): """Set the data-size value to come from the data field""" - if baseFunction: - converter = CompressedImageConverter() - return asWrapper( baseFunction ).setPyConverter( - argument - ).setCConverter( argument, converter ) - else: - return baseFunction + converter = CompressedImageConverter() + return asWrapper( baseFunction ).setPyConverter( + argument + ).setCConverter( argument, converter ) def compressedImageFunction( baseFunction ): """Set the imageSize and dimensions-as-ints converters for baseFunction""" - if baseFunction: - return setDimensionsAsInts( - _setDataSize( - baseFunction, argument='imageSize' - ) + return setDimensionsAsInts( + _setDataSize( + baseFunction, argument='imageSize' ) - else: - return baseFunction + ) for suffix,arrayConstant in [ ('b', GL_1_1.GL_BYTE), From d06c1ac8ab70e2fdfc43b30c6639630b3b8249ab Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Sat, 4 Jan 2020 00:53:27 -0500 Subject: [PATCH 47/48] NUMPY Register intc and uintc as handled scalar types These types are seen on a new windows setup, likely because we picked up a more recent numpy than seen on the linux machines. --- OpenGL/arrays/numpymodule.py | 2 + accelerate/src/numpy_formathandler.c | 818 +++++++++++++------------ accelerate/src/numpy_formathandler.pyx | 2 + 3 files changed, 434 insertions(+), 388 deletions(-) diff --git a/OpenGL/arrays/numpymodule.py b/OpenGL/arrays/numpymodule.py index 68f34788..5202e0df 100644 --- a/OpenGL/arrays/numpymodule.py +++ b/OpenGL/arrays/numpymodule.py @@ -77,6 +77,8 @@ class NumpyHandler( formathandler.FormatHandler ): HANDLED_TYPES = ( numpy.ndarray, numpy.bool_, + numpy.intc, + numpy.uintc, numpy.int8, numpy.uint8, numpy.int16, diff --git a/accelerate/src/numpy_formathandler.c b/accelerate/src/numpy_formathandler.c index 3b323f3e..0e66c646 100644 --- a/accelerate/src/numpy_formathandler.c +++ b/accelerate/src/numpy_formathandler.c @@ -1805,6 +1805,7 @@ static const char __pyx_k_bool[] = "bool_"; static const char __pyx_k_char[] = "char"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_int8[] = "int8"; +static const char __pyx_k_intc[] = "intc"; static const char __pyx_k_keys[] = "keys"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; @@ -1820,6 +1821,7 @@ static const char __pyx_k_numpy[] = "numpy"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_shape[] = "shape"; static const char __pyx_k_uint8[] = "uint8"; +static const char __pyx_k_uintc[] = "uintc"; static const char __pyx_k_OpenGL[] = "OpenGL"; static const char __pyx_k_ctypes[] = "ctypes"; static const char __pyx_k_import[] = "__import__"; @@ -1946,6 +1948,7 @@ static PyObject *__pyx_n_s_int16; static PyObject *__pyx_n_s_int32; static PyObject *__pyx_n_s_int64; static PyObject *__pyx_n_s_int8; +static PyObject *__pyx_n_s_intc; static PyObject *__pyx_n_s_isOutput; static PyObject *__pyx_n_s_keys; static PyObject *__pyx_n_s_main; @@ -1983,6 +1986,7 @@ static PyObject *__pyx_n_s_uint16; static PyObject *__pyx_n_s_uint32; static PyObject *__pyx_n_s_uint64; static PyObject *__pyx_n_s_uint8; +static PyObject *__pyx_n_s_uintc; static PyObject *__pyx_n_s_unicode; static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; static PyObject *__pyx_n_s_update; @@ -2085,7 +2089,7 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_de return __pyx_r; } -/* "src/numpy_formathandler.pyx":72 +/* "src/numpy_formathandler.pyx":74 * HANDLED_TYPES += (np.complex256,) * * def __init__( self, ERROR_ON_COPY=None, a_to_gl=None, gl_to_a=None ): # <<<<<<<<<<<<<< @@ -2142,7 +2146,7 @@ static int __pyx_pw_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler_1__ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 72, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 74, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2162,7 +2166,7 @@ static int __pyx_pw_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler_1__ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 74, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("OpenGL_accelerate.numpy_formathandler.NumpyHandler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2191,7 +2195,7 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i __Pyx_INCREF(__pyx_v_a_to_gl); __Pyx_INCREF(__pyx_v_gl_to_a); - /* "src/numpy_formathandler.pyx":73 + /* "src/numpy_formathandler.pyx":75 * * def __init__( self, ERROR_ON_COPY=None, a_to_gl=None, gl_to_a=None ): * if ERROR_ON_COPY is None: # <<<<<<<<<<<<<< @@ -2202,41 +2206,41 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "src/numpy_formathandler.pyx":74 + /* "src/numpy_formathandler.pyx":76 * def __init__( self, ERROR_ON_COPY=None, a_to_gl=None, gl_to_a=None ): * if ERROR_ON_COPY is None: * from OpenGL import _configflags # <<<<<<<<<<<<<< * ERROR_ON_COPY = _configflags.ERROR_ON_COPY * if a_to_gl is None: */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_configflags); __Pyx_GIVEREF(__pyx_n_s_configflags); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_configflags); - __pyx_t_4 = __Pyx_Import(__pyx_n_s_OpenGL, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_4 = __Pyx_Import(__pyx_n_s_OpenGL, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_configflags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_configflags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_v__configflags = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "src/numpy_formathandler.pyx":75 + /* "src/numpy_formathandler.pyx":77 * if ERROR_ON_COPY is None: * from OpenGL import _configflags * ERROR_ON_COPY = _configflags.ERROR_ON_COPY # <<<<<<<<<<<<<< * if a_to_gl is None: * from OpenGL.arrays.numpymodule import ARRAY_TO_GL_TYPE_MAPPING */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__configflags, __pyx_n_s_ERROR_ON_COPY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__configflags, __pyx_n_s_ERROR_ON_COPY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_ERROR_ON_COPY, __pyx_t_4); __pyx_t_4 = 0; - /* "src/numpy_formathandler.pyx":73 + /* "src/numpy_formathandler.pyx":75 * * def __init__( self, ERROR_ON_COPY=None, a_to_gl=None, gl_to_a=None ): * if ERROR_ON_COPY is None: # <<<<<<<<<<<<<< @@ -2245,7 +2249,7 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i */ } - /* "src/numpy_formathandler.pyx":76 + /* "src/numpy_formathandler.pyx":78 * from OpenGL import _configflags * ERROR_ON_COPY = _configflags.ERROR_ON_COPY * if a_to_gl is None: # <<<<<<<<<<<<<< @@ -2256,29 +2260,29 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "src/numpy_formathandler.pyx":77 + /* "src/numpy_formathandler.pyx":79 * ERROR_ON_COPY = _configflags.ERROR_ON_COPY * if a_to_gl is None: * from OpenGL.arrays.numpymodule import ARRAY_TO_GL_TYPE_MAPPING # <<<<<<<<<<<<<< * a_to_gl = ARRAY_TO_GL_TYPE_MAPPING * if gl_to_a is None: */ - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_n_s_ARRAY_TO_GL_TYPE_MAPPING); __Pyx_GIVEREF(__pyx_n_s_ARRAY_TO_GL_TYPE_MAPPING); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_ARRAY_TO_GL_TYPE_MAPPING); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_OpenGL_arrays_numpymodule, __pyx_t_4, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_n_s_OpenGL_arrays_numpymodule, __pyx_t_4, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_ARRAY_TO_GL_TYPE_MAPPING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_ARRAY_TO_GL_TYPE_MAPPING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_4); __pyx_v_ARRAY_TO_GL_TYPE_MAPPING = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "src/numpy_formathandler.pyx":78 + /* "src/numpy_formathandler.pyx":80 * if a_to_gl is None: * from OpenGL.arrays.numpymodule import ARRAY_TO_GL_TYPE_MAPPING * a_to_gl = ARRAY_TO_GL_TYPE_MAPPING # <<<<<<<<<<<<<< @@ -2288,7 +2292,7 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i __Pyx_INCREF(__pyx_v_ARRAY_TO_GL_TYPE_MAPPING); __Pyx_DECREF_SET(__pyx_v_a_to_gl, __pyx_v_ARRAY_TO_GL_TYPE_MAPPING); - /* "src/numpy_formathandler.pyx":76 + /* "src/numpy_formathandler.pyx":78 * from OpenGL import _configflags * ERROR_ON_COPY = _configflags.ERROR_ON_COPY * if a_to_gl is None: # <<<<<<<<<<<<<< @@ -2297,7 +2301,7 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i */ } - /* "src/numpy_formathandler.pyx":79 + /* "src/numpy_formathandler.pyx":81 * from OpenGL.arrays.numpymodule import ARRAY_TO_GL_TYPE_MAPPING * a_to_gl = ARRAY_TO_GL_TYPE_MAPPING * if gl_to_a is None: # <<<<<<<<<<<<<< @@ -2308,29 +2312,29 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "src/numpy_formathandler.pyx":80 + /* "src/numpy_formathandler.pyx":82 * a_to_gl = ARRAY_TO_GL_TYPE_MAPPING * if gl_to_a is None: * from OpenGL.arrays.numpymodule import GL_TYPE_TO_ARRAY_MAPPING # <<<<<<<<<<<<<< * gl_to_a = GL_TYPE_TO_ARRAY_MAPPING * self.ERROR_ON_COPY = ERROR_ON_COPY */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_GL_TYPE_TO_ARRAY_MAPPING); __Pyx_GIVEREF(__pyx_n_s_GL_TYPE_TO_ARRAY_MAPPING); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_GL_TYPE_TO_ARRAY_MAPPING); - __pyx_t_4 = __Pyx_Import(__pyx_n_s_OpenGL_arrays_numpymodule, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_4 = __Pyx_Import(__pyx_n_s_OpenGL_arrays_numpymodule, __pyx_t_3, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_GL_TYPE_TO_ARRAY_MAPPING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_GL_TYPE_TO_ARRAY_MAPPING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_v_GL_TYPE_TO_ARRAY_MAPPING = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "src/numpy_formathandler.pyx":81 + /* "src/numpy_formathandler.pyx":83 * if gl_to_a is None: * from OpenGL.arrays.numpymodule import GL_TYPE_TO_ARRAY_MAPPING * gl_to_a = GL_TYPE_TO_ARRAY_MAPPING # <<<<<<<<<<<<<< @@ -2340,7 +2344,7 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i __Pyx_INCREF(__pyx_v_GL_TYPE_TO_ARRAY_MAPPING); __Pyx_DECREF_SET(__pyx_v_gl_to_a, __pyx_v_GL_TYPE_TO_ARRAY_MAPPING); - /* "src/numpy_formathandler.pyx":79 + /* "src/numpy_formathandler.pyx":81 * from OpenGL.arrays.numpymodule import ARRAY_TO_GL_TYPE_MAPPING * a_to_gl = ARRAY_TO_GL_TYPE_MAPPING * if gl_to_a is None: # <<<<<<<<<<<<<< @@ -2349,24 +2353,24 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i */ } - /* "src/numpy_formathandler.pyx":82 + /* "src/numpy_formathandler.pyx":84 * from OpenGL.arrays.numpymodule import GL_TYPE_TO_ARRAY_MAPPING * gl_to_a = GL_TYPE_TO_ARRAY_MAPPING * self.ERROR_ON_COPY = ERROR_ON_COPY # <<<<<<<<<<<<<< * self.array_to_gl_constant = a_to_gl * self.gl_constant_to_array = gl_to_a */ - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_ERROR_ON_COPY); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_ERROR_ON_COPY); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error) __pyx_v_self->__pyx_base.ERROR_ON_COPY = __pyx_t_5; - /* "src/numpy_formathandler.pyx":83 + /* "src/numpy_formathandler.pyx":85 * gl_to_a = GL_TYPE_TO_ARRAY_MAPPING * self.ERROR_ON_COPY = ERROR_ON_COPY * self.array_to_gl_constant = a_to_gl # <<<<<<<<<<<<<< * self.gl_constant_to_array = gl_to_a * */ - if (!(likely(PyDict_CheckExact(__pyx_v_a_to_gl))||((__pyx_v_a_to_gl) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_a_to_gl)->tp_name), 0))) __PYX_ERR(0, 83, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_a_to_gl))||((__pyx_v_a_to_gl) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_a_to_gl)->tp_name), 0))) __PYX_ERR(0, 85, __pyx_L1_error) __pyx_t_4 = __pyx_v_a_to_gl; __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -2375,14 +2379,14 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i __pyx_v_self->array_to_gl_constant = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "src/numpy_formathandler.pyx":84 + /* "src/numpy_formathandler.pyx":86 * self.ERROR_ON_COPY = ERROR_ON_COPY * self.array_to_gl_constant = a_to_gl * self.gl_constant_to_array = gl_to_a # <<<<<<<<<<<<<< * * cdef np.ndarray c_check_array( self, object instance ): */ - if (!(likely(PyDict_CheckExact(__pyx_v_gl_to_a))||((__pyx_v_gl_to_a) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_gl_to_a)->tp_name), 0))) __PYX_ERR(0, 84, __pyx_L1_error) + if (!(likely(PyDict_CheckExact(__pyx_v_gl_to_a))||((__pyx_v_gl_to_a) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_gl_to_a)->tp_name), 0))) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_t_4 = __pyx_v_gl_to_a; __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -2391,7 +2395,7 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i __pyx_v_self->gl_constant_to_array = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "src/numpy_formathandler.pyx":72 + /* "src/numpy_formathandler.pyx":74 * HANDLED_TYPES += (np.complex256,) * * def __init__( self, ERROR_ON_COPY=None, a_to_gl=None, gl_to_a=None ): # <<<<<<<<<<<<<< @@ -2418,7 +2422,7 @@ static int __pyx_pf_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandler___i return __pyx_r; } -/* "src/numpy_formathandler.pyx":86 +/* "src/numpy_formathandler.pyx":88 * self.gl_constant_to_array = gl_to_a * * cdef np.ndarray c_check_array( self, object instance ): # <<<<<<<<<<<<<< @@ -2434,7 +2438,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("c_check_array", 0); - /* "src/numpy_formathandler.pyx":87 + /* "src/numpy_formathandler.pyx":89 * * cdef np.ndarray c_check_array( self, object instance ): * if not PyArray_Check( instance ): # <<<<<<<<<<<<<< @@ -2444,14 +2448,14 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __pyx_t_1 = ((!(PyArray_Check(__pyx_v_instance) != 0)) != 0); if (unlikely(__pyx_t_1)) { - /* "src/numpy_formathandler.pyx":89 + /* "src/numpy_formathandler.pyx":91 * if not PyArray_Check( instance ): * raise TypeError( * """Numpy format handler passed a non-numpy-array object %s (of type %s)"""%( instance, type(instance) ), # <<<<<<<<<<<<<< * ) * return instance */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_instance); __Pyx_GIVEREF(__pyx_v_instance); @@ -2459,25 +2463,25 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_instance))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_instance))); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)Py_TYPE(__pyx_v_instance))); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Numpy_format_handler_passed_a_no, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Numpy_format_handler_passed_a_no, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":88 + /* "src/numpy_formathandler.pyx":90 * cdef np.ndarray c_check_array( self, object instance ): * if not PyArray_Check( instance ): * raise TypeError( # <<<<<<<<<<<<<< * """Numpy format handler passed a non-numpy-array object %s (of type %s)"""%( instance, type(instance) ), * ) */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 88, __pyx_L1_error) + __PYX_ERR(0, 90, __pyx_L1_error) - /* "src/numpy_formathandler.pyx":87 + /* "src/numpy_formathandler.pyx":89 * * cdef np.ndarray c_check_array( self, object instance ): * if not PyArray_Check( instance ): # <<<<<<<<<<<<<< @@ -2486,7 +2490,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ } - /* "src/numpy_formathandler.pyx":91 + /* "src/numpy_formathandler.pyx":93 * """Numpy format handler passed a non-numpy-array object %s (of type %s)"""%( instance, type(instance) ), * ) * return instance # <<<<<<<<<<<<<< @@ -2498,7 +2502,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __pyx_r = ((PyArrayObject *)__pyx_v_instance); goto __pyx_L0; - /* "src/numpy_formathandler.pyx":86 + /* "src/numpy_formathandler.pyx":88 * self.gl_constant_to_array = gl_to_a * * cdef np.ndarray c_check_array( self, object instance ): # <<<<<<<<<<<<<< @@ -2518,7 +2522,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH return __pyx_r; } -/* "src/numpy_formathandler.pyx":93 +/* "src/numpy_formathandler.pyx":95 * return instance * * cdef c_from_param( self, object instance, object typeCode ): # <<<<<<<<<<<<<< @@ -2541,29 +2545,29 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("c_from_param", 0); - /* "src/numpy_formathandler.pyx":95 + /* "src/numpy_formathandler.pyx":97 * cdef c_from_param( self, object instance, object typeCode ): * """simple function-based from_param""" * cdef np.ndarray working = self.c_check_array( instance ) # <<<<<<<<<<<<<< * cdef np.dtype targetType * if typeCode: */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_working = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "src/numpy_formathandler.pyx":97 + /* "src/numpy_formathandler.pyx":99 * cdef np.ndarray working = self.c_check_array( instance ) * cdef np.dtype targetType * if typeCode: # <<<<<<<<<<<<<< * targetType = (self.gl_constant_to_array[ typeCode ]) * if array_descr(instance) != targetType: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_typeCode); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_typeCode); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 99, __pyx_L1_error) if (__pyx_t_2) { - /* "src/numpy_formathandler.pyx":98 + /* "src/numpy_formathandler.pyx":100 * cdef np.dtype targetType * if typeCode: * targetType = (self.gl_constant_to_array[ typeCode ]) # <<<<<<<<<<<<<< @@ -2572,9 +2576,9 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ if (unlikely(__pyx_v_self->gl_constant_to_array == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 98, __pyx_L1_error) + __PYX_ERR(0, 100, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->gl_constant_to_array, __pyx_v_typeCode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->gl_constant_to_array, __pyx_v_typeCode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); @@ -2582,46 +2586,46 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_v_targetType = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "src/numpy_formathandler.pyx":99 + /* "src/numpy_formathandler.pyx":101 * if typeCode: * targetType = (self.gl_constant_to_array[ typeCode ]) * if array_descr(instance) != targetType: # <<<<<<<<<<<<<< * raise CopyError( * """Array of type %r passed, required array of type %r""", */ - if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 99, __pyx_L1_error) - __pyx_t_3 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(((PyArrayObject *)__pyx_v_instance))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) + if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(((PyArrayObject *)__pyx_v_instance))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_v_targetType), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_v_targetType), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_2)) { - /* "src/numpy_formathandler.pyx":100 + /* "src/numpy_formathandler.pyx":102 * targetType = (self.gl_constant_to_array[ typeCode ]) * if array_descr(instance) != targetType: * raise CopyError( # <<<<<<<<<<<<<< * """Array of type %r passed, required array of type %r""", * array_descr(instance).char, targetType.char, */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CopyError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CopyError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "src/numpy_formathandler.pyx":102 + /* "src/numpy_formathandler.pyx":104 * raise CopyError( * """Array of type %r passed, required array of type %r""", * array_descr(instance).char, targetType.char, # <<<<<<<<<<<<<< * ) * if not PyArray_ISCARRAY_RO( instance ): */ - if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 102, __pyx_L1_error) - __pyx_t_4 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(((PyArrayObject *)__pyx_v_instance))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error) + if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_4 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(((PyArrayObject *)__pyx_v_instance))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_char); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_char); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_targetType), __pyx_n_s_char); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_targetType), __pyx_n_s_char); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -2638,7 +2642,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_kp_s_Array_of_type_r_passed_required, __pyx_t_5, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -2648,7 +2652,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_kp_s_Array_of_type_r_passed_required, __pyx_t_5, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -2656,7 +2660,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle } else #endif { - __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -2670,16 +2674,16 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_4); __pyx_t_5 = 0; __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 100, __pyx_L1_error) + __PYX_ERR(0, 102, __pyx_L1_error) - /* "src/numpy_formathandler.pyx":99 + /* "src/numpy_formathandler.pyx":101 * if typeCode: * targetType = (self.gl_constant_to_array[ typeCode ]) * if array_descr(instance) != targetType: # <<<<<<<<<<<<<< @@ -2688,7 +2692,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ } - /* "src/numpy_formathandler.pyx":97 + /* "src/numpy_formathandler.pyx":99 * cdef np.ndarray working = self.c_check_array( instance ) * cdef np.dtype targetType * if typeCode: # <<<<<<<<<<<<<< @@ -2697,48 +2701,48 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ } - /* "src/numpy_formathandler.pyx":104 + /* "src/numpy_formathandler.pyx":106 * array_descr(instance).char, targetType.char, * ) * if not PyArray_ISCARRAY_RO( instance ): # <<<<<<<<<<<<<< * raise CopyError( * """from_param received a non-contiguous array! %s"""%( */ - if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 104, __pyx_L1_error) + if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 106, __pyx_L1_error) __pyx_t_2 = ((!(PyArray_ISCARRAY_RO(((PyArrayObject *)__pyx_v_instance)) != 0)) != 0); if (unlikely(__pyx_t_2)) { - /* "src/numpy_formathandler.pyx":105 + /* "src/numpy_formathandler.pyx":107 * ) * if not PyArray_ISCARRAY_RO( instance ): * raise CopyError( # <<<<<<<<<<<<<< * """from_param received a non-contiguous array! %s"""%( * working, */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CopyError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CopyError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "src/numpy_formathandler.pyx":107 + /* "src/numpy_formathandler.pyx":109 * raise CopyError( * """from_param received a non-contiguous array! %s"""%( * working, # <<<<<<<<<<<<<< * ) * ) */ - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_v_working)); __Pyx_GIVEREF(((PyObject *)__pyx_v_working)); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_working)); - /* "src/numpy_formathandler.pyx":106 + /* "src/numpy_formathandler.pyx":108 * if not PyArray_ISCARRAY_RO( instance ): * raise CopyError( * """from_param received a non-contiguous array! %s"""%( # <<<<<<<<<<<<<< * working, * ) */ - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_from_param_received_a_non_contig, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_from_param_received_a_non_contig, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -2754,14 +2758,14 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 105, __pyx_L1_error) + __PYX_ERR(0, 107, __pyx_L1_error) - /* "src/numpy_formathandler.pyx":104 + /* "src/numpy_formathandler.pyx":106 * array_descr(instance).char, targetType.char, * ) * if not PyArray_ISCARRAY_RO( instance ): # <<<<<<<<<<<<<< @@ -2770,7 +2774,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ } - /* "src/numpy_formathandler.pyx":110 + /* "src/numpy_formathandler.pyx":112 * ) * ) * return c_void_p( PyArray_DATA(working)) # <<<<<<<<<<<<<< @@ -2778,9 +2782,9 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle * cdef c_dataPointer( self, object instance ): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_c_void_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_c_void_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_FromSize_t(((size_t)PyArray_DATA(__pyx_v_working))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_FromSize_t(((size_t)PyArray_DATA(__pyx_v_working))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -2795,14 +2799,14 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":93 + /* "src/numpy_formathandler.pyx":95 * return instance * * cdef c_from_param( self, object instance, object typeCode ): # <<<<<<<<<<<<<< @@ -2828,7 +2832,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":112 +/* "src/numpy_formathandler.pyx":114 * return c_void_p( PyArray_DATA(working)) * * cdef c_dataPointer( self, object instance ): # <<<<<<<<<<<<<< @@ -2843,7 +2847,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("c_dataPointer", 0); - /* "src/numpy_formathandler.pyx":114 + /* "src/numpy_formathandler.pyx":116 * cdef c_dataPointer( self, object instance ): * """Retrieve data-pointer directly""" * return PyArray_DATA(self.c_check_array( instance )) # <<<<<<<<<<<<<< @@ -2851,16 +2855,16 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle * """Create an array initialized to zeros""" */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_FromSize_t(((size_t)PyArray_DATA(((PyArrayObject *)__pyx_t_1)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_FromSize_t(((size_t)PyArray_DATA(((PyArrayObject *)__pyx_t_1)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":112 + /* "src/numpy_formathandler.pyx":114 * return c_void_p( PyArray_DATA(working)) * * cdef c_dataPointer( self, object instance ): # <<<<<<<<<<<<<< @@ -2880,7 +2884,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":115 +/* "src/numpy_formathandler.pyx":117 * """Retrieve data-pointer directly""" * return PyArray_DATA(self.c_check_array( instance )) * cdef c_zeros( self, object dims, object typeCode ): # <<<<<<<<<<<<<< @@ -2911,7 +2915,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __Pyx_RefNannySetupContext("c_zeros", 0); __Pyx_INCREF(__pyx_v_dims); - /* "src/numpy_formathandler.pyx":118 + /* "src/numpy_formathandler.pyx":120 * """Create an array initialized to zeros""" * cdef np.ndarray c_dims * try: # <<<<<<<<<<<<<< @@ -2927,39 +2931,39 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "src/numpy_formathandler.pyx":120 + /* "src/numpy_formathandler.pyx":122 * try: * c_dims = PyArray_ContiguousFromAny( * [int(x) for x in dims], np.NPY_INTP, 1,1 # <<<<<<<<<<<<<< * ) * except (ValueError,TypeError), err: */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L3_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_v_dims)) || PyTuple_CheckExact(__pyx_v_dims)) { __pyx_t_5 = __pyx_v_dims; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L3_error) + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 120, __pyx_L3_error) + __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L3_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 120, __pyx_L3_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 122, __pyx_L3_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 120, __pyx_L3_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 122, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 120, __pyx_L3_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 122, __pyx_L3_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 120, __pyx_L3_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 122, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); #endif } @@ -2969,7 +2973,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 120, __pyx_L3_error) + else __PYX_ERR(0, 122, __pyx_L3_error) } break; } @@ -2977,27 +2981,27 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle } __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 120, __pyx_L3_error) + __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 122, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 120, __pyx_L3_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 122, __pyx_L3_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "src/numpy_formathandler.pyx":119 + /* "src/numpy_formathandler.pyx":121 * cdef np.ndarray c_dims * try: * c_dims = PyArray_ContiguousFromAny( # <<<<<<<<<<<<<< * [int(x) for x in dims], np.NPY_INTP, 1,1 * ) */ - __pyx_t_5 = ((PyObject *)PyArray_ContiguousFromAny(__pyx_t_4, NPY_INTP, 1, 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L3_error) + __pyx_t_5 = ((PyObject *)PyArray_ContiguousFromAny(__pyx_t_4, NPY_INTP, 1, 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_c_dims = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "src/numpy_formathandler.pyx":118 + /* "src/numpy_formathandler.pyx":120 * """Create an array initialized to zeros""" * cdef np.ndarray c_dims * try: # <<<<<<<<<<<<<< @@ -3014,7 +3018,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "src/numpy_formathandler.pyx":122 + /* "src/numpy_formathandler.pyx":124 * [int(x) for x in dims], np.NPY_INTP, 1,1 * ) * except (ValueError,TypeError), err: # <<<<<<<<<<<<<< @@ -3024,23 +3028,23 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_9) { __Pyx_AddTraceback("OpenGL_accelerate.numpy_formathandler.NumpyHandler.c_zeros", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_8) < 0) __PYX_ERR(0, 122, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_8) < 0) __PYX_ERR(0, 124, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_v_err = __pyx_t_4; - /* "src/numpy_formathandler.pyx":123 + /* "src/numpy_formathandler.pyx":125 * ) * except (ValueError,TypeError), err: * dims = (int(dims),) # <<<<<<<<<<<<<< * c_dims = PyArray_ContiguousFromAny( * dims, np.NPY_INTP, 1,1 */ - __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_v_dims); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 123, __pyx_L5_except_error) + __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_v_dims); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 125, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 123, __pyx_L5_except_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 125, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); @@ -3048,14 +3052,14 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __Pyx_DECREF_SET(__pyx_v_dims, __pyx_t_11); __pyx_t_11 = 0; - /* "src/numpy_formathandler.pyx":124 + /* "src/numpy_formathandler.pyx":126 * except (ValueError,TypeError), err: * dims = (int(dims),) * c_dims = PyArray_ContiguousFromAny( # <<<<<<<<<<<<<< * dims, np.NPY_INTP, 1,1 * ) */ - __pyx_t_11 = ((PyObject *)PyArray_ContiguousFromAny(__pyx_v_dims, NPY_INTP, 1, 1)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 124, __pyx_L5_except_error) + __pyx_t_11 = ((PyObject *)PyArray_ContiguousFromAny(__pyx_v_dims, NPY_INTP, 1, 1)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 126, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF_SET(__pyx_v_c_dims, ((PyArrayObject *)__pyx_t_11)); __pyx_t_11 = 0; @@ -3067,7 +3071,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "src/numpy_formathandler.pyx":118 + /* "src/numpy_formathandler.pyx":120 * """Create an array initialized to zeros""" * cdef np.ndarray c_dims * try: # <<<<<<<<<<<<<< @@ -3087,19 +3091,19 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_L8_try_end:; } - /* "src/numpy_formathandler.pyx":127 + /* "src/numpy_formathandler.pyx":129 * dims, np.NPY_INTP, 1,1 * ) * cdef np.dtype typecode = self.typeCodeToDtype( typeCode ) # <<<<<<<<<<<<<< * Py_INCREF( typecode ) * cdef np.npy_intp ndims = PyArray_SIZE(c_dims) */ - __pyx_t_8 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->typeCodeToDtype(__pyx_v_self, __pyx_v_typeCode)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_8 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->typeCodeToDtype(__pyx_v_self, __pyx_v_typeCode)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_typecode = ((PyArray_Descr *)__pyx_t_8); __pyx_t_8 = 0; - /* "src/numpy_formathandler.pyx":128 + /* "src/numpy_formathandler.pyx":130 * ) * cdef np.dtype typecode = self.typeCodeToDtype( typeCode ) * Py_INCREF( typecode ) # <<<<<<<<<<<<<< @@ -3108,7 +3112,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ Py_INCREF(((PyObject *)__pyx_v_typecode)); - /* "src/numpy_formathandler.pyx":129 + /* "src/numpy_formathandler.pyx":131 * cdef np.dtype typecode = self.typeCodeToDtype( typeCode ) * Py_INCREF( typecode ) * cdef np.npy_intp ndims = PyArray_SIZE(c_dims) # <<<<<<<<<<<<<< @@ -3117,19 +3121,19 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ __pyx_v_ndims = PyArray_SIZE(__pyx_v_c_dims); - /* "src/numpy_formathandler.pyx":130 + /* "src/numpy_formathandler.pyx":132 * Py_INCREF( typecode ) * cdef np.npy_intp ndims = PyArray_SIZE(c_dims) * cdef np.ndarray result = PyArray_Zeros( ndims, PyArray_DATA(c_dims), typecode, 0 ) # <<<<<<<<<<<<<< * # Py_INCREF( result ) * return result */ - __pyx_t_8 = ((PyObject *)PyArray_Zeros(((int)__pyx_v_ndims), ((npy_intp *)PyArray_DATA(__pyx_v_c_dims)), __pyx_v_typecode, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_8 = ((PyObject *)PyArray_Zeros(((int)__pyx_v_ndims), ((npy_intp *)PyArray_DATA(__pyx_v_c_dims)), __pyx_v_typecode, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_result = ((PyArrayObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "src/numpy_formathandler.pyx":132 + /* "src/numpy_formathandler.pyx":134 * cdef np.ndarray result = PyArray_Zeros( ndims, PyArray_DATA(c_dims), typecode, 0 ) * # Py_INCREF( result ) * return result # <<<<<<<<<<<<<< @@ -3141,7 +3145,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; - /* "src/numpy_formathandler.pyx":115 + /* "src/numpy_formathandler.pyx":117 * """Retrieve data-pointer directly""" * return PyArray_DATA(self.c_check_array( instance )) * cdef c_zeros( self, object dims, object typeCode ): # <<<<<<<<<<<<<< @@ -3170,7 +3174,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":133 +/* "src/numpy_formathandler.pyx":135 * # Py_INCREF( result ) * return result * cdef c_arraySize( self, object instance, object typeCode ): # <<<<<<<<<<<<<< @@ -3185,7 +3189,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("c_arraySize", 0); - /* "src/numpy_formathandler.pyx":135 + /* "src/numpy_formathandler.pyx":137 * cdef c_arraySize( self, object instance, object typeCode ): * """Retrieve array size reference""" * return (self.c_check_array( instance )).size # <<<<<<<<<<<<<< @@ -3193,16 +3197,16 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle * """Given a data-value, calculate number of bytes required to represent""" */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":133 + /* "src/numpy_formathandler.pyx":135 * # Py_INCREF( result ) * return result * cdef c_arraySize( self, object instance, object typeCode ): # <<<<<<<<<<<<<< @@ -3222,7 +3226,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":136 +/* "src/numpy_formathandler.pyx":138 * """Retrieve array size reference""" * return (self.c_check_array( instance )).size * cdef c_arrayByteCount( self, object instance ): # <<<<<<<<<<<<<< @@ -3236,7 +3240,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("c_arrayByteCount", 0); - /* "src/numpy_formathandler.pyx":138 + /* "src/numpy_formathandler.pyx":140 * cdef c_arrayByteCount( self, object instance ): * """Given a data-value, calculate number of bytes required to represent""" * return instance.nbytes # <<<<<<<<<<<<<< @@ -3244,13 +3248,13 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle * """Given a value, guess OpenGL type of the corresponding pointer""" */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_instance, __pyx_n_s_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_instance, __pyx_n_s_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":136 + /* "src/numpy_formathandler.pyx":138 * """Retrieve array size reference""" * return (self.c_check_array( instance )).size * cdef c_arrayByteCount( self, object instance ): # <<<<<<<<<<<<<< @@ -3269,7 +3273,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":139 +/* "src/numpy_formathandler.pyx":141 * """Given a data-value, calculate number of bytes required to represent""" * return instance.nbytes * cdef c_arrayToGLType( self, object instance ): # <<<<<<<<<<<<<< @@ -3289,19 +3293,19 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("c_arrayToGLType", 0); - /* "src/numpy_formathandler.pyx":141 + /* "src/numpy_formathandler.pyx":143 * cdef c_arrayToGLType( self, object instance ): * """Given a value, guess OpenGL type of the corresponding pointer""" * cdef np.ndarray value = self.c_check_array( instance ) # <<<<<<<<<<<<<< * cdef object constant = self.array_to_gl_constant.get( array_descr(value) ) * if constant is None: */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_value = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "src/numpy_formathandler.pyx":142 + /* "src/numpy_formathandler.pyx":144 * """Given a value, guess OpenGL type of the corresponding pointer""" * cdef np.ndarray value = self.c_check_array( instance ) * cdef object constant = self.array_to_gl_constant.get( array_descr(value) ) # <<<<<<<<<<<<<< @@ -3310,17 +3314,17 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ if (unlikely(__pyx_v_self->array_to_gl_constant == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); - __PYX_ERR(0, 142, __pyx_L1_error) + __PYX_ERR(0, 144, __pyx_L1_error) } - __pyx_t_1 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_value)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_value)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->array_to_gl_constant, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->array_to_gl_constant, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_constant = __pyx_t_2; __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":143 + /* "src/numpy_formathandler.pyx":145 * cdef np.ndarray value = self.c_check_array( instance ) * cdef object constant = self.array_to_gl_constant.get( array_descr(value) ) * if constant is None: # <<<<<<<<<<<<<< @@ -3331,22 +3335,22 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_t_4 = (__pyx_t_3 != 0); if (unlikely(__pyx_t_4)) { - /* "src/numpy_formathandler.pyx":146 + /* "src/numpy_formathandler.pyx":148 * raise TypeError( * """Don't know GL type for array of type %r, known types: %s\nvalue:%s"""%( * array_descr(value), self.array_to_gl_constant.keys(), value, # <<<<<<<<<<<<<< * ) * ) */ - __pyx_t_2 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_value)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_value)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_v_self->array_to_gl_constant == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); - __PYX_ERR(0, 146, __pyx_L1_error) + __PYX_ERR(0, 148, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_self->array_to_gl_constant); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_self->array_to_gl_constant); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); @@ -3358,32 +3362,32 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_t_2 = 0; __pyx_t_1 = 0; - /* "src/numpy_formathandler.pyx":145 + /* "src/numpy_formathandler.pyx":147 * if constant is None: * raise TypeError( * """Don't know GL type for array of type %r, known types: %s\nvalue:%s"""%( # <<<<<<<<<<<<<< * array_descr(value), self.array_to_gl_constant.keys(), value, * ) */ - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Don_t_know_GL_type_for_array_of, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Don_t_know_GL_type_for_array_of, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "src/numpy_formathandler.pyx":144 + /* "src/numpy_formathandler.pyx":146 * cdef object constant = self.array_to_gl_constant.get( array_descr(value) ) * if constant is None: * raise TypeError( # <<<<<<<<<<<<<< * """Don't know GL type for array of type %r, known types: %s\nvalue:%s"""%( * array_descr(value), self.array_to_gl_constant.keys(), value, */ - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 144, __pyx_L1_error) + __PYX_ERR(0, 146, __pyx_L1_error) - /* "src/numpy_formathandler.pyx":143 + /* "src/numpy_formathandler.pyx":145 * cdef np.ndarray value = self.c_check_array( instance ) * cdef object constant = self.array_to_gl_constant.get( array_descr(value) ) * if constant is None: # <<<<<<<<<<<<<< @@ -3392,7 +3396,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ } - /* "src/numpy_formathandler.pyx":149 + /* "src/numpy_formathandler.pyx":151 * ) * ) * return constant # <<<<<<<<<<<<<< @@ -3404,7 +3408,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_r = __pyx_v_constant; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":139 + /* "src/numpy_formathandler.pyx":141 * """Given a data-value, calculate number of bytes required to represent""" * return instance.nbytes * cdef c_arrayToGLType( self, object instance ): # <<<<<<<<<<<<<< @@ -3427,7 +3431,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":150 +/* "src/numpy_formathandler.pyx":152 * ) * return constant * cdef c_asArray( self, object instance, object typeCode ): # <<<<<<<<<<<<<< @@ -3447,7 +3451,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle int __pyx_t_4; __Pyx_RefNannySetupContext("c_asArray", 0); - /* "src/numpy_formathandler.pyx":155 + /* "src/numpy_formathandler.pyx":157 * cdef np.dtype typecode * cdef int res * if PyArray_CheckScalar(instance): # <<<<<<<<<<<<<< @@ -3457,7 +3461,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_t_1 = (PyArray_CheckScalar(__pyx_v_instance) != 0); if (__pyx_t_1) { - /* "src/numpy_formathandler.pyx":156 + /* "src/numpy_formathandler.pyx":158 * cdef int res * if PyArray_CheckScalar(instance): * Py_INCREF(instance) # <<<<<<<<<<<<<< @@ -3466,20 +3470,20 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ Py_INCREF(__pyx_v_instance); - /* "src/numpy_formathandler.pyx":157 + /* "src/numpy_formathandler.pyx":159 * if PyArray_CheckScalar(instance): * Py_INCREF(instance) * working = self.c_zeros((1,), typeCode) # <<<<<<<<<<<<<< * res = PyArray_FillWithScalar(working, instance) * if res < -1: */ - __pyx_t_2 = ((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.c_zeros(((struct __pyx_obj_17OpenGL_accelerate_13formathandler_FormatHandler *)__pyx_v_self), __pyx_tuple_, __pyx_v_typeCode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.c_zeros(((struct __pyx_obj_17OpenGL_accelerate_13formathandler_FormatHandler *)__pyx_v_self), __pyx_tuple_, __pyx_v_typeCode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 157, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 159, __pyx_L1_error) __pyx_v_working = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":158 + /* "src/numpy_formathandler.pyx":160 * Py_INCREF(instance) * working = self.c_zeros((1,), typeCode) * res = PyArray_FillWithScalar(working, instance) # <<<<<<<<<<<<<< @@ -3488,7 +3492,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ __pyx_v_res = PyArray_FillWithScalar(((PyObject *)__pyx_v_working), __pyx_v_instance); - /* "src/numpy_formathandler.pyx":159 + /* "src/numpy_formathandler.pyx":161 * working = self.c_zeros((1,), typeCode) * res = PyArray_FillWithScalar(working, instance) * if res < -1: # <<<<<<<<<<<<<< @@ -3498,16 +3502,16 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_t_1 = ((__pyx_v_res < -1L) != 0); if (unlikely(__pyx_t_1)) { - /* "src/numpy_formathandler.pyx":160 + /* "src/numpy_formathandler.pyx":162 * res = PyArray_FillWithScalar(working, instance) * if res < -1: * raise ValueError("Unable to fill new array with value %r (%s)"%(instance,instance.__class__)) # <<<<<<<<<<<<<< * else: * working = (self.c_check_array( instance )) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_instance, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_instance, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_instance); __Pyx_GIVEREF(__pyx_v_instance); @@ -3515,17 +3519,17 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Unable_to_fill_new_array_with_va, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Unable_to_fill_new_array_with_va, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 160, __pyx_L1_error) + __PYX_ERR(0, 162, __pyx_L1_error) - /* "src/numpy_formathandler.pyx":159 + /* "src/numpy_formathandler.pyx":161 * working = self.c_zeros((1,), typeCode) * res = PyArray_FillWithScalar(working, instance) * if res < -1: # <<<<<<<<<<<<<< @@ -3534,7 +3538,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle */ } - /* "src/numpy_formathandler.pyx":155 + /* "src/numpy_formathandler.pyx":157 * cdef np.dtype typecode * cdef int res * if PyArray_CheckScalar(instance): # <<<<<<<<<<<<<< @@ -3544,7 +3548,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle goto __pyx_L3; } - /* "src/numpy_formathandler.pyx":162 + /* "src/numpy_formathandler.pyx":164 * raise ValueError("Unable to fill new array with value %r (%s)"%(instance,instance.__class__)) * else: * working = (self.c_check_array( instance )) # <<<<<<<<<<<<<< @@ -3552,7 +3556,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle * typecode = array_descr(working) */ /*else*/ { - __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->c_check_array(__pyx_v_self, __pyx_v_instance)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); @@ -3562,7 +3566,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle } __pyx_L3:; - /* "src/numpy_formathandler.pyx":163 + /* "src/numpy_formathandler.pyx":165 * else: * working = (self.c_check_array( instance )) * if typeCode is None: # <<<<<<<<<<<<<< @@ -3573,19 +3577,19 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { - /* "src/numpy_formathandler.pyx":164 + /* "src/numpy_formathandler.pyx":166 * working = (self.c_check_array( instance )) * if typeCode is None: * typecode = array_descr(working) # <<<<<<<<<<<<<< * else: * typecode = self.typeCodeToDtype( typeCode ) */ - __pyx_t_2 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_working)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_working)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_typecode = ((PyArray_Descr *)__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":163 + /* "src/numpy_formathandler.pyx":165 * else: * working = (self.c_check_array( instance )) * if typeCode is None: # <<<<<<<<<<<<<< @@ -3595,7 +3599,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle goto __pyx_L5; } - /* "src/numpy_formathandler.pyx":166 + /* "src/numpy_formathandler.pyx":168 * typecode = array_descr(working) * else: * typecode = self.typeCodeToDtype( typeCode ) # <<<<<<<<<<<<<< @@ -3603,14 +3607,14 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle * cdef c_unitSize( self, object instance, typeCode ): */ /*else*/ { - __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->typeCodeToDtype(__pyx_v_self, __pyx_v_typeCode)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->typeCodeToDtype(__pyx_v_self, __pyx_v_typeCode)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_typecode = ((PyArray_Descr *)__pyx_t_2); __pyx_t_2 = 0; } __pyx_L5:; - /* "src/numpy_formathandler.pyx":167 + /* "src/numpy_formathandler.pyx":169 * else: * typecode = self.typeCodeToDtype( typeCode ) * return self.contiguous( working, typecode ) # <<<<<<<<<<<<<< @@ -3618,13 +3622,13 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle * """Retrieve last dimension of the array""" */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->contiguous(__pyx_v_self, __pyx_v_working, __pyx_v_typecode)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->contiguous(__pyx_v_self, __pyx_v_working, __pyx_v_typecode)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":150 + /* "src/numpy_formathandler.pyx":152 * ) * return constant * cdef c_asArray( self, object instance, object typeCode ): # <<<<<<<<<<<<<< @@ -3646,7 +3650,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":168 +/* "src/numpy_formathandler.pyx":170 * typecode = self.typeCodeToDtype( typeCode ) * return self.contiguous( working, typecode ) * cdef c_unitSize( self, object instance, typeCode ): # <<<<<<<<<<<<<< @@ -3660,7 +3664,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("c_unitSize", 0); - /* "src/numpy_formathandler.pyx":170 + /* "src/numpy_formathandler.pyx":172 * cdef c_unitSize( self, object instance, typeCode ): * """Retrieve last dimension of the array""" * return PyArray_DIM(instance, PyArray_NDIM(instance)-1) # <<<<<<<<<<<<<< @@ -3668,15 +3672,15 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle * """Retrieve full set of dimensions for the array as tuple""" */ __Pyx_XDECREF(__pyx_r); - if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 170, __pyx_L1_error) - if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 170, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyInt_From_int(PyArray_DIM(((PyArrayObject *)__pyx_v_instance), (PyArray_NDIM(((PyArrayObject *)__pyx_v_instance)) - 1))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 172, __pyx_L1_error) + if (!(likely(((__pyx_v_instance) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_instance, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(PyArray_DIM(((PyArrayObject *)__pyx_v_instance), (PyArray_NDIM(((PyArrayObject *)__pyx_v_instance)) - 1))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":168 + /* "src/numpy_formathandler.pyx":170 * typecode = self.typeCodeToDtype( typeCode ) * return self.contiguous( working, typecode ) * cdef c_unitSize( self, object instance, typeCode ): # <<<<<<<<<<<<<< @@ -3695,7 +3699,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":171 +/* "src/numpy_formathandler.pyx":173 * """Retrieve last dimension of the array""" * return PyArray_DIM(instance, PyArray_NDIM(instance)-1) * cdef c_dimensions( self, object instance ): # <<<<<<<<<<<<<< @@ -3709,7 +3713,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("c_dimensions", 0); - /* "src/numpy_formathandler.pyx":173 + /* "src/numpy_formathandler.pyx":175 * cdef c_dimensions( self, object instance ): * """Retrieve full set of dimensions for the array as tuple""" * return instance.shape # <<<<<<<<<<<<<< @@ -3717,13 +3721,13 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle * cdef np.dtype typeCodeToDtype( self, object typeCode ): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_instance, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_instance, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":171 + /* "src/numpy_formathandler.pyx":173 * """Retrieve last dimension of the array""" * return PyArray_DIM(instance, PyArray_NDIM(instance)-1) * cdef c_dimensions( self, object instance ): # <<<<<<<<<<<<<< @@ -3742,7 +3746,7 @@ static PyObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyHandle return __pyx_r; } -/* "src/numpy_formathandler.pyx":175 +/* "src/numpy_formathandler.pyx":177 * return instance.shape * * cdef np.dtype typeCodeToDtype( self, object typeCode ): # <<<<<<<<<<<<<< @@ -3760,7 +3764,7 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH int __pyx_t_5; __Pyx_RefNannySetupContext("typeCodeToDtype", 0); - /* "src/numpy_formathandler.pyx":177 + /* "src/numpy_formathandler.pyx":179 * cdef np.dtype typeCodeToDtype( self, object typeCode ): * """Convert type-code specification to a numpy dtype instance""" * if isinstance( typeCode, np.dtype ): # <<<<<<<<<<<<<< @@ -3771,7 +3775,7 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "src/numpy_formathandler.pyx":178 + /* "src/numpy_formathandler.pyx":180 * """Convert type-code specification to a numpy dtype instance""" * if isinstance( typeCode, np.dtype ): * return typeCode # <<<<<<<<<<<<<< @@ -3779,12 +3783,12 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH * return np.dtype( typeCode ) */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - if (!(likely(((__pyx_v_typeCode) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_typeCode, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(0, 178, __pyx_L1_error) + if (!(likely(((__pyx_v_typeCode) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_typeCode, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_INCREF(__pyx_v_typeCode); __pyx_r = ((PyArray_Descr *)__pyx_v_typeCode); goto __pyx_L0; - /* "src/numpy_formathandler.pyx":177 + /* "src/numpy_formathandler.pyx":179 * cdef np.dtype typeCodeToDtype( self, object typeCode ): * """Convert type-code specification to a numpy dtype instance""" * if isinstance( typeCode, np.dtype ): # <<<<<<<<<<<<<< @@ -3793,16 +3797,16 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ } - /* "src/numpy_formathandler.pyx":179 + /* "src/numpy_formathandler.pyx":181 * if isinstance( typeCode, np.dtype ): * return typeCode * elif isinstance( typeCode, (bytes,unicode) ): # <<<<<<<<<<<<<< * return np.dtype( typeCode ) * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_IsInstance(__pyx_v_typeCode, __pyx_t_3); __pyx_t_5 = (__pyx_t_1 != 0); @@ -3820,7 +3824,7 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { - /* "src/numpy_formathandler.pyx":180 + /* "src/numpy_formathandler.pyx":182 * return typeCode * elif isinstance( typeCode, (bytes,unicode) ): * return np.dtype( typeCode ) # <<<<<<<<<<<<<< @@ -3828,13 +3832,13 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH * return self.gl_constant_to_array[ typeCode ] */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_v_typeCode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_v_typeCode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":179 + /* "src/numpy_formathandler.pyx":181 * if isinstance( typeCode, np.dtype ): * return typeCode * elif isinstance( typeCode, (bytes,unicode) ): # <<<<<<<<<<<<<< @@ -3843,7 +3847,7 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ } - /* "src/numpy_formathandler.pyx":182 + /* "src/numpy_formathandler.pyx":184 * return np.dtype( typeCode ) * else: * return self.gl_constant_to_array[ typeCode ] # <<<<<<<<<<<<<< @@ -3854,17 +3858,17 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __Pyx_XDECREF(((PyObject *)__pyx_r)); if (unlikely(__pyx_v_self->gl_constant_to_array == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 182, __pyx_L1_error) + __PYX_ERR(0, 184, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->gl_constant_to_array, __pyx_v_typeCode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->gl_constant_to_array, __pyx_v_typeCode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(0, 182, __pyx_L1_error) + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(0, 184, __pyx_L1_error) __pyx_r = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } - /* "src/numpy_formathandler.pyx":175 + /* "src/numpy_formathandler.pyx":177 * return instance.shape * * cdef np.dtype typeCodeToDtype( self, object typeCode ): # <<<<<<<<<<<<<< @@ -3884,7 +3888,7 @@ static PyArray_Descr *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH return __pyx_r; } -/* "src/numpy_formathandler.pyx":183 +/* "src/numpy_formathandler.pyx":185 * else: * return self.gl_constant_to_array[ typeCode ] * cdef np.ndarray contiguous( self, np.ndarray instance, np.dtype dtype ): # <<<<<<<<<<<<<< @@ -3906,7 +3910,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH int __pyx_t_9; __Pyx_RefNannySetupContext("contiguous", 0); - /* "src/numpy_formathandler.pyx":193 + /* "src/numpy_formathandler.pyx":195 * :rtype: np.ndarray * """ * if self.ERROR_ON_COPY: # <<<<<<<<<<<<<< @@ -3916,7 +3920,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __pyx_t_1 = (__pyx_v_self->__pyx_base.ERROR_ON_COPY != 0); if (__pyx_t_1) { - /* "src/numpy_formathandler.pyx":194 + /* "src/numpy_formathandler.pyx":196 * """ * if self.ERROR_ON_COPY: * if not PyArray_ISCARRAY_RO( instance ): # <<<<<<<<<<<<<< @@ -3926,17 +3930,17 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __pyx_t_1 = ((!(PyArray_ISCARRAY_RO(__pyx_v_instance) != 0)) != 0); if (unlikely(__pyx_t_1)) { - /* "src/numpy_formathandler.pyx":195 + /* "src/numpy_formathandler.pyx":197 * if self.ERROR_ON_COPY: * if not PyArray_ISCARRAY_RO( instance ): * raise CopyError( # <<<<<<<<<<<<<< * """Non-contiguous array passed""", * instance, */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CopyError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CopyError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "src/numpy_formathandler.pyx":197 + /* "src/numpy_formathandler.pyx":199 * raise CopyError( * """Non-contiguous array passed""", * instance, # <<<<<<<<<<<<<< @@ -3958,7 +3962,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_Non_contiguous_array_passed, ((PyObject *)__pyx_v_instance)}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -3966,13 +3970,13 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_Non_contiguous_array_passed, ((PyObject *)__pyx_v_instance)}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -3983,16 +3987,16 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __Pyx_INCREF(((PyObject *)__pyx_v_instance)); __Pyx_GIVEREF(((PyObject *)__pyx_v_instance)); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_instance)); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 195, __pyx_L1_error) + __PYX_ERR(0, 197, __pyx_L1_error) - /* "src/numpy_formathandler.pyx":194 + /* "src/numpy_formathandler.pyx":196 * """ * if self.ERROR_ON_COPY: * if not PyArray_ISCARRAY_RO( instance ): # <<<<<<<<<<<<<< @@ -4001,44 +4005,44 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ } - /* "src/numpy_formathandler.pyx":199 + /* "src/numpy_formathandler.pyx":201 * instance, * ) * elif array_descr(instance) != dtype: # <<<<<<<<<<<<<< * raise CopyError( * """Array of type %r passed, required array of type %r""", */ - __pyx_t_2 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_instance)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_instance)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_v_dtype), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_v_dtype), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_1)) { - /* "src/numpy_formathandler.pyx":200 + /* "src/numpy_formathandler.pyx":202 * ) * elif array_descr(instance) != dtype: * raise CopyError( # <<<<<<<<<<<<<< * """Array of type %r passed, required array of type %r""", * array_descr(instance).char, dtype.char, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CopyError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CopyError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "src/numpy_formathandler.pyx":202 + /* "src/numpy_formathandler.pyx":204 * raise CopyError( * """Array of type %r passed, required array of type %r""", * array_descr(instance).char, dtype.char, # <<<<<<<<<<<<<< * ) * # okay, so just return... */ - __pyx_t_6 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_instance)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_6 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_instance)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_char); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_char); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dtype), __pyx_n_s_char); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dtype), __pyx_n_s_char); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_5 = 0; @@ -4055,7 +4059,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_kp_s_Array_of_type_r_passed_required, __pyx_t_4, __pyx_t_6}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -4065,7 +4069,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_kp_s_Array_of_type_r_passed_required, __pyx_t_4, __pyx_t_6}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -4073,7 +4077,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH } else #endif { - __pyx_t_8 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -4087,16 +4091,16 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_5, __pyx_t_6); __pyx_t_4 = 0; __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 200, __pyx_L1_error) + __PYX_ERR(0, 202, __pyx_L1_error) - /* "src/numpy_formathandler.pyx":199 + /* "src/numpy_formathandler.pyx":201 * instance, * ) * elif array_descr(instance) != dtype: # <<<<<<<<<<<<<< @@ -4105,7 +4109,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ } - /* "src/numpy_formathandler.pyx":205 + /* "src/numpy_formathandler.pyx":207 * ) * # okay, so just return... * return instance # <<<<<<<<<<<<<< @@ -4117,7 +4121,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __pyx_r = __pyx_v_instance; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":193 + /* "src/numpy_formathandler.pyx":195 * :rtype: np.ndarray * """ * if self.ERROR_ON_COPY: # <<<<<<<<<<<<<< @@ -4126,7 +4130,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ } - /* "src/numpy_formathandler.pyx":208 + /* "src/numpy_formathandler.pyx":210 * else: * # "convert" regardless (will return same instance if already contiguous) * if PyArray_CheckScalar(instance): # <<<<<<<<<<<<<< @@ -4137,7 +4141,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __pyx_t_1 = (PyArray_CheckScalar(((PyObject *)__pyx_v_instance)) != 0); if (__pyx_t_1) { - /* "src/numpy_formathandler.pyx":209 + /* "src/numpy_formathandler.pyx":211 * # "convert" regardless (will return same instance if already contiguous) * if PyArray_CheckScalar(instance): * Py_INCREF( instance ) # <<<<<<<<<<<<<< @@ -4146,7 +4150,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ Py_INCREF(((PyObject *)__pyx_v_instance)); - /* "src/numpy_formathandler.pyx":210 + /* "src/numpy_formathandler.pyx":212 * if PyArray_CheckScalar(instance): * Py_INCREF( instance ) * return PyArray_EnsureArray(instance) # <<<<<<<<<<<<<< @@ -4154,13 +4158,13 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH * # TODO: make sure there's no way to segfault here */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_3 = ((PyObject *)PyArray_EnsureArray(((PyObject *)__pyx_v_instance))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)PyArray_EnsureArray(((PyObject *)__pyx_v_instance))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":208 + /* "src/numpy_formathandler.pyx":210 * else: * # "convert" regardless (will return same instance if already contiguous) * if PyArray_CheckScalar(instance): # <<<<<<<<<<<<<< @@ -4169,7 +4173,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ } - /* "src/numpy_formathandler.pyx":211 + /* "src/numpy_formathandler.pyx":213 * Py_INCREF( instance ) * return PyArray_EnsureArray(instance) * if not PyArray_ISCARRAY_RO( instance ) or array_descr(instance) != dtype: # <<<<<<<<<<<<<< @@ -4182,17 +4186,17 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH __pyx_t_1 = __pyx_t_9; goto __pyx_L7_bool_binop_done; } - __pyx_t_3 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_instance)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_f_17OpenGL_accelerate_19numpy_formathandler_array_descr(__pyx_v_instance)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_v_dtype), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_v_dtype), Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_9; __pyx_L7_bool_binop_done:; if (__pyx_t_1) { - /* "src/numpy_formathandler.pyx":213 + /* "src/numpy_formathandler.pyx":215 * if not PyArray_ISCARRAY_RO( instance ) or array_descr(instance) != dtype: * # TODO: make sure there's no way to segfault here * Py_INCREF( instance ) # <<<<<<<<<<<<<< @@ -4201,7 +4205,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ Py_INCREF(((PyObject *)__pyx_v_instance)); - /* "src/numpy_formathandler.pyx":214 + /* "src/numpy_formathandler.pyx":216 * # TODO: make sure there's no way to segfault here * Py_INCREF( instance ) * Py_INCREF( dtype ) # <<<<<<<<<<<<<< @@ -4210,7 +4214,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ Py_INCREF(((PyObject *)__pyx_v_dtype)); - /* "src/numpy_formathandler.pyx":215 + /* "src/numpy_formathandler.pyx":217 * Py_INCREF( instance ) * Py_INCREF( dtype ) * return PyArray_FromArray( # <<<<<<<<<<<<<< @@ -4219,20 +4223,20 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - /* "src/numpy_formathandler.pyx":218 + /* "src/numpy_formathandler.pyx":220 * instance, * dtype, * NPY_ARRAY_CARRAY|NPY_ARRAY_FORCECAST # <<<<<<<<<<<<<< * ) * */ - __pyx_t_2 = ((PyObject *)PyArray_FromArray(__pyx_v_instance, __pyx_v_dtype, (NPY_ARRAY_CARRAY | NPY_ARRAY_FORCECAST))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)PyArray_FromArray(__pyx_v_instance, __pyx_v_dtype, (NPY_ARRAY_CARRAY | NPY_ARRAY_FORCECAST))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "src/numpy_formathandler.pyx":211 + /* "src/numpy_formathandler.pyx":213 * Py_INCREF( instance ) * return PyArray_EnsureArray(instance) * if not PyArray_ISCARRAY_RO( instance ) or array_descr(instance) != dtype: # <<<<<<<<<<<<<< @@ -4241,7 +4245,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH */ } - /* "src/numpy_formathandler.pyx":222 + /* "src/numpy_formathandler.pyx":224 * * else: * return instance # <<<<<<<<<<<<<< @@ -4256,7 +4260,7 @@ static PyArrayObject *__pyx_f_17OpenGL_accelerate_19numpy_formathandler_12NumpyH } } - /* "src/numpy_formathandler.pyx":183 + /* "src/numpy_formathandler.pyx":185 * else: * return self.gl_constant_to_array[ typeCode ] * cdef np.ndarray contiguous( self, np.ndarray instance, np.dtype dtype ): # <<<<<<<<<<<<<< @@ -7886,6 +7890,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1}, + {&__pyx_n_s_intc, __pyx_k_intc, sizeof(__pyx_k_intc), 0, 0, 1, 1}, {&__pyx_n_s_isOutput, __pyx_k_isOutput, sizeof(__pyx_k_isOutput), 0, 0, 1, 1}, {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, @@ -7923,6 +7928,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 0, 1, 1}, {&__pyx_n_s_uint64, __pyx_k_uint64, sizeof(__pyx_k_uint64), 0, 0, 1, 1}, {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1}, + {&__pyx_n_s_uintc, __pyx_k_uintc, sizeof(__pyx_k_uintc), 0, 0, 1, 1}, {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, @@ -7931,8 +7937,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 124, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(2, 285, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 856, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1038, __pyx_L1_error) @@ -7945,14 +7951,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "src/numpy_formathandler.pyx":157 + /* "src/numpy_formathandler.pyx":159 * if PyArray_CheckScalar(instance): * Py_INCREF(instance) * working = self.c_zeros((1,), typeCode) # <<<<<<<<<<<<<< * res = PyArray_FillWithScalar(working, instance) * if res < -1: */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); @@ -8304,8 +8310,10 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_numpy_formathandler(PyObject *__py PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; - int __pyx_t_23; - int __pyx_t_24; + PyObject *__pyx_t_23 = NULL; + PyObject *__pyx_t_24 = NULL; + int __pyx_t_25; + int __pyx_t_26; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { @@ -8521,8 +8529,8 @@ if (!__Pyx_RefNanny) { * HANDLED_TYPES = ( * np.ndarray, * np.bool_, # <<<<<<<<<<<<<< - * np.int8, - * np.uint8, + * np.intc, + * np.uintc, */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -8533,261 +8541,287 @@ if (!__Pyx_RefNanny) { /* "src/numpy_formathandler.pyx":46 * np.ndarray, * np.bool_, - * np.int8, # <<<<<<<<<<<<<< - * np.uint8, - * np.int16, + * np.intc, # <<<<<<<<<<<<<< + * np.uintc, + * np.int8, */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "src/numpy_formathandler.pyx":47 * np.bool_, + * np.intc, + * np.uintc, # <<<<<<<<<<<<<< * np.int8, - * np.uint8, # <<<<<<<<<<<<<< - * np.int16, - * np.uint16, + * np.uint8, */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uintc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "src/numpy_formathandler.pyx":48 + * np.intc, + * np.uintc, + * np.int8, # <<<<<<<<<<<<<< + * np.uint8, + * np.int16, + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/numpy_formathandler.pyx":49 + * np.uintc, + * np.int8, + * np.uint8, # <<<<<<<<<<<<<< + * np.int16, + * np.uint16, + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/numpy_formathandler.pyx":50 * np.int8, * np.uint8, * np.int16, # <<<<<<<<<<<<<< * np.uint16, * np.int32, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":49 + /* "src/numpy_formathandler.pyx":51 * np.uint8, * np.int16, * np.uint16, # <<<<<<<<<<<<<< * np.int32, * np.uint32, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 49, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":50 + /* "src/numpy_formathandler.pyx":52 * np.int16, * np.uint16, * np.int32, # <<<<<<<<<<<<<< * np.uint32, * np.int64, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 50, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":51 + /* "src/numpy_formathandler.pyx":53 * np.uint16, * np.int32, * np.uint32, # <<<<<<<<<<<<<< * np.int64, * np.uint64, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 51, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint32); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":52 + /* "src/numpy_formathandler.pyx":54 * np.int32, * np.uint32, * np.int64, # <<<<<<<<<<<<<< * np.uint64, * np.int64, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":53 + /* "src/numpy_formathandler.pyx":55 * np.uint32, * np.int64, * np.uint64, # <<<<<<<<<<<<<< * np.int64, * np.uint64, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint64); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 53, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint64); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":54 + /* "src/numpy_formathandler.pyx":56 * np.int64, * np.uint64, * np.int64, # <<<<<<<<<<<<<< * np.uint64, * np.float16, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 54, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":55 + /* "src/numpy_formathandler.pyx":57 * np.uint64, * np.int64, * np.uint64, # <<<<<<<<<<<<<< * np.float16, * np.float32, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint64); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint64); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":56 + /* "src/numpy_formathandler.pyx":58 * np.int64, * np.uint64, * np.float16, # <<<<<<<<<<<<<< * np.float32, * np.float64, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float16); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 56, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float16); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":57 + /* "src/numpy_formathandler.pyx":59 * np.uint64, * np.float16, * np.float32, # <<<<<<<<<<<<<< * np.float64, * np.complex64, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":58 + /* "src/numpy_formathandler.pyx":60 * np.float16, * np.float32, * np.float64, # <<<<<<<<<<<<<< * np.complex64, * np.complex128, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 58, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":59 + /* "src/numpy_formathandler.pyx":61 * np.float32, * np.float64, * np.complex64, # <<<<<<<<<<<<<< * np.complex128, * np.bytes_, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_complex64); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_16); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_complex64); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":60 + /* "src/numpy_formathandler.pyx":62 * np.float64, * np.complex64, * np.complex128, # <<<<<<<<<<<<<< * np.bytes_, * np.str_, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_complex128); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 60, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_17); + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_complex128); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":61 + /* "src/numpy_formathandler.pyx":63 * np.complex64, * np.complex128, * np.bytes_, # <<<<<<<<<<<<<< * np.str_, * np.void, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bytes_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 61, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_18); + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bytes_2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":62 + /* "src/numpy_formathandler.pyx":64 * np.complex128, * np.bytes_, * np.str_, # <<<<<<<<<<<<<< * np.void, * np.datetime64, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_str); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 62, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_19); + __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_str); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":63 + /* "src/numpy_formathandler.pyx":65 * np.bytes_, * np.str_, * np.void, # <<<<<<<<<<<<<< * np.datetime64, * np.timedelta64, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_void); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 63, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_20); + __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_void); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_22); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":64 + /* "src/numpy_formathandler.pyx":66 * np.str_, * np.void, * np.datetime64, # <<<<<<<<<<<<<< * np.timedelta64, * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 64, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_21); + __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_datetime64); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "src/numpy_formathandler.pyx":65 + /* "src/numpy_formathandler.pyx":67 * np.void, * np.datetime64, * np.timedelta64, # <<<<<<<<<<<<<< * ) * if hasattr(np,'float128'): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 65, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_22); + __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta64); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "src/numpy_formathandler.pyx":44 @@ -8795,9 +8829,9 @@ if (!__Pyx_RefNanny) { * HANDLED_TYPES = ( * np.ndarray, # <<<<<<<<<<<<<< * np.bool_, - * np.int8, + * np.intc, */ - __pyx_t_2 = PyTuple_New(22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(24); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_5numpy_ndarray)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5numpy_ndarray)); @@ -8844,6 +8878,10 @@ if (!__Pyx_RefNanny) { PyTuple_SET_ITEM(__pyx_t_2, 20, __pyx_t_21); __Pyx_GIVEREF(__pyx_t_22); PyTuple_SET_ITEM(__pyx_t_2, 21, __pyx_t_22); + __Pyx_GIVEREF(__pyx_t_23); + PyTuple_SET_ITEM(__pyx_t_2, 22, __pyx_t_23); + __Pyx_GIVEREF(__pyx_t_24); + PyTuple_SET_ITEM(__pyx_t_2, 23, __pyx_t_24); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; @@ -8865,52 +8903,54 @@ if (!__Pyx_RefNanny) { __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; + __pyx_t_23 = 0; + __pyx_t_24 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler->tp_dict, __pyx_n_s_HANDLED_TYPES, __pyx_t_2) < 0) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler); - /* "src/numpy_formathandler.pyx":67 + /* "src/numpy_formathandler.pyx":69 * np.timedelta64, * ) * if hasattr(np,'float128'): # <<<<<<<<<<<<<< * HANDLED_TYPES += (np.float128,) * if hasattr(np,'complex256'): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_23 = __Pyx_HasAttr(__pyx_t_2, __pyx_n_s_float128); if (unlikely(__pyx_t_23 == ((int)-1))) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_25 = __Pyx_HasAttr(__pyx_t_2, __pyx_n_s_float128); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_24 = (__pyx_t_23 != 0); - if (__pyx_t_24) { + __pyx_t_26 = (__pyx_t_25 != 0); + if (__pyx_t_26) { - /* "src/numpy_formathandler.pyx":68 + /* "src/numpy_formathandler.pyx":70 * ) * if hasattr(np,'float128'): * HANDLED_TYPES += (np.float128,) # <<<<<<<<<<<<<< * if hasattr(np,'complex256'): * HANDLED_TYPES += (np.complex256,) */ - __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler, __pyx_n_s_HANDLED_TYPES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler, __pyx_n_s_HANDLED_TYPES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_22, __pyx_n_s_np); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 68, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_22); - __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_22, __pyx_n_s_float128); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 68, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_21); - __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - __pyx_t_22 = PyTuple_New(1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 68, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_22); - __Pyx_GIVEREF(__pyx_t_21); - PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_21); - __pyx_t_21 = 0; - __pyx_t_21 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_22); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 68, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_21); + __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_float128); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_23); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_23); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_23); + __pyx_t_23 = 0; + __pyx_t_23 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_24); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler->tp_dict, __pyx_n_s_HANDLED_TYPES, __pyx_t_21) < 0) __PYX_ERR(0, 68, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler->tp_dict, __pyx_n_s_HANDLED_TYPES, __pyx_t_23) < 0) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; PyType_Modified(__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler); - /* "src/numpy_formathandler.pyx":67 + /* "src/numpy_formathandler.pyx":69 * np.timedelta64, * ) * if hasattr(np,'float128'): # <<<<<<<<<<<<<< @@ -8919,48 +8959,48 @@ if (!__Pyx_RefNanny) { */ } - /* "src/numpy_formathandler.pyx":69 + /* "src/numpy_formathandler.pyx":71 * if hasattr(np,'float128'): * HANDLED_TYPES += (np.float128,) * if hasattr(np,'complex256'): # <<<<<<<<<<<<<< * HANDLED_TYPES += (np.complex256,) * */ - __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_np); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 69, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_21); - __pyx_t_24 = __Pyx_HasAttr(__pyx_t_21, __pyx_n_s_complex256); if (unlikely(__pyx_t_24 == ((int)-1))) __PYX_ERR(0, 69, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; - __pyx_t_23 = (__pyx_t_24 != 0); - if (__pyx_t_23) { + __Pyx_GetModuleGlobalName(__pyx_t_23, __pyx_n_s_np); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_23); + __pyx_t_26 = __Pyx_HasAttr(__pyx_t_23, __pyx_n_s_complex256); if (unlikely(__pyx_t_26 == ((int)-1))) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; + __pyx_t_25 = (__pyx_t_26 != 0); + if (__pyx_t_25) { - /* "src/numpy_formathandler.pyx":70 + /* "src/numpy_formathandler.pyx":72 * HANDLED_TYPES += (np.float128,) * if hasattr(np,'complex256'): * HANDLED_TYPES += (np.complex256,) # <<<<<<<<<<<<<< * * def __init__( self, ERROR_ON_COPY=None, a_to_gl=None, gl_to_a=None ): */ - __Pyx_GetNameInClass(__pyx_t_21, (PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler, __pyx_n_s_HANDLED_TYPES); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 70, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_21); - __Pyx_GetModuleGlobalName(__pyx_t_22, __pyx_n_s_np); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 70, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_22); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_22, __pyx_n_s_complex256); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GetNameInClass(__pyx_t_23, (PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler, __pyx_n_s_HANDLED_TYPES); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_23); + __Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_n_s_np); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_complex256); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - __pyx_t_22 = PyTuple_New(1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 70, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_22); + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_21, __pyx_t_22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_23, __pyx_t_24); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; - __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler->tp_dict, __pyx_n_s_HANDLED_TYPES, __pyx_t_2) < 0) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; + __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler->tp_dict, __pyx_n_s_HANDLED_TYPES, __pyx_t_2) < 0) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_17OpenGL_accelerate_19numpy_formathandler_NumpyHandler); - /* "src/numpy_formathandler.pyx":69 + /* "src/numpy_formathandler.pyx":71 * if hasattr(np,'float128'): * HANDLED_TYPES += (np.float128,) * if hasattr(np,'complex256'): # <<<<<<<<<<<<<< @@ -8969,7 +9009,7 @@ if (!__Pyx_RefNanny) { */ } - /* "src/numpy_formathandler.pyx":227 + /* "src/numpy_formathandler.pyx":229 * # Cython numpy tutorial neglects to mention this AFAICS * # get segfaults without it * import_array() # <<<<<<<<<<<<<< @@ -9030,6 +9070,8 @@ if (!__Pyx_RefNanny) { __Pyx_XDECREF(__pyx_t_20); __Pyx_XDECREF(__pyx_t_21); __Pyx_XDECREF(__pyx_t_22); + __Pyx_XDECREF(__pyx_t_23); + __Pyx_XDECREF(__pyx_t_24); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init OpenGL_accelerate.numpy_formathandler", __pyx_clineno, __pyx_lineno, __pyx_filename); diff --git a/accelerate/src/numpy_formathandler.pyx b/accelerate/src/numpy_formathandler.pyx index 86dc2458..87fff2e7 100644 --- a/accelerate/src/numpy_formathandler.pyx +++ b/accelerate/src/numpy_formathandler.pyx @@ -43,6 +43,8 @@ cdef class NumpyHandler(FormatHandler): HANDLED_TYPES = ( np.ndarray, np.bool_, + np.intc, + np.uintc, np.int8, np.uint8, np.int16, From 3e9791ffb4cd4831dae261d6bea3049ce9e78f01 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Fri, 3 Jan 2020 21:06:20 -0500 Subject: [PATCH 48/48] Bump release to 3.1.5 --- OpenGL/acceleratesupport.py | 2 +- OpenGL/version.py | 2 +- accelerate/OpenGL_accelerate/__init__.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenGL/acceleratesupport.py b/OpenGL/acceleratesupport.py index 7c0f2ef2..e599feb1 100644 --- a/OpenGL/acceleratesupport.py +++ b/OpenGL/acceleratesupport.py @@ -1,7 +1,7 @@ """Common code for accelerated modules""" import logging from OpenGL import _configflags -needed_version = (3,1,3) +needed_version = (3,1,5) _log = logging.getLogger( 'OpenGL.acceleratesupport' ) try: import OpenGL_accelerate diff --git a/OpenGL/version.py b/OpenGL/version.py index b1d85bfb..55ddfd30 100644 --- a/OpenGL/version.py +++ b/OpenGL/version.py @@ -1,2 +1,2 @@ """Declares the current version for use in setuptools and the like""" -__version__ = '3.1.4' +__version__ = '3.1.5' diff --git a/accelerate/OpenGL_accelerate/__init__.py b/accelerate/OpenGL_accelerate/__init__.py index f285bb36..ea3210f0 100644 --- a/accelerate/OpenGL_accelerate/__init__.py +++ b/accelerate/OpenGL_accelerate/__init__.py @@ -6,5 +6,5 @@ PyOpenGL package and is built via the setupaccel.py script in the top level of the PyOpenGL source package. """ -__version__ = '3.1.4' -__version_tuple__ = (3,1,4) +__version__ = '3.1.5' +__version_tuple__ = (3,1,5)