Git Product home page Git Product logo

Comments (5)

andersbll avatar andersbll commented on August 28, 2024

Sounds very strange. I don't see how this can compile as Objective C. What errors do you get when executing the Makefile with a C++ compiler?

from cudarray.

gatortim avatar gatortim commented on August 28, 2024

Sorry, pretty poor issue description there.

Here is what I'm getting during python setup.py install:

cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
g++ -pthread -shared build/temp.linux-x86_64-2.7/./cudarray/wrap/cudart.o -L/usr/local/cuda-6.5/lib64 -L/home/tim/anaconda/lib -L/home/tim/anaconda/lib -lcudart -lcudarray -lpython2.7 -o build/lib.linux-x86_64-2.7/cudarray/wrap/cudart.so -fPIC
cythoning ./cudarray/wrap/array_data.pyx to ./cudarray/wrap/array_data.cpp

Error compiling Cython file:

...
from libcpp cimport bool
cimport numpy as np

cdef extern from 'cudarray/common.hpp' namespace 'cudarray':
ctypedef int bool_t;

^

cudarray/wrap/array_data.pxd:5:23: Syntax error in ctypedef statement

Error compiling Cython file:

...
@Property
def itemsize(self):
return self.dtype.itemsize

cdef bool_t *bool_ptr(ArrayData a):

^

cudarray/wrap/array_data.pyx:50:5: 'bool_t' is not a type identifier

Error compiling Cython file:

...

cdef int *int_ptr(ArrayData a):
return <int *> a.dev_ptr

cdef bool is_int(ArrayData a):

^

cudarray/wrap/array_data.pyx:62:5: 'bool' is not a type identifier

Error compiling Cython file:

...

cdef bool is_int(ArrayData a):
return a.dtype == np.dtype('int32')

cdef bool is_float(ArrayData a):

^

cudarray/wrap/array_data.pyx:66:5: 'bool' is not a type identifier

Error compiling Cython file:

...
self.dtype = dtype
self.nbytes = size*dtype.itemsize
self.owner = owner
self.offset = offset
if owner is None:
cudaCheck(cudaMalloc(&self.dev_ptr, self.nbytes))

^

cudarray/wrap/array_data.pyx:16:33: Cannot take address of Python variable

Error compiling Cython file:

...
if owner is None:
cudaCheck(cudaMalloc(&self.dev_ptr, self.nbytes))
else:
self.dev_ptr = owner.dev_ptr + offset*dtype.itemsize
if np_data is not None:
cudaCheck(cudaMemcpyAsync(self.dev_ptr, np.PyArray_DATA(np_data),

^

cudarray/wrap/array_data.pyx:20:42: Cannot convert Python object to 'void *'

Error compiling Cython file:

...
if np_data is not None:
cudaCheck(cudaMemcpyAsync(self.dev_ptr, np.PyArray_DATA(np_data),
self.nbytes, cudaMemcpyHostToDevice))

def to_numpy(self, np_array):
    cudaCheck(cudaMemcpy(np.PyArray_DATA(np_array), self.dev_ptr,
                                                       ^

cudarray/wrap/array_data.pyx:24:60: Cannot convert Python object to 'void const *'

Error compiling Cython file:

...
self.nbytes, cudaMemcpyDeviceToHost))
return np_array

def __dealloc__(self):
    if self.owner is None:
        cudaFree(self.dev_ptr)
                    ^

cudarray/wrap/array_data.pyx:30:25: Cannot convert Python object to 'void *'

Error compiling Cython file:

...
def itemsize(self):
return self.dtype.itemsize

cdef bool_t *bool_ptr(ArrayData a):
return <bool_t *> a.dev_ptr

^

cudarray/wrap/array_data.pyx:51:12: 'bool_t' is not a type identifier

Error compiling Cython file:

...
cdef bool_t *bool_ptr(ArrayData a):
return <bool_t *> a.dev_ptr

cdef float *float_ptr(ArrayData a):
return <float *> a.dev_ptr

^

cudarray/wrap/array_data.pyx:55:11: Python objects cannot be cast to pointers of primitive types

Error compiling Cython file:

...
cdef float *float_ptr(ArrayData a):
return <float *> a.dev_ptr

cdef int *int_ptr(ArrayData a):
return <int *> a.dev_ptr

I'm using anaconda and it looks like I've got cython 0.20.1

Did I miss a requirement here? Make and Make Install both complete without any apparent issue.

Thanks
-Tim

from cudarray.

andersbll avatar andersbll commented on August 28, 2024

You need the latest version of Cython (0.21). I have recently updated the requirements in setup.py to reflect this. Be sure to checkout the latest version of CUDArray.

Best,
Anders

from cudarray.

gatortim avatar gatortim commented on August 28, 2024

Hi Anders,
Works like a charm now. Thanks!
-Tim

from cudarray.

andersbll avatar andersbll commented on August 28, 2024

Good to hear! :)

from cudarray.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.