opencl - ViennaCL on OS X: Can't copy data to GPU -
i'm learning work viennacl. first tries on cpu worked fine, trying use opencl. however, can't manage data onto gpu - while matrices seem created, don't contents:
#define viennacl_with_opencl #define viennacl_with_ublas #include <boost/numeric/ublas/matrix.hpp> #include "viennacl/matrix.hpp" int main() { boost::numeric::ublas::matrix<float> data_cpu(1,1); data_cpu(0,0) = 1; viennacl::matrix<float> data_gpu(1,1); viennacl::copy(data_cpu, data_gpu); assert(data_cpu(0,0) == data_gpu(0,0)); }
after this, data_gpu(0,0)
0
believe should 1
.
i'm compiling g++ nocopy.cpp -framework opencl
. using os x provided opencl driver.
what doing wrong here?
edit: removing viennacl_with_opencl
fixes problem, not want.
looks (my?) os x installation of opencl somehow broken. other, plain, opencl examples fail well:
noname:histogram markus$ ./histogram opencl device vendor = nvidia, opencl device name = geforce gt 650m, opencl device version = opencl 1.1 image histogram image type = cl_rgba, cl_unorm_int8: verify_histogram_results failed indx = 0, gpu result = 0, expected result = 8204 image dimensions: 1920 x 1080 pixels, image type = cl_rgba, cl_unorm_int8 time compute histogram = 0 ms image histogram image type = cl_rgba, cl_float: verify_histogram_results failed indx = 0, gpu result = 0, expected result = 8049 image dimensions: 1920 x 1080 pixels, image type = cl_rgba, cl_float time compute histogram = 0 ms noname:histogram markus$ pwd /users/markus/desktop/tmp/opencl-book-samples-read-only/src/chapter_14/histogram
Comments
Post a Comment