 |
|
|
|
Actions
|
|
[ Date Prev][ Date Next][ Thread Prev][ Thread Next][ Date Index][ Thread Index]
RE: [vsipl++] Problem compiling VSIPL++ Matrix code
- To: Stefan Seefeld <stefan@xxxxxxxxxxxxxxxx>
- Subject: RE: [vsipl++] Problem compiling VSIPL++ Matrix code
- From: "Rutledge, Edward" <rutledge@xxxxxxxxxx>
- Date: Wed, 7 May 2008 17:43:34 -0400
Stefan,
That did fix one of the compile errors, but the other still occurs.
Here is the code that fails to compile:
#include <vsip/matrix.hpp>
#include <vsip/initfin.hpp>
#include <vsip/parallel.hpp>
int main(void)
{
vsip::vsipl prog();
const vsip::Matrix<vsip::scalar_i> constM(2,2,99);
vsip::scalar_i a = constM(0,0); // fails to compile
return 0;
}
Here is the output from the compiler:
% g++ -c Test.cc -I/tools/sourceryvsipl++/include
Test.cc: In function 'int main()':
Test.cc:9: error: passing 'const vsip::Matrix<int, vsip::Dense<2u, int, vsip::tuple<0u, 1u, 2u>, vsip::Local_map> >' as 'this' argument of 'typename vsip::impl::Lvalue_factory_type<Block>::type::reference_type vsip::Matrix<T, B>::operator()(vsip::index_type, vsip::index_type) [with T = int, Block = vsip::Dense<2u, int, vsip::tuple<0u, 1u, 2u>, vsip::Local_map>]' discards qualifiers
Thanks for your help,
-Eddie
___________________________
Edward Rutledge
MIT Lincoln Laboratory
244 Wood St
Lexington, MA 02420
781-981-0274
rutledge@xxxxxxxxxx
___________________________
-----Original Message-----
From: Stefan Seefeld [mailto:stefan@xxxxxxxxxxxxxxxx]
Sent: Tuesday, May 06, 2008 4:40 PM
To: Rutledge, Edward
Cc: vsipl++@xxxxxxxxxxxxxxxx
Subject: Re: [vsipl++] Problem compiling VSIPL++ Matrix code
Edward,
Rutledge, Edward wrote:
> Hi,
>
> Using Sourcery VSIPL++ 1.4, I am trying to compile the following program
> but I get compile errors. Looking at the VSIPL++ spec, I think this is
> a valid program. Am I doing something wrong?
No you are not. I can confirm that this should work. Fortunately, there
is a simple work-around:
Insert an additional header on top:
#include <vsip/parallel.hpp>
With that the compile error will go away.
Obviously, we are going to fix this issue such that user code doesn't
have to include that header if they don't otherwise need it.
Thanks,
Stefan
--
Stefan Seefeld
CodeSourcery
stefan@xxxxxxxxxxxxxxxx
(650) 331-3385 x718
|
|