Hi,

 > Sorry for troubling you again 😂! For my final object that implement
> sparse linear system of CFD with matlab and viennaCL platform, I tested
> the example file wrap_csr_cuda. cu, and found that the csr format matrix
> vel_A is clear, but not the device vector vel_x definition. Why there is
> "viennacl::traits::context(vel_A) here? Is it   essetial? I don't find
> it in the user manual.

This specifies that the vector should be created in the same memory 
space as the sparse matrix. This is important if you decide to use CUDA 
and OpenCL or OpenMP concurrently.

In this particular case the argument is not necessary, since CUDA is the 
default context if enabled.

Best regards,
Karli



> 2016年4月10日 17:22,"侠贵族" <[email protected]
> <mailto:[email protected]>>写道:
>
>     Hi karl
>     Thanks for your reply! Yes, it works as your suggestion, and we
>     should not modify the const double pointers after cast them to
>     non-const pointers!
>
>     Best regards
>     Jingbo
>
>     2016-04-10 17:45 GMT+09:00 Karl Rupp <[email protected]
>     <mailto:[email protected]>>:
>
>         Hi,
>
>         if the issue is with const vs. non-const, cast the const-pointer
>         you receive from Matlab to a non-const pointer.
>
>         Best regards,
>         Karli
>
>
>         On 04/09/2016 07:54 PM, 侠贵族 wrote:
>
>             Thanks for reply!  I wrote the wrap code similar as example
>             in viennacl
>             source,
>             viennacl::vector<double>  vec1("device pointer from matlab
>             mxgpuarray
>             method", viennacl::cudamemory, size). It should fit the
>             syntax, I think so.
>
>             2016年4月10日 01:37,"Omar Valerio" <[email protected]
>             <mailto:[email protected]>
>             <mailto:[email protected]
>             <mailto:[email protected]>>>写道:
>
>                  Hello,
>
>                   From the compiler error message. It seems the class
>             constructor
>                  requires two parameters and you are using it with only one.
>
>                  Am Samstag, 9. April 2016 schrieb 侠贵族 :
>
>                      Hi karl
>                      For these days, I tried to combine Mathematica and
>             viennaCL to
>                      get a develop platform. However, Mathematica use
>             its exclusive
>                      CudaMemory mechanism  provided a integer ID from
>             which I can't
>                      get raw device pointers not right now, anyway. I
>             have to change
>                      to Matlab and it offers a ready mxGPUArray methods
>             to extract
>                      raw device pointer and wrap it again to Matlab's
>             gpuArray
>                      object. But when I test a easy example like c = a+b
>             (a,b,c are
>                      device vectors), I face errors:
>
>                      D:/DevelopeTools/Workspace/Matlab_ViennaCL/test.cu
>             <http://test.cu>
>                      <http://test.cu>(84): error: no instance of constructor
>                      "viennacl::vector<NumericT, AlignmentV>::vector [with
>                      NumericT=double,
>                      AlignmentV=1U]" matches the argument list
>                                   argument types are: (const double *,
>                      viennacl::memory_types, int)
>                      ....
>
>                      My point is, in matlabthe mexfunction
>                      void mexFunction(int nlhs, mxArray *plhs[],
>                                        int nrhs, mxArray const *prhs[]){
>                      ...}, the *prhs[] must const to avoid unpredictable
>             errors. but
>                      in viennaCL
>                      vector.hpp/matrix.hpp/compressed_matrix..., there are
>                      not constructor to include  const double * type. Am
>             I right? How
>                      to add a match statement in these .hpp files to
>             solve the problem?
>
>                      I attached my test files.
>
>                      Best wishes
>                      Jingbo
>
>
>
>             
> ------------------------------------------------------------------------------
>             Find and fix application performance issues faster with
>             Applications Manager
>             Applications Manager provides deep performance insights into
>             multiple tiers of
>             your business applications. It resolves application problems
>             quickly and
>             reduces your MTTR. Get your free trial!
>             http://pubads.g.doubleclick.net/
>             gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532
>
>
>
>             _______________________________________________
>             ViennaCL-support mailing list
>             [email protected]
>             <mailto:[email protected]>
>             https://lists.sourceforge.net/lists/listinfo/viennacl-support
>
>
>


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/
gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532
_______________________________________________
ViennaCL-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/viennacl-support

Reply via email to