Erik Schnetter <[email protected]> writes:

> I committed this to my branch as well.
>
> We should add instructions to pocl for how to use PyOpenCL as a test
> case. See e.g. "examples/ViennaCL/README", and
> "tests/testsuite-viennacl.at", which also describes an external
> package that needs to be downloaded separately.

Sure, here are some instructions:

-------------------------------------------
# This here creates a 'sub-interpreter' of the system-wide Python (assumed
# to exist, and to have numpy installed) in a directory 'mypy'. This
# means we don't have to mess up the global Python install.

$ wget 
http://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.7.2.tar.gz
$ python virtualenv-1.7.2/virtualenv.py mypy --system-site-packages --distribute

# set the path to include the 'sub-python'
$ source mypy/bin/activate

$ pip install mako
$ git clone http://github.com/inducer/pyopencl
$ cd pyopencl
$ git submodule init
$ git submodule update
$ cat <<EOF > siteconf.py
CL_INC_DIR = ['/path/to/pocl/installation/include']
CL_LIBNAME = ['pocl']
CL_LIB_DIR = ['/path/to/pocl/installation/lib']
CL_ENABLE_GL = False
CL_PRETEND_VERSION = "1.1"
EOF
$ python setup.py install
# ... builds

$ cd test

# runs all tests
$ py.test -v --capture=no 
# runs a specific file
$ py.test -v --capture=no test_wrapper.py 
# runs a specific test
$ python test_array.py 'test_basic_complex(cl.create_some_context)'
-------------------------------------------

HTH--and let me know if something doesn't work.

FYI, test_wrapper.py covers a large fraction of the entire CL API, so as
long as pocl is still somewhat incomplete, it'll bomb out pretty
quickly.  Personally, getting test_array.py to pass requires far less
API coverage (IIRC) and would be much more meaningful IMO.

Andreas


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
pocl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pocl-devel

Reply via email to