transaction_callable not recognized by compiler

transaction_callable not recognized by compiler

ocar的头像

I'm using the STM 4.0 compiler with a new Ubuntu 10.10 installation.

But the compiler doesn't recognize some of the transaction constructs. For example, transaction_safe works fine, transaction_callable creates an error.
Here is some sample code:

#include 
#include 
#include 

 
int foo(int a){
    return ++a;
}

//__attribute__((tm_callable))
 
void bar(){
    // do nothing
}

int main(){
    int i;
    #pragma omp parallel for
    for(i=0;i<10;i++){
        int val = i;
        //__tm_atomic{
	__transaction{
	    val = foo(val);
	    bar();
        }
	printf("%dn", val);
    }
}

The Error Message is:

icc -Qtm_enabled -openmp foo.c -o foo
foo.c(24) (col. 6): error: non transaction ready function "bar" called inside __transaction section
foo.c(18): (col. 5) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
compilation aborted for foo.c (code 2)

I've checked the compiler. It is the Prototype Edition 4.0.

I would appreciate any suggestions.
Thank you in advance.

mer

2 帖子 / 0 new
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项
Ravi Narayanaswamy (Intel)的头像

By default __transaction is assumed to be an __transaction You can only have transaction_safe calls inside these regions. To call a transcation_callable function use __transaction { ... bar()...}

登陆并发表评论。