AttributeError: 'NoneType' object has no attribute 'decode'

48 views
Skip to first unread message

jia he

unread,
Dec 20, 2022, 12:47:57 PM12/20/22
to isl Development
i wan't to leanring the example of Presburger Formulas and Polyhedral Compilation
C:
float f1 ( float );
float f2 ( float );
void f ( int n , float A [ restrict static n ] ,
                float B [ restrict static n ])
{
        float t ;
        for ( int i = 0; i < n ; ++ i ) {
                S : t = f1 ( A [ i ]);
                T : B [ i ] = f2 ( t );
        }
}
python:
import isl
import pet
pet.options.set_autodetect(True)
scop = pet.scop.extract_from_C_source("demo/false.c","f")
schedule = scop.get_schedule()
may_read = scop.get_may_reads()
may_write = scop.get_may_writes()
must_write=scop.get_must_writes()
print (may_read)

root@722c4fc34655:~# python3 < dataflow.py
options.c:67: isl_ctx does not reference pet_options
Traceback (most recent call last):
  File "<stdin>", line 9, in <module>
  File "/root/isl/interface/isl.py", line 7019, in __str__
    res = cast(ptr, c_char_p).value.decode('ascii')
AttributeError: 'NoneType' object has no attribute 'decode'

Sven Verdoolaege

unread,
Dec 20, 2022, 12:53:04 PM12/20/22
to jia he, isl Development
On Mon, Dec 19, 2022 at 03:38:06AM -0800, 'jia he' via isl Development wrote:
> i wan't to leanring the example of Presburger Formulas and Polyhedral
> Compilation
> C:
> float f1 ( float );
> float f2 ( float );
> void f ( int n , float A [ restrict static n ] ,
> float B [ restrict static n ])
> {
> float t ;
> for ( int i = 0; i < n ; ++ i ) {
> S : t = f1 ( A [ i ]);
> T : B [ i ] = f2 ( t );
> }
> }
> python:
> import isl
> import pet
> pet.options.set_autodetect(True)
> scop = pet.scop.extract_from_C_source("demo/false.c","f")
> schedule = scop.get_schedule()
> may_read = scop.get_may_reads()
> may_write = scop.get_may_writes()
> must_write=scop.get_must_writes()
> print (may_read)
>
> root@722c4fc34655:~# python3 < dataflow.py
> options.c:67: isl_ctx does not reference pet_options

Which Python interface are you using and which version
of pet/barvinok are you using?
Did you read Section 1.2.3 Python interface?

skimo
Reply all
Reply to author
Forward
0 new messages