When looking at the gcn plugin, there are a number of environment variables that set/limit launch dimensions: ... $ grep getenv libgomp/plugin/plugin-gcn.c | grep NUM const char *x = secure_getenv ("GCN_NUM_TEAMS"); x = secure_getenv ("GCN_NUM_GANGS"); const char *z = secure_getenv ("GCN_NUM_THREADS"); z = secure_getenv ("GCN_NUM_WORKERS"); ... It would be nice to have similar ones for nvptx.
The OpenMP 5.1 way is OMP_{NUM_THREADS,...}_DEV_{0,1,2,...} etc., but we aren't there yet.