• # Des annotations en commentaire

    Posté par . En réponse au journal Pyth(on|ran) + OpenMP ?. Évalué à 8.

    Quitte à ajouter sa propre syntaxe, pourquoi pas mettre les annotations en commentaire ?

    Comme ça :

    def saxpy(x,y,a):
     #@omp parallel for private(i,b)
     for i in range(len(x)):
     b = a* x[i] # laid mais utile pour l'exemple
     y[i]+= b
    
    
    def fibo(n):
     if n < 2 : return n
     else:
     #@omp task default(none) shared(x,n)
     x = fibo(n-1) 
     y = fibo(n-2) 
     #@omp task wait 
     return x+y 
    
    

    Commentaire sous licence LPRAB - http://sam.zoy.org/lprab/