Hi,

In order to add the support for the 'set' directive of OpenACC linked   
to this patch in progress:                                              

    https://gcc.gnu.org/pipermail/gcc-patches/2026-June/722082.html

I've found the following code in                                        
libgomop/oacc-async.c:validate_async_val                                

      if (async >= 0) 
      /* TODO: we reserve 0 for acc_async_noval before  
    we can clarify the semantics of "default_async". */ 
        return 1 + async;                                                       
       

Since the OpenACC specification states the default_async() clause, I'd  
like to clarify this in order to integrate this clause in the patch     
that I mentioned before.                                                

Since currently we have:

    typedef enum acc_async_t { 
    /* Keep in sync with include/gomp-constants.h. */ 
        acc_async_noval = -1, 
        acc_async_sync = -2 
    } acc_async_t;                                                   

But in libgomop/oacc-async.c:validate_async_val we have:

  if (async == acc_async_sync) 
    return -1;

  if (async == acc_async_noval) 
    return 0;

  if (async >= 0) 
    /* TODO: we reserve 0 for acc_async_noval before we can clarify 
    the semantics of "default_async". */ 
    return 1 + async;    


- Should we set the default_async to acc_async_noval initially?

And also,

- Should we integrate the default_async value for all the threads in    
libgomp/env.c (as an env variable)?                                     

- Or should we include the default_async value for each thread in       
goacc_thread instead?                                                   

The second one might imply asking for an active device when the 'set'   
directive is called (or init a new one? I don't see a good reason to    
init a hole thread just for a set call honestly, but I don't know), in  
order to set the default value to the specific thread.                  

---

In my opinion, leaving the default_async to acc_async_noval is          
just fine, and we should also set the enum equal to the actual          
validate_async_val function work, is just shifting by 1 the values      
in the enum. But I would say that I don't know the exact details so     
probably I get wrong something or I'm not seeing something critical for 
the implementation.                                                     

Best,

Sebastian

Reply via email to