Hi Kwok, On 30/11/2022 19:50, Kwok Cheung Yeung wrote: > Hello PA, > >> --- libgomp/config/gcn/selector.c >> +++ libgomp/config/gcn/selector.c >> @@ -36,7 +36,7 @@ GOMP_evaluate_current_device (const char *kind, >> const char *arch, >>    if (kind && strcmp (kind, "gpu") != 0) >>      return false; >> >> -  if (arch && strcmp (arch, "gcn") != 0) >> +  if (arch && (strcmp (arch, "gcn") != 0 || strcmp (arch, "amdgcn") >> != 0)) >>      return false; > > The logic here looks wrong to me - surely it should return false if arch > is not 'gcn' AND it is not 'amdgcn'? Sure. Fixed in revised patch. >> @@ -48,8 +48,17 @@ GOMP_evaluate_current_device (const char *kind, >> const char *arch, >>  #endif >> >>  #ifdef __GCN5__ >> -  if (strcmp (isa, "gfx900") == 0 || strcmp (isa, "gfx906") != 0 >> -      || strcmp (isa, "gfx908") == 0) >> +  if (strcmp (isa, "gfx900") == 0 || strcmp (isa, "gfx906") != 0) >> +    return true; >> +#endif >> + >> +#ifdef __CDNA1__ >> +  if (strcmp (isa, "gfx908") == 0) >> +    return true; >> +#endif >> + >> +#ifdef __CDNA2__ >> +  if (strcmp (isa, "gfx90a") == 0) >>      return true; >>  #endif > > Okay for gfx908 and gfx90a, but is there any way of distinguishing > between 'gfx900' and 'gfx906' ISAs? I don't think these are mutually > compatible. > Since I did not find any existing builtin to check the exact ISA, I added all of them for consistency. Let me know if that looks good to you. Thanks, -- PA