stm compiler issues

stm compiler issues

I just downloaded your stm compiler and took it for a quick spin. I am not sure I installed it correctly or if I am not doing something right. I took you sample and modified it slightly and tried to compile on Windows XP, and I get compiler error, which I dont get. Here is the program:

void* thread_body(void* arg)
{
int i, local_a;
int tid = *((int*)arg);

for (i = 0; i < 100; ++i)
{
/* beginning of atomic section */
__tm_atomic {

local_a = 99;

/* this function can be called both inside
* and outside a transaction since it is
* annotated as tm_callable
*/
// thread_job1();

if (tid % 2 == 0)
{
global_a = local_a + 1;
}
else
{
global_a = local_a - 1;
}

}
/* end of atomic section */

// thread_local_job2(); /* can only be called outside transactio
n */
}

return 0;
}

When I compile with the command line "icl -c test.cpp", I get the following. It seems from the banner that I am using the right compiler (or am I?)

C:stm>icl -c test.cpp
Intel C++ STM Compiler Prototype Edition for applications running on IA-32
Build 20070911 Package ID: W_CC_C_10.0.516
Copyright (C) 1985-2007 Intel Corporation. All rights reserved.

test.cpp
test.cpp(9): error: identifier "__tm_atomic" is undefined
__tm_atomic {
^

test.cpp(9): error: expected a ";"
__tm_atomic {
^

test.cpp(32): warning #12: parsing restarts here after previous syntax error
}
^

compilation aborted for test.cpp (code 2)

4 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

Here is an even smaller example that does not compile... help!

#include
void test(int * p, int * q)
{

int x = 3;
__tm_atomic {
*p += *q + x;
}
}

I think you need to use the Qtm_enabled flag when you invoke icl:

icl -Qtm_enabled -c test.cpp

The product overview page has three sample apps and the command lines needed to compile them.

Thanks!. I guess I should have read the docs :)

Connectez-vous pour laisser un commentaire.