[clblas] 69/125: Converting int types to intptr_t types for pyopencl integration
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Fri May 29 06:57:23 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch master
in repository clblas.
commit b5bbbc2815e18f5bba47a9a953496e4c97fad627
Author: Kent Knox <kent.knox at amd>
Date: Tue May 13 14:22:15 2014 -0500
Converting int types to intptr_t types for pyopencl integration
---
src/wrappers/python/pyclBLAS.pxd | 1 +
src/wrappers/python/pyclBLAS.pyx | 12 ++++++------
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/wrappers/python/pyclBLAS.pxd b/src/wrappers/python/pyclBLAS.pxd
index 0dfbfd9..b3c4e8e 100644
--- a/src/wrappers/python/pyclBLAS.pxd
+++ b/src/wrappers/python/pyclBLAS.pxd
@@ -16,6 +16,7 @@
# This pxd file defines all the enums and structs that we plan to use from
# python. It is used from pyclBLAS.pyx
+from libc.stdint cimport intptr_t, uintptr_t
cdef extern from "clBLAS.h":
# These are base OpenCL enumerations that clBLAS uses
diff --git a/src/wrappers/python/pyclBLAS.pyx b/src/wrappers/python/pyclBLAS.pyx
index 2ede269..6e944c4 100644
--- a/src/wrappers/python/pyclBLAS.pyx
+++ b/src/wrappers/python/pyclBLAS.pyx
@@ -81,12 +81,12 @@ def Sgemm( clblasOrder order, clblasTranspose transA, clblasTranspose transB,
# Simplify python wrapper to only handle 1 queue at this time
if( numCommandQueues != 1 ):
raise IndexError( "pyblasSgemm( ) requires the number of queues to be 1" )
- cdef int pIntQueue = commandQueues.int_ptr
+ cdef intptr_t pIntQueue = commandQueues.int_ptr
cdef cl_command_queue pcqQueue = <cl_command_queue>pIntQueue
# This logic does not yet work for numEventsInWaitList > (greater than) 1
# Need to figure out how python & pyopencl pass lists of objects
- cdef int pIntWaitList = 0
+ cdef intptr_t pIntWaitList = 0
cdef cl_event* pWaitList = NULL
if( numEventsInWaitList > 0 ):
if( numEventsInWaitList < 2 ):
@@ -98,9 +98,9 @@ def Sgemm( clblasOrder order, clblasTranspose transA, clblasTranspose transB,
# Pyopencl objects contain an int_ptr method to get access to the internally wrapped
# OpenCL object pointers
cdef cl_event outEvent = NULL
- cdef int matA = A.int_ptr
- cdef int matB = B.int_ptr
- cdef int matC = C.int_ptr
+ cdef intptr_t matA = A.int_ptr
+ cdef intptr_t matB = B.int_ptr
+ cdef intptr_t matC = C.int_ptr
# Transition execution to clBLAS
cdef clblasStatus result = clblasSgemm( order, transA, transB, M, N, K, alpha, <const cl_mem>matA, offA, lda,
@@ -113,5 +113,5 @@ def Sgemm( clblasOrder order, clblasTranspose transA, clblasTranspose transB,
# Create a pyopencl Event object from the event returned from clBLAS and return
# it to the user
- sgemmEvent = pyopencl.Event.from_int_ptr( <int>outEvent )
+ sgemmEvent = pyopencl.Event.from_int_ptr( <intptr_t>outEvent )
return sgemmEvent
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/clblas.git
More information about the debian-science-commits
mailing list