Intel® oneAPI Base Toolkit
Support for the core tools and libraries within the base toolkit that are used to build and deploy high-performance data-centric applications.
419 Discussions

Compiler C2589 error in tbb\concurrent_vector.h

joseparrot
Beginner
2,854 Views

Hello, 

When trying to mimic the tachyon sample from previous TBB versions, Visual Studio 2017 C/C++ found compiler error C2589, say, invalid token '(' after '::'. 

Environmet is update on oneAPI Base and Rendering kits, including TBB 2021.1.1.

How to circumvect such error?

Thank you, Ze Parrot

0 Kudos
1 Solution
GouthamK_Intel
Moderator
2,781 Views

Hi,

Glad to know that your issue is resolved!

>>If you can give me a hint on what literature to have, I would appreciate.

Could you please elaborate on what information you are seeking?


Regards

Goutham


View solution in original post

0 Kudos
8 Replies
RahulV_intel
Moderator
2,833 Views

Hi,


Moving this thread to the TBB forum for a quicker response.


--Rahul


0 Kudos
GouthamK_Intel
Moderator
2,811 Views

Hi,

Thanks for reaching out to us!

>>>When trying to mimic the tachyon sample from previous TBB versions, Visual Studio 2017 C/C++ found compiler error C2589, say, invalid token '(' after '::'. 

Are you getting the above error with the newer version of oneAPI Toolkit 2021.1.1?

If yes, could you please provide the source code and steps to reproduce the issue? So that it will help us investigate further.


Thanks & Regards

Goutham


0 Kudos
joseparrot
Beginner
2,801 Views

Hi,

Thanks for the support.

In the meantime I was able to fix that issue, by the way, a result of old code to new tbb libraries. For example, the code from tachyon.serial compiles, link  and run properly. But tachyon.tbb doesn't compile due a lack of an include, task_scheduler_init.h, which doesn't exist anymore in the last version of tbb. 

So now I have another work, that is the migration to actual tbb version.

If you can give me a hint on what literature to have, I would appreciate.

Thank you,

zeparrot

 

0 Kudos
joseparrot
Beginner
2,793 Views

Hello,

Anyway, I add the code where the error ocurred.

First of all, let me answer: yes, I'm with tbb 2021.1.1.

Visual Studio 2017 C++ is set to use Intel oneAPI Threading Building Blocks (oneTBB) --> Use oneTBB set to 'yes'.

Inside concurrent_vector.h, at lines 484-485:

484 : size_type size() const noexcept {
485 : return std::min(this->my_size.load(std::memory_order_acquire), capacity());

The message error C2589 is:

'(1: invalid token at right side of '::', in Project tachyon-ser1api, file concurrent_vector.h

Compilatin output is:

1>------ Compilação iniciada: Projeto: tachyon-ser1api, Configuração: Debug x64 -----(Compilation started: Project tachyon-ser1api, Configuration: Debug x64)-
1>trace.simple.cpp
1>c:\program files (x86)\intel\oneapi\tbb\2021.1.1\include\oneapi\tbb\concurrent_vector.h(485): error C2589: '(': token inválido no lado direito de '::'
1>c:\program files (x86)\intel\oneapi\tbb\2021.1.1\include\oneapi\tbb\concurrent_vector.h(1026): note: consulte a referência à instanciação '<Desconhecido>' de classe <Desconhecido> que está sendo compilada
1>c:\program files (x86)\intel\oneapi\tbb\2021.1.1\include\oneapi\tbb\concurrent_vector.h(634): error C2589: '(': token inválido no lado direito de '::'
1>c:\program files (x86)\intel\oneapi\tbb\2021.1.1\include\oneapi\tbb\concurrent_vector.h(906): error C2589: '(': token inválido no lado direito de '::'
1>c:\program files (x86)\intel\oneapi\tbb\2021.1.1\include\oneapi\tbb\concurrent_vector.h(906): note: Este diagnóstico ocorreu na função gerada pelo compilador 'void tbb::detail::d1::concurrent_vector<T,Allocator>::internal_resize(tbb::detail::d1::concurrent_vector<T,Allocator>::size_type,const Args &...)'
1>c:\program files (x86)\intel\oneapi\tbb\2021.1.1\include\oneapi\tbb\concurrent_vector.h(950): error C2589: '(': token inválido no lado direito de '::'
1>f:\projects-vs2017\oneapi\tachyon-serial\tachyon-ser1api\trace.simple.cpp(147): error C2131: a expressão não foi avaliada como uma constante
1>f:\projects-vs2017\oneapi\tachyon-serial\tachyon-ser1api\trace.simple.cpp(147): note: falha causada por uma leitura de uma variável fora de seu tempo de vida
1>f:\projects-vs2017\oneapi\tachyon-serial\tachyon-ser1api\trace.simple.cpp(147): note: consulte uso de "%*"
1>Projeto de compilação pronto "tachyon-ser1api.vcxproj" -- FALHA.
========== Compilar: 0 com êxito, 1 com falha, 0 atualizados, 0 ignorados

(Compile: 0 sucessful, 1 with fail, 0 update, 0 ignored)

 

Actually, a program to be just serial, doesn't need tbb, so I insert 

#ifndef RUNTIME

#define RUNTIME RUNTIME_SERIAL // predifined 1

#endif

before the definition to RUNTIME RUNTIME_TBB,

that way, isolating the code from tbb routines.

In sequence, the other problems are pure C code old style errors, out of scope  of oneTBB.

What I see as a problem is the next project, that is, tachyon.tbb, which of course, oneTBB is required.

Thanks for the attention,

zeparrot

0 Kudos
GouthamK_Intel
Moderator
2,782 Views

Hi,

Glad to know that your issue is resolved!

>>If you can give me a hint on what literature to have, I would appreciate.

Could you please elaborate on what information you are seeking?


Regards

Goutham


0 Kudos
joseparrot
Beginner
2,747 Views

Hi,

There is no so much literature on TBB to help in porting old code (mine is TBB 1.1 for Windows) to oneAPI TBB. By the other hand, the new version seems to be well documented and it's good enough;  BTW, the new TBB is more friendless and easer to understand.

Most import in my early question, actually there is no error in the library.

Thanks for the attention,

zeparrot

0 Kudos
GouthamK_Intel
Moderator
2,759 Views

Hi,

Reminder:

>>If you can give me a hint on what literature to have, I would appreciate.

Could you please elaborate on what information you are seeking?

 

Regards

Goutham

 

0 Kudos
GouthamK_Intel
Moderator
2,712 Views

Hi, 

Thanks for letting us know ur experience with oneAPI TBB and for accepting the solution!

As this issue has been resolved, we will no longer respond to this thread. 

If you require any additional assistance from Intel, please start a new thread. 

Any further interaction in this thread will be considered community only. 

Have a Good day.

 

Thanks & Regards

Goutham

 

0 Kudos
Reply