Hi,

This time i used "pip install pyviennacl". The installation is OK. I used
Karl's blog to test the installation. When I tried to convert, numpy array
x to Vector(x), I got the same error message:

ERROR MESSAGE:
>>> gpu_x = pyviennacl.Vector(x)
Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    gpu_x = pyviennacl.Vector(x)
  File "C:\Python34\lib\site-packages\pyviennacl\pycore.py", line 820, in
__init__
    self._init_leaf(args, kwargs)
  File "C:\Python34\lib\site-packages\pyviennacl\pycore.py", line 1172, in
_init_leaf
    self.vcl_leaf = get_leaf(vcl_type)
  File "C:\Python34\lib\site-packages\pyviennacl\pycore.py", line 1148, in
get_leaf
    return vcl_t(args[0])
RuntimeError: ViennaCL: FATAL ERROR: You requested to create a ViennaCL
type using double precision. However, double precision is not supported by
your device.

Then, I used numpy.float32, voila. It seems OK now.

Before I attach the test result, I would like to ask an important question:
How can I create a CompressedMatrix of float32 type?

A = p.CompressedMatrix(5, 5) is creating a matrix with double precision. Is
there any parameter that I can use to create a matrix with single precision
floating number?

I thank you VERY VERY much again.

Kind regards,
Berat

HERE IS THE RESULT WITH numpy.float32:

>>> x = numpy.array([1.0, 2.0, 3.0], dtype=numpy.float32)
>>> A = numpy.array([[1.0, 2.0, 3.0],
                     [0.0, 3.0, 4.0],
                    [0.0, 0.0, 5.0]], dtype=numpy.float32)
>>> gpu_x = pyviennacl.Vector(x)
>>> gpu_A = pyviennacl.Matrix(A)
>>> gpu_y = gpu_A * gpu_x  # matrix-vector product, lazy!
>>> gpu_z = pyviennacl.sin(gpu_y) # element-wise sine
>>> gpu_y
array([ 14.,  18.,  15.], dtype=float32)
>>> gpu_z
array([ 0.99060738, -0.75098723,  0.65028787], dtype=float32)
>>> type(gpu_y)
<class 'pyviennacl.pycore.Mul'>
>>> type(gpu_z)
<class 'pyviennacl.pycore.ElementSin'>
>>> y = gpu_y.value    # trigger evaluation and GPU -> host data copy
>>> type(y)
<class 'numpy.ndarray'>
>>> y
array([ 14.,  18.,  15.], dtype=float32)
>>> gpu_z = gpu_y.execute()    # trigger computation explicitly
>>> type(gpu_z)
<class 'pyviennacl.pycore.Vector'>
>>> gpu_z
array([ 14.,  18.,  15.], dtype=float32)
>>>
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
ViennaCL-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/viennacl-support

Reply via email to